(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3474],{4022:(e,t,l)=>{"use strict";l.d(t,{A:()=>a});let a={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/GammaLogoGradient.43edb67f.svg",height:197,width:170,blurWidth:0,blurHeight:0}},59945:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>a});let a={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/atmosphere-background.a041341a.png",height:1513,width:2666,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAMAAABPT11nAAAAM1BMVEX48ur5wZL33cr4y7X6r8X11OT1177z07D35Nj37OP6xrP3ycT4xJv8rafz6uz2zs78pLCxNmi0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAK0lEQVR4nAXBhwEAIAzAoFg73f9fKwA5Ve0A1fdTI8XHmNeI1VrPKjwiBPgWUADzktU9bAAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:5}},14561:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>a});let a={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/canaveral.a27ae3b5.png",height:2250,width:3e3,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAGCAMAAADJ2y/JAAAAD1BMVEUEBAUECxQFEyUHLUcKJzuueyPtAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAJElEQVR4nDWIQQoAMAyDoun/3zwonRfFgNNpc94Y1ABZ9OKfBwq7AEqGsqUMAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:6}},58525:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>a});let a={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/gravity-background.4fa2e36a.png",height:3344,width:5614,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAFCAMAAABPT11nAAAABlBMVEXz7ePz7eTZ2lmJAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAFUlEQVR4nGNggAFGRkYQBhMQBgYAAAGmAA/DfbWqAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:5}},7470:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>a});let a={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/prism-background.2232a16e.png",height:1672,width:3707,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAECAMAAACEE47CAAAALVBMVEX39ezs4OXW4vDfwuLMxensxuD04eLe5e7ks+HSq+LT0uzUwujg2eTIsODl1N5g2x3eAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAJ0lEQVR4nAXBhwEAIAjAsLLB9f+5JohZRCS8O9OdcNx9m0BpqS7hAwyXAKYYie27AAAAAElFTkSuQmCC",blurWidth:8,blurHeight:4}},93230:(e,t,l)=>{"use strict";l.r(t),l.d(t,{default:()=>a});let a={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/satellite-background.e070b8bc.jpg",height:1597,width:2400,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/2wBDAQoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/wgARCAAFAAgDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAf/xAAUAQEAAAAAAAAAAAAAAAAAAAAB/9oADAMBAAIQAxAAAACXBP/EABkQAQACAwAAAAAAAAAAAAAAAAEAAgQTUf/aAAgBAQABPwC2UtQ1UHs//8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAgBAgEBPwB//8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAgBAwEBPwB//9k=",blurWidth:8,blurHeight:5}},46210:(e,t,l)=>{"use strict";l.d(t,{A:()=>a});let a={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/placeholderBackground.e75ddbc7.svg",height:315,width:600,blurWidth:0,blurHeight:0}},24434:(e,t,l)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbilityFactory=t.ProductFeatureMap=void 0;let a=l(4901);t.ProductFeatureMap={plus:["ai_card_count_plus","ai_models_plus","ai_tokens_plus","change_history_unlimited","folders","hide_gamma_badge","unlimited_credits"],pro:["ai_card_count_pro","ai_models_plus","ai_premium_models","ai_tokens_pro","change_history_unlimited","custom_domains","custom_fonts","edit_doc_ai","folders","hide_gamma_badge","individual_analytics","password_protected_docs","unlimited_credits"]};let n={plus:["hide_gamma_badge"],pro:["hide_gamma_badge"]};class o{createForUser(e,l){let{can:o,build:i}=new a.AbilityBuilder(a.Ability);if(e){if(["gamma-admin-readonly@gamma.app"].includes(e.email)&&(o(["view"],"Organization"),o(t.ProductFeatureMap.pro,"Organization"),o(["view"],"Doc"),o(["view"],"Comment")),["gamma-admin@gamma.app"].includes(e.email))o(["admin","view"],"Organization"),o(t.ProductFeatureMap.pro,"Organization"),o(["manage","edit","comment","view"],"Doc"),o(["manage","edit","comment","view"],"Comment");else{for(let t of e.workspaceMemberships||[])t.disabled||("admin"===t.role&&o(["admin","view"],"Organization",{id:t.workspace.id}),"member"===t.role&&o(["view"],"Organization",{id:t.workspace.id}));for(let a of(o(t.ProductFeatureMap.plus,"Organization",{products:{$in:["plus"]}}),o(t.ProductFeatureMap.pro,"Organization",{products:{$in:["pro"]}}),o(["manage","edit","comment","view"],"Doc",{collaborators:{$elemMatch:{"user.id":e.id,permission:"manage"}}}),o(["edit","comment","view"],"Doc",{collaborators:{$elemMatch:{"user.id":e.id,permission:"edit"}}}),o(["edit","comment","view"],"Doc",{accessLinks:{$elemMatch:{token:l,permission:"edit"}}}),o(["comment","view"],"Doc",{collaborators:{$elemMatch:{"user.id":e.id,permission:"comment"}}}),o(["comment","view"],"Doc",{accessLinks:{$elemMatch:{token:l,permission:"comment"}}}),o("view","Doc",{collaborators:{$elemMatch:{"user.id":e.id,permission:"view"}}}),o("view","Doc",{accessLinks:{$elemMatch:{token:l,permission:"view"}}}),e.organizations||[]))o(["manage","edit","comment","view"],"Doc",{"organization.id":a.id,orgAccess:"manage"}),o(["edit","comment","view"],"Doc",{"organization.id":a.id,orgAccess:"edit"}),o(["comment","view"],"Doc",{"organization.id":a.id,orgAccess:"comment"}),o("view","Doc",{"organization.id":a.id,orgAccess:"view"});for(let t of e.channelIds||[])o(["manage","edit","comment","view"],"Doc",{channels:{$elemMatch:{id:t,permission:"manage"}}}),o(["edit","comment","view"],"Doc",{channels:{$elemMatch:{id:t,permission:"edit"}}}),o(["comment","view"],"Doc",{channels:{$elemMatch:{id:t,permission:"comment"}}}),o(["view"],"Doc",{channels:{$elemMatch:{id:t,permission:"view"}}});o("manage","Comment",{"user.id":e.id}),o("manage","SavedMedia",{userId:e.id})}}else(l||""===l)&&(o("view","Doc",{accessLinks:{$elemMatch:{token:l,permission:"edit",type:"token"}}}),o("view","Doc",{accessLinks:{$elemMatch:{token:l,permission:"comment",type:"token"}}}),o("view","Doc",{accessLinks:{$elemMatch:{token:l,permission:"view",type:"token"}}}));return o(n.plus,"Organization",{products:{$in:["plus"]}}),o(n.pro,"Organization",{products:{$in:["pro"]}}),i({detectSubjectType:e=>e.__typename?e.__typename:e.constructor.name})}}t.AbilityFactory=o},9100:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},98092:(e,t,l)=>{"use strict";var a=Object.create?function(e,t,l,a){void 0===a&&(a=l);var n=Object.getOwnPropertyDescriptor(t,l);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[l]}}),Object.defineProperty(e,a,n)}:function(e,t,l,a){void 0===a&&(a=l),e[a]=t[l]},n=function(e,t){for(var l in e)"default"===l||Object.prototype.hasOwnProperty.call(t,l)||a(t,e,l)};Object.defineProperty(t,"__esModule",{value:!0}),n(l(24434),t),n(l(9100),t)},81935:(e,t,l)=>{"use strict";l.d(t,{v:()=>eF});var a=l(31085);window.requestIdleCallback=window.requestIdleCallback||function(e){let t=Date.now();return setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},window.cancelIdleCallback=window.cancelIdleCallback||function(e){clearTimeout(e)},l(11016);var n=l(6172),o=l(93722),i=l(71001),r=l(3564),s=l(95986),d=l(2657),u=l.n(d),c=l(14041),m=l(32133);l(68647),l(37272);var f=l(70602),p=l(36054),g=l(93978),h=l(8301);let b=new f.C(()=>new p.c(e=>{e.next({data:{}}),e.complete()})),y=()=>new g.R({cache:new h.D,connectToDevTools:!1,link:b,ssrMode:!0});var v=l(83479),k=l(12327),w=l(52177),x=l(3641);let S=()=>{k.Ru.loadAndActivate({locale:"en",messages:x.messages})},A=()=>{let e=(0,c.useRef)(!1);e.current||(S(),e.current=!0)},C=e=>{let{children:t}=e;return A(),(0,a.jsxs)(w.CY,{i18n:k.Ru,children:[t," "]})};var z=l(38452),I=l(88957),j=l(13154),F=l(25420),B=l(61778),R=l(35687),_=l(3706),M=l(18651),E=l(2219),T=l(80532),O=l(33023),P=l(80853),N=l(9021),D=l(18588),L=l(59742),W=l(57238),U=l(34363),G=l(65446),H=l(18658),V=l(20501),q=l(24221),K=l(15672),J=l(65998),$=l(31242),Q=l(42948);let Y=["/","/pricing"],X=()=>{let{query:e,asPath:t}=(0,$.useRouter)();return(0,c.useCallback)(l=>{let a=t.split("?")[0],n="en"===e.locale?a:a==="/".concat(e.locale)?"/":a.replace("/".concat(e.locale,"/"),"/"),o=t.split("?")[1],i=a;return Y.includes(n)?(Q.jF.includes(l)&&(i="en"===l?""===n?"/":n:"/".concat(l).concat("/"===n?"":n)),"".concat(i).concat(o?"?".concat(o):"")):null},[t,e])};var Z=l(7908);let ee=e=>{let{onLocaleSelect:t,selectedLocale:l,renderAsLinks:n=!1}=e,o=(0,J.u)("i18nEnabled"),i=X();return(0,w.uB)(),(0,a.jsx)(K.r,{columns:{base:2,md:6},spacing:4,p:4,pb:8,overflowY:"auto",children:(0,Z.qm)().filter(e=>o||"private_beta"!==Q.AT[e.key]).map(e=>{let o=i(e.key);return(0,a.jsx)(P.$,{alignContent:"center",variant:"ghost",colorScheme:"gray",onClick:()=>t(e.key),isActive:e.key===l.key,...n&&o?{href:o,as:_.N,_hover:{textDecoration:"none",bg:"gray.100"}}:{},children:(0,a.jsx)(R.B,{spacing:0,children:(0,a.jsx)(R.B,{direction:"row",alignItems:"center",children:(0,a.jsx)(B.E,{fontWeight:"600",textAlign:"center",w:"100%",fontSize:"sm",children:e.displayName})})})},e.key)})})};var et=l(15576);let el=e=>{let{onLocaleSelect:t,selectedLocaleKey:l,buttonProps:n,showLabelOnMobile:o=!1,activatorDataId:i,renderAsLinks:r=!1}=e,{isOpen:s,onOpen:d,onClose:u}=(0,O.j)(),c=(0,et.l)();return(0,a.jsxs)(a.Fragment,{children:[c&&(0,a.jsx)(P.$,{w:"fit-content",onClick:d,display:{base:o?"block":"none",md:"block"},leftIcon:(0,a.jsx)(T.az,{display:"inline-block",children:(0,a.jsx)(q.g,{icon:V.Bwz})}),variant:"link",textDecoration:"none !important",alignContent:"center",lineHeight:"base",size:"sm",fontWeight:500,_hover:{textDecoration:"none"},...n,...i&&{"data-id":i},children:Q.zd[l].displayName}),(0,a.jsx)(N.K,{onClick:d,display:{base:o?"none":"block",md:"none"},"aria-label":k.Ru._({id:"+DEogc"}),icon:(0,a.jsx)(q.g,{icon:V.Bwz}),variant:"ghost",alignContent:"center",size:"md",fontWeight:500,...n}),s&&(0,a.jsxs)(D.aF,{isOpen:s,onClose:u,size:"6xl",isCentered:!1,preserveScrollBarGap:!1,blockScrollOnMount:!0,scrollBehavior:"outside",children:[(0,a.jsx)(L.m,{zIndex:{base:"tooltip",md:void 0}}),(0,a.jsxs)(W.$,{m:{base:4,md:20},containerProps:{zIndex:{base:"tooltip",md:void 0}},children:[(0,a.jsx)(U.r,{textAlign:"center",fontSize:{base:"xl",md:"3xl"},children:(0,a.jsx)(w.x6,{id:"EghcSN"})}),(0,a.jsx)(G.s,{}),(0,a.jsx)(H.c,{children:(0,a.jsx)(ee,{selectedLocale:Q.zd[l],onLocaleSelect:e=>{null==t||t(e),u()},renderAsLinks:r})})]})]})]})};var ea=l(83073),en=l(67359),eo=l(86724),ei=l(14691);let er=e=>{let{buttonProps:t,showLabelOnMobile:l=!1}=e,n=(0,ea.O)(),o=(0,c.useMemo)(()=>n,[]),[i,r]=(0,eo.M)(ei.E.gammaLocale,null),[s,d]=(0,c.useState)(o);(0,en.O)(s);let u=(0,c.useCallback)(e=>{d(e),r(e)},[r]);return(0,a.jsx)(el,{selectedLocaleKey:n,onLocaleSelect:u,buttonProps:t,showLabelOnMobile:l})};l(73893);let es=e=>"en"!==e&&e&&Q.jF.includes(e)?{home:"/".concat(e),pricing:"/".concat(e,"/pricing")}:{home:"/",pricing:"/pricing"},ed={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/gamma-logo-black.5914e71f.svg"};var eu=l(90088);let ec={position:"relative",fontWeight:"500",fontFamily:"p22-mackinac-pro, sans-serif",lineHeight:"1.2em",letterSpacing:"-0.03em",backgroundImage:"linear-gradient(50deg, #2b0aff, #ff5b8a 49%, #ff5b8a 53%, #ff5b8a 55%, #fba64b 77%, #f99b52)",backgroundClip:"text",color:"transparent"},em=()=>{let e=(0,ea.O)();return(0,a.jsxs)(R.B,{direction:"row",justify:"space-between",children:[(0,a.jsx)(_.N,{href:es(e).home,isExternal:!0,children:(0,a.jsx)(M._,{w:"100px",src:ed.src,alt:"Gamma logo"})}),(0,a.jsx)(er,{buttonProps:{variant:"ghost",colorScheme:"blackAlpha",color:"gray.800"}})]})},ef=e=>{let{lede:t,title:l,children:n,stackProps:o,showFooter:i=!1}=e;return(0,a.jsxs)(R.B,{bg:"white",padding:{base:6,md:8},zIndex:"2",borderRadius:{base:"none",md:"xl"},shadow:{base:"none",md:"lg"},maxW:"100%",w:{base:"100%",md:"500px"},spacing:8,m:{base:0,md:8},minH:{base:"100%",md:"auto"},...o,children:[(0,a.jsx)(em,{}),t&&("string"==typeof t?(0,a.jsx)(B.E,{fontSize:"sm",color:"gray.500",children:t}):t),(0,a.jsx)(E.D,{sx:ec,fontSize:["3xl"],children:l}),(0,a.jsx)(T.az,{flex:1,children:n}),i&&(0,a.jsx)(ep,{})]})},ep=()=>(0,a.jsx)(R.B,{mt:12,align:"center",children:(0,a.jsxs)(B.E,{color:"gray.300",fontSize:"xs",sx:{a:{color:"gray.400",_hover:{textDecoration:"underline"}}},children:[(0,a.jsx)(_.N,{href:eu.er,children:"Terms of Service"})," •"," ",(0,a.jsx)(_.N,{href:eu.WO,children:"Privacy Policy"})]})});class eg extends c.Component{static getDerivedStateFromError(e){return{hasError:!0,errMessage:e.message,shouldMountChildren:!1}}render(){return(0,a.jsxs)(a.Fragment,{children:[this.state.hasError&&(0,a.jsx)(eh,{pos:"absolute",top:0,errMessage:""===this.state.errMessage?void 0:this.state.errMessage}),this.state.shouldMountChildren&&this.props.children]})}constructor(e){super(e),this.state={hasError:!1,errMessage:"",shouldMountChildren:!0}}}let eh=e=>{let{errMessage:t,...l}=e;return(0,a.jsx)(F.s,{"data-error-component":!0,w:"100vw",h:"100vh",overflow:"hidden",bg:"gray.50",zIndex:99999,...l,children:(0,a.jsx)(F.s,{justifyContent:"center",alignItems:"center",flex:1,p:[4,16],left:"50%",top:"50%",children:(0,a.jsx)(ef,{lede:"",title:"Uh oh.",stackProps:{shadow:"lg-dark",position:"relative"},children:(0,a.jsx)(B.E,{children:t||"An unexpected error occurred."})})})})};var eb=l(35015),ey=l(3478),ev=l(1602),ek=l.n(ev),ew=l(90226),ex=l(60204);let eS=e=>({id:e,displayName:e?(0,ew.q)(e):""}),eA=e=>{let t=e?(0,ew.Z)(e):"#cccccc";return{value:t,isDark:ek()(t).isDark()}},eC=e=>{let{children:t}=e,[l]=(0,c.useState)(()=>{let e=ey.A.get("gamma_visitor_id")||"unknown";return{anonymousUser:eS(e),isUserLoading:!1,userStatus:"loggedOut",isGammaAdminUser:!1,isGammaOrgUser:!1,color:eA(e),setCurrentWorkspaceId:()=>{}}});return(0,a.jsx)(ex.R.Provider,{value:l,children:t})};var ez=l(98371);r.$W.autoAddCss=!1;let eI=(0,I.KA)(),ej=(0,o.oY)(s.t1,{styles:{global:{".ProseMirror":{outline:"0 none"}}}});(0,ez.xy)(),z.WC.initialize(),(0,v.Wf)(),(0,j.P)("appMainBundleLoaded"),console.log("\uD83D\uDE80 GammaSite main wrapper imported"),window.console.debug=()=>{};let eF=e=>function(t){return(0,a.jsxs)(eB,{children:[(0,a.jsxs)(u(),{children:[(0,a.jsx)("meta",{content:"Gamma",property:"og:title"},"og:title"),(0,a.jsx)("link",{href:"https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900",rel:"stylesheet"})]}),(0,a.jsx)(e,{...t})]})},eB=e=>{let{children:t}=e;console.log("\uD83D\uDE80 GammaSite sites wrapper rendered"),(0,et.E)();let l=(0,c.useMemo)(()=>y(),[]),o=(0,eb.dC)();return(0,a.jsx)(m.Kq,{store:eI,children:(0,a.jsx)(C,{children:(0,a.jsx)(i.s,{theme:ej,resetCSS:!0,children:(0,a.jsx)(eg,{children:(0,a.jsx)(n.X,{client:l,children:(0,a.jsx)(eC,{children:(0,a.jsx)(eb.gk,{value:o,children:t})})})})})})})}},73893:(e,t,l)=>{"use strict";l.d(t,{$:()=>f});var a,n=l(79253),o=l.n(n),i=l(39907);let r=new URLSearchParams((0,window.location.search)).get("EDITOR_ANIMATION_DEBUG_FACTOR"),s=window.Cypress?0:null!==r?Number(r):null,d=document.cookie.includes("gammadebug=gtpwtw"),u=document.cookie.includes("gamma_e2e_user=true"),c=new URLSearchParams(window.location.search).get("token")||"",m=window.gammaPuppeteerService,f={...null===(a=o()())||void 0===a?void 0:a.publicRuntimeConfig,DEBUG_ENABLED:d,EDITOR_ANIMATION_DEBUG_FACTOR:s,GAMMA_E2E_USER:u,IS_CLIENT_SIDE:!0,IS_USER_TESTING_SESSION:!1,OG_IMAGE_URL:"https://cdn.gamma.app/_app_static/images/og-image-d666e6.jpg",SCHEMA_BUILD:"true"===i.env.SCHEMA_BUILD,SHARE_TOKEN:c,GAMMA_PUPPETEER_SERVICE:m,GAMMA_CYPRESS_TEST:window.Cypress}},71096:(e,t,l)=>{"use strict";l.d(t,{t:()=>j,E:()=>F});var a=l(31085),n=l(63341),o=l(72821),i=l(70323),r=l(33683),s=l(62313),d=l(80532),u=l(40173),c=l(20501),m=l(3040),f=l(24221),p=l(14041);let g={x:-1e3,y:-1e3};function h(e){return"items"in e}function b(e){return"check"in e}function y(e){return"divider"in e}let v=e=>{let{initial:t,top:l,bottom:a}=e,n=Math.abs(l.x-t.x),o=Math.abs(l.y-t.y),i=Math.abs(a.y-t.y);return 0===n?{alpha:0,beta:0}:{alpha:Math.atan(o/n),beta:Math.atan(i/n)}},k=e=>{let{menuItems:t,position:l,isOpen:a,onClose:n}=e,o=(0,p.useRef)(null),i=(0,p.useRef)(new Map),[r,s]=(0,p.useState)([]),{itemsIndex:d,itemsHash:u,getItemFromKey:c}=function(e){let t=new Map,l=(e,t)=>{let l=null;for(let a of e){if(!(l=t[a]))throw console.log(e,a),Error("item not found");t=h(l)?l.items:[]}if(!l)throw console.log(e),Error("item not found");return l},a=function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];e.forEach((e,n)=>{if(!("label"in e))return;let o=e.key;if(t.has(o))throw console.log(t.get(o)),Error("duplicated key=".concat(o));let i=[...l,n];t.set(o,i),h(e)&&a(e.items,i)})};a(e);let n=[...t.entries()].map(e=>{let[t,l]=e;return"".concat(t,":").concat(l.join("|"))}).join(",");return{itemsIndex:t,itemsHash:n,getItemFromKey:(e,a)=>l(t.get(e)||[],a)}}(t),m=(0,p.useCallback)(e=>{var l,a,n,u,m,f,p,g,b,y;let k=null===(l=e.target)||void 0===l?void 0:l.closest("[data-menu-item-key]"),w=null===(a=e.target)||void 0===a?void 0:a.closest("[data-menu-id]"),x=(null==w?void 0:w.getAttribute("data-menu-id"))||"",S=(null==k?void 0:k.getAttribute("data-menu-item-key"))||"";if(!x||!S)return;let A=i.current.get(x);if(!A)return;let{trigger:C,hideTimer:z}=A,I="".concat(x,":").concat(S),j=null===(n=d.get(S))||void 0===n?void 0:n.length,F=null!==(g=i.current.get(j&&(null===(u=r[j])||void 0===u?void 0:u.key)||""))&&void 0!==g?g:{},{element:B,key:R,hideTimer:_}=null!=F?F:{},M=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:500;F.hideTimer=setTimeout(()=>{s(e=>{let t=e.splice(0,j);return e.forEach(e=>{let{key:t}=e,l=i.current.get(t);l&&(l.hideTimer&&clearTimeout(l.hideTimer),i.current.delete(t))}),t})},e)};if(z&&(clearTimeout(z),A.hideTimer=void 0),S===R){A.trigger={x:e.clientX,y:e.clientY},_&&(clearTimeout(_),F.hideTimer=void 0);return}if(B&&C&&function(e){let{el:t,initial:l,currentCoords:a}=e;if(!t||t.offsetTop<0||t.offsetLeft<0||t.offsetLeftl.x||t.offsetLeft>l.x&&a.x{let{key:t}=e;return t===x});if(!E){console.error("menu not found",{openMenus:{...r},menuKey:x});return}let T=E.position,O={x:(null!==(b=null===(m=A.element)||void 0===m?void 0:m.offsetLeft)&&void 0!==b?b:T.x)+((null===(f=A.element)||void 0===f?void 0:f.offsetWidth)||0),y:k.offsetTop+(null!==(y=null===(p=A.element)||void 0===p?void 0:p.offsetTop)&&void 0!==y?y:T.y)};A.trigger={x:e.clientX,y:e.clientY},s(e=>{var t;let l=e.slice(0,j);return l.push({key:S,position:O,offset:{x:(null===(t=A.element)||void 0===t?void 0:t.offsetWidth)||k.offsetWidth,y:-1*k.offsetHeight}}),i.current.has(S)||i.current.set(S,{}),i.current.get(S).key=S,l})},[r,u]);return(0,p.useEffect)(()=>(window.addEventListener("mousemove",m),()=>{window.removeEventListener("mousemove",m)}),[m]),(0,p.useEffect)(()=>{!1===a?(s([]),i.current=new Map):s([{key:"_root",position:l,offset:{x:0,y:0}}]);let e=e=>{var t;a&&((null===(t=e.target)||void 0===t?void 0:t.closest("[data-menu-id]"))||n())};return window.addEventListener("mousedown",e),()=>{window.removeEventListener("mousedown",e)}},[a,n]),(0,p.useEffect)(()=>{s(e=>(e.length&&(e[0].position={x:l.x,y:l.y}),e))},[l.x,l.y]),{setMenuRef:e=>t=>{i.current.has(e)||i.current.set(e,{}),i.current.get(e).element=t},openMenus:r,getMenuItems:function(e){if("_root"===e)return t;let l=c(e,t);return h(l)?l.items:[]}}};var w=l(12784),x=l.n(w);let S=e=>{let{element:t,position:l,offset:a={x:0,y:0}}=e,[n,o]=(0,p.useState)({width:window.innerWidth,height:window.innerHeight}),[i,r]=(0,p.useState)({x:l.x,y:l.y}),s=(0,p.useCallback)(e=>{let{width:t,height:o}=n;if(l.x<0||l.y<0)return;let s={x:0,y:0};e.offsetWidth+l.x>t&&(s.x=-((e.offsetWidth+a.x)*1)),e.offsetHeight+l.y>o&&(s.y=-((e.offsetHeight+a.y)*1));let d={x:l.x+s.x,y:l.y+s.y};(d.x!==i.x||d.y!==i.y)&&r(d)},[l.x,l.y,a.x,a.y,i,n]);return(0,p.useEffect)(()=>{let e=x()(()=>{o({width:window.innerWidth,height:window.innerHeight})},150);return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),(0,p.useEffect)(()=>{t&&s(t)},[s,t]),{calculatePosition:s,position:i}},A=(0,p.forwardRef)((e,t)=>{let{isOpen:l,onClose:u,menuItems:m,position:g,parentOffset:v={x:0,y:0},id:k,activeElement:w,size:x="medium"}=e,A=(0,p.useRef)(null),{position:z,calculatePosition:j}=S({element:A.current,position:g,offset:v}),F=()=>{var e;let l=(null===(e=A.current)||void 0===e?void 0:e.parentNode)||null;"function"==typeof t?t(l):t&&(t.current=l)};(0,p.useEffect)(()=>{t&&F()},[t]);let B=m.map(e=>y(e)?"divider":e.key).join(",");(0,p.useEffect)(()=>{A.current&&j(A.current)},[B,g]);let R=(0,p.useMemo)(()=>m.filter(e=>!y(e)),[m]),_=!!R.find(e=>b(e)),M=!!R.find(e=>e.icon);return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(n.W,{isOpen:l,onClose:u,closeOnBlur:!1,closeOnSelect:!0,children:(0,a.jsx)(o.c,{"data-menu-id":k,zIndex:"tooltip",rootProps:{style:{top:z.y,left:z.x}},ref:e=>{A.current=e,F(),e&&j(e)},fontSize:"small"===x?"sm":"large"===x?"lg":"md",children:m.map((e,t)=>y(e)?(0,a.jsx)(i.c,{color:"gray.300",my:"small"===x?1:"large"===x?3:2},"divider-".concat(t)):(0,a.jsx)(r.D,{py:"small"===x?1:"large"===x?3:2,cursor:"pointer",icon:(0,a.jsx)(C,{item:e,menuHasIcons:M,menuHasChecked:_}),background:w===e.key?"gray.100":void 0,closeOnSelect:!h(e),onClick:h(e)?void 0:e.onClick,isDisabled:e.disabled,color:e.color,"data-menu-item-key":e.key,children:(0,a.jsxs)(s.z,{width:"100%",pointerEvents:"none",children:[(0,a.jsx)(d.az,{flexGrow:2,children:e.label}),e.rightIcon&&(0,a.jsx)(d.az,{flexGrow:0,ps:2,children:(0,a.jsx)(I,{icon:e.rightIcon})}),h(e)&&(0,a.jsx)(d.az,{flexGrow:0,ps:2,children:(0,a.jsx)(f.g,{icon:c.vmR})})]})},e.key))})})})});A.displayName="ContextMenuInner";let C=e=>{let{item:t,menuHasIcons:l,menuHasChecked:n}=e;return(0,a.jsx)(s.z,{width:"1em",justifyContent:"center",children:(0,a.jsxs)(a.Fragment,{children:[n&&(0,a.jsx)(z,{item:t}),l&&(0,a.jsx)(I,{icon:t.icon})]})})},z=e=>{let{item:t}=e;return b(t)&&t.check?"multiple"===t.check?(0,a.jsx)(f.g,{icon:m.EZy}):(0,a.jsx)(f.g,{icon:m.e68}):(0,a.jsx)(d.az,{width:"1em"})},I=e=>{let{icon:t}=e;return t?"icon"in t?(0,a.jsx)(f.g,{icon:t}):t:(0,a.jsx)(d.az,{width:"1em"})},j=e=>{let{onClose:t,isOpen:l,menuItems:n,position:o,size:i="medium"}=e,{setMenuRef:r,openMenus:s,getMenuItems:d}=k({isOpen:l,onClose:t,menuItems:n,position:o});return(0,a.jsx)(u.Z,{appendToParentPortal:!1,children:[...s,null].map((e,l)=>{var n,o;return null===e?(0,a.jsx)(A,{id:"placeholder",menuItems:[],position:g,isOpen:!1,onClose:t,size:i},"menu-".concat(l)):(0,a.jsx)(A,{id:e.key,activeElement:null!==(o=null===(n=s[l+1])||void 0===n?void 0:n.key)&&void 0!==o?o:void 0,menuItems:d(e.key),position:e.position,parentOffset:e.offset,isOpen:!0,onClose:t,ref:r(e.key),size:i},"menu-".concat(l))})})},F=()=>{let[e,t]=(0,p.useState)(g),[l,a]=(0,p.useState)(!1);return{onContextMenu:e=>{e.stopPropagation(),e.preventDefault(),t({x:e.clientX,y:e.clientY}),a(!0)},menuProps:{isOpen:l,position:e,onClose:()=>{a(!1),t(g)}}}}},55576:(e,t,l)=>{"use strict";l.d(t,{_:()=>r});var a=l(31085),n=l(63633),o=l(14041),i=l(62849);let r=(0,o.forwardRef)((e,t)=>{let{initialHeight:l="1em",bottomSpacing:r=0,onChange:s,...d}=e,u=(0,o.useCallback)(()=>{"function"!=typeof t&&(null==t?void 0:t.current)&&(t.current.style.height=l,t.current.style.height="".concat(t.current.scrollHeight+r,"px"))},[l,t,r]);(0,o.useEffect)(()=>{u()},[u]),(0,o.useEffect)(()=>{u()},[u,d.value]);let c=(0,i.jm)(100);return(0,o.useEffect)(()=>{c&&u()},[c,u]),(0,a.jsx)(n.T,{h:l,minH:l,ref:t,resize:"none",overflow:"hidden",...d,onChange:e=>{u(),null==s||s(e)}})});r.displayName="ResizingTextarea"},90088:(e,t,l)=>{"use strict";l.d(t,{WO:()=>a,er:()=>n});let a="https://gamma.app/privacy",n="https://gamma.app/terms"},31303:(e,t,l)=>{"use strict";l.d(t,{UU:()=>z,bX:()=>I});var a=l(31085),n=l(14041),o=l(18588),i=l(59742),r=l(57238),s=l(65446),d=l(18658),u=l(35687),c=l(18651),m=l(2219),f=l(61778),p=l(80853),g=l(62313),h=l(82680),b=l(52177),y=l(88957),v=l(10458),k=l(82257),w=l(61690),x=l(17485);let S=e=>{let{link:t,confirmFunction:l,onClose:S}=e,A=(0,y.GV)(w.sX),C=(0,v.st)(),z=(0,n.useRef)(!1),I=(0,k.oR)()?"gamma.site":"gamma.app";return(0,n.useEffect)(()=>{z.current||(z.current=!0,null==C||C.track(v.VV.ABUSE_LINK_INTERCEPT_SHOWN,{docId:A,link:t}))},[C,A,t]),(0,a.jsxs)(o.aF,{isOpen:!0,trapFocus:!1,onClose:()=>S("cancel"),children:[(0,a.jsx)(i.m,{}),(0,a.jsxs)(r.$,{children:[(0,a.jsx)(s.s,{}),(0,a.jsx)(d.c,{alignItems:"center",textAlign:"center",children:(0,a.jsxs)(u.B,{mt:8,spacing:4,children:[(0,a.jsx)(c._,{mx:"auto",my:"4",w:16,src:"https://cdn.gamma.app/zc87vhr30n8uf3n/e633cfd2f0df4e61a10843305b87943e/optimized/G-3-Color.svg"}),(0,a.jsx)(m.D,{size:"lg",children:(0,a.jsx)(b.x6,{id:"vtMb7+"})}),(0,a.jsx)(b.x6,{id:"EK1l1+",values:{gammaProperty:I},components:{0:(0,a.jsx)(f.E,{}),1:(0,a.jsx)("code",{})}}),(0,a.jsx)(f.E,{fontSize:"sm",py:1,borderRadius:"sm",color:"gray.700",fontFamily:"mono",bg:"blackAlpha.100",children:t}),(0,a.jsx)(u.B,{spacing:2,mt:2,children:(0,a.jsx)(p.$,{variant:"plain",onClick:()=>{l(t),null==C||C.track(v.VV.ABUSE_LINK_INTERCEPT_CONTINUE,{docId:A,link:t}),S("continue")},children:(0,a.jsx)(b.x6,{id:"xGVfLh"})})}),(0,a.jsx)(p.$,{onClick:()=>{null==C||C.track(v.VV.ABUSE_LINK_INTERCEPT_CANCEL,{docId:A,link:t}),S("cancel")},variant:"solid",children:(0,a.jsx)(b.x6,{id:"FLUIeq"})}),(0,a.jsx)(g.z,{pt:2,flex:1,children:(0,a.jsx)(x._,{docId:A,buttonType:"button",onSubmitReport:()=>S("report")})})]})}),(0,a.jsx)(h.j,{})]})]})},A=(0,n.createContext)({}),C=e=>{window.open(e,"_blank","noopener")},z=e=>{let{children:t}=e,[l,o]=(0,n.useState)(!1),[i,r]=(0,n.useState)(""),[s,d]=(0,n.useState)(()=>C),u=(0,n.useCallback)((e,t)=>{r(e),t&&d(()=>()=>t(e)),o(!0)},[]),c=(0,n.useCallback)(()=>{r(""),d(()=>C),o(!1)},[]),[m,f]=(0,n.useState)({showLinkInterstitial:u,hideLinkInterstitial:c});return(0,a.jsxs)(A.Provider,{value:m,children:[l&&(0,a.jsx)(S,{link:i,confirmFunction:s,onClose:c}),t]})},I=()=>(0,n.useContext)(A)},17485:(e,t,l)=>{"use strict";l.d(t,{_:()=>M});var a=l(31085),n=l(33023),o=l(9021),i=l(80853),r=l(32202),s=l(18588),d=l(59742),u=l(57238),c=l(34363),m=l(65446),f=l(18658),p=l(35687),g=l(61778),h=l(34121),b=l(76352),y=l(27559),v=l(63633),k=l(82680),w=l(74727),x=l(3040),S=l(24221),A=l(95986),C=l(52177),z=l(12327),I=l(14041),j=l(55640),F=l(86724),B=l(14691);let R={[j.tiT.DeceptiveOrMisleading]:{title:(0,a.jsx)(C.x6,{id:"Y5QK1F"})},[j.tiT.Explicit]:{title:(0,a.jsx)(C.x6,{id:"Zeb01n"})},[j.tiT.Other]:{title:(0,a.jsx)(C.x6,{id:"/IX/7x"})},[j.tiT.Spam]:{title:(0,a.jsx)(C.x6,{id:"Y5QK1F"})},[j.tiT.Inappropriate]:{title:(0,a.jsx)(C.x6,{id:"Zeb01n"})}},_=[j.tiT.DeceptiveOrMisleading,j.tiT.Explicit,j.tiT.Other],M=e=>{let{docId:t,buttonType:l,onSubmitReport:r}=e,[s]=(0,F.M)(B.E.abuseReports,[]),[d,u]=(0,I.useState)(s.includes(t||"")),{isOpen:c,onOpen:m,onClose:f}=(0,n.j)({id:"report-page-modal"}),p=(0,I.useCallback)(()=>{u(!0),f(),null==r||r()},[f,r]);return d||!t?null:(0,a.jsxs)(a.Fragment,{children:[c&&(0,a.jsx)(E,{docId:t,isOpen:!0,onClose:f,onSubmit:p}),"iconRight"===l?(0,a.jsx)(A.Tz,{label:(0,a.jsx)(C.x6,{id:"ch68HI"}),children:(0,a.jsx)(o.K,{"aria-label":z.Ru._({id:"ch68HI"}),borderLeftWidth:"0px",color:"gray.600",variant:"plain",size:"sm",borderLeftRadius:0,icon:(0,a.jsx)(S.g,{icon:x.tHS,size:"sm"}),onClick:m})}):"button"===l?(0,a.jsx)(i.$,{marginX:"auto",colorScheme:"gray",color:"gray.500",size:"sm",variant:"ghost",leftIcon:(0,a.jsx)(S.g,{icon:x.tHS}),onClick:m,children:(0,a.jsx)(C.x6,{id:"ch68HI"})}):null]})},E=e=>{let{docId:t,isOpen:l,onClose:n,onSubmit:o}=e,[x,S]=(0,F.M)(B.E.abuseReports,[]),[M,E]=(0,I.useState)(),[T]=(0,j.pZI)(),[O,P]=(0,I.useState)(),N=(0,r.d)(),D=(0,I.useCallback)(()=>{M&&T({variables:{input:{docId:t,reason:M,description:O}}}).then(()=>{S([...x,t]),N({title:(0,a.jsx)(C.x6,{id:"7sBcV9"}),description:(0,a.jsx)(C.x6,{id:"m02YqD"}),status:"success",duration:5e3,isClosable:!0,position:"top"}),o()})},[M,T,t,O,S,x,N,o]);return(0,a.jsx)(A.L8,{isDark:!1,children:(0,a.jsxs)(s.aF,{isOpen:l,onClose:n,trapFocus:!1,children:[(0,a.jsx)(d.m,{}),(0,a.jsxs)(u.$,{children:[(0,a.jsx)(c.r,{children:(0,a.jsx)(C.x6,{id:"ch68HI"})}),(0,a.jsx)(m.s,{}),(0,a.jsx)(f.c,{children:(0,a.jsxs)(p.B,{spacing:0,children:[(0,a.jsx)(g.E,{mb:6,children:(0,a.jsx)(C.x6,{id:"oNyQYO"})}),(0,a.jsx)(h.z,{onChange:e=>{E(e)},value:M,children:(0,a.jsx)(p.B,{children:_.map(e=>{let t=R[e];return(0,a.jsx)(b.s,{value:e,children:null==t?void 0:t.title},e)})})}),(0,a.jsx)(y.S,{in:M===j.tiT.Other,children:(0,a.jsx)(v.T,{onChange:e=>{P(e.target.value)},maxLength:200,placeholder:z.Ru._({id:"1ULmtx"}),mt:4})})]})}),(0,a.jsx)(k.j,{children:(0,a.jsxs)(w.e,{children:[(0,a.jsx)(i.$,{colorScheme:"gray",onClick:n,variant:"ghost",children:(0,a.jsx)(C.x6,{id:"dEgA5A"})}),(0,a.jsx)(A.Tz,{label:(0,a.jsx)(C.x6,{id:"h7+4yF"}),isDisabled:!!M,shouldWrapChildren:!0,children:(0,a.jsx)(i.$,{onClick:D,variant:"plain",colorScheme:"red.400",color:"red",_hover:{color:"red.600"},isDisabled:!M,children:(0,a.jsx)(C.x6,{id:"ovTgfk"})})})]})})]})]})})}},4876:(e,t,l)=>{"use strict";l.d(t,{i:()=>g});var a=l(46343),n=l.n(a),o=l(14041),i=l(65998),r=l(32849),s=l(88957),d=l(82257),u=l(61690),c=l(60490),m=l(22544),f=l(31303),p=l(56848);let g=(e,t)=>{let{showLinkInterstitial:l}=(0,f.bX)(),a=(0,s.GV)(u.sK),g=(0,s.GV)(u.RW),h=(0,s.GV)(u.IO,function(){for(var e=arguments.length,t=Array(e),l=0;lA?"trusted":(0,p.L)(e,h,y),[e,h,y,A]),z=(0,o.useMemo)(()=>A||v&&"unknown"===C?e:(0,p.F)(e,h,y),[A,e,v,C,h,y]);return{interceptLinkClick:(0,o.useCallback)(a=>{if(e&&"trusted"!==C)return v&&"unknown"===C?void 0:((a.preventDefault(),a.stopPropagation(),"untrusted"===C)?console.warn("[interceptLinkClick] Untrusted link clicked",e):null==l||l(e,t),!0)},[e,C,v,l,t]),linkUrlSafe:z,linkTrustLevel:C,linkInterceptEnabled:!1===A,isUntrusted:"untrusted"===C}}},66792:(e,t,l)=>{"use strict";l.d(t,{E:()=>o});var a=l(14041),n=l(4876);let o=e=>{let{interceptLinkClick:t,linkUrlSafe:l,linkInterceptEnabled:o}=(0,n.i)(e),i=(0,a.useCallback)(function(){let l=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return a=>{if(e){if(!o){l||window.open(e,"_blank","noopener");return}t(a)||l||window.open(e,"_blank","noopener")}}},[e,t,o]);return(0,a.useMemo)(()=>({handleOpenNativeLinkWithInterstitial:i(!0),handleOpenLinkWithInterstitial:i(),linkUrlSafe:l}),[i,l])}},56848:(e,t,l)=>{"use strict";l.d(t,{F:()=>i,L:()=>o});var a=l(67963),n=l(73893);let o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!e)return"unknown";try{let n=new URL(e),o=(0,a.removeWWWPrefix)(n.hostname);if(l.includes(o))return"trusted";let i=t.find(t=>t.url===e);if(!i)return"unknown";if(3===i.status)return"untrusted";if(2===i.status)return"unknown";if(1===i.status)return"trusted";i.status}catch(t){console.error("[getLinkTrustLevel] Error checking link",e,t)}return"unknown"},i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!e)return"";let a=o(e,t,l);return"trusted"===a?e:"untrusted"===a?"".concat(n.$.FRONTEND_URL,"/[untrusted-url]"):"".concat(n.$.FRONTEND_URL,"/external-link?url=[").concat(encodeURIComponent(e),"]")}},83603:(e,t,l)=>{"use strict";l.d(t,{$v:()=>n,K$:()=>s,hY:()=>i,tF:()=>o,tq:()=>r});class a extends Error{constructor(e,t={}){super(e),this.opts=t}}a.prototype.name="DesignPartnerError";class n extends a{constructor(e,t={}){super(e,t)}}n.prototype.name="CouldNotApplySuggestionError";class o extends a{constructor(e,t={}){super(e,t)}}o.prototype.name="InvalidResponseError";class i extends a{constructor(e,t={}){super(e,t)}}i.prototype.name="NoopSuggestionError";class r extends a{constructor(e,t={}){super("InputTooLongError: ".concat(e),t)}}r.prototype.name="InputTooLongError";class s extends a{constructor(e,t={}){super("ParsedSuggestionError: ".concat(e),t)}}i.prototype.name="ParsedSuggestionError"},52192:(e,t,l)=>{"use strict";l.d(t,{LW:()=>_,Ep:()=>M,f3:()=>R});var a=l(31085),n=l(33023),o=l(32202),i=l(19098),r=l(64444),s=l(40173),d=l(93185),u=l(79967),c=l(35687),m=l(61778),f=l(28478),p=l(74727),g=l(80853),h=l(63552),b=l(9021),y=l(20501),v=l(24221),k=l(95986),w=l(52177),x=l(12327),S=l(89897),A=l.n(S),C=l(14041),z=l(55576),I=l(86186);w.x6,y.wB1,w.x6,y.s_F,w.x6,y.Qpm;let j=e=>{let{label:t,isDark:l,isSelected:n}=e;return(0,a.jsx)(g.$,{variant:"plain",size:"sm",height:"6",boxShadow:"none",bgGradient:"none",bg:n?l?"purple.500":"purple.100":l?"gray.800":"gray.50",color:n?l?"white":"purple.700":l?"white":"gray.800",borderColor:l?"whiteAlpha.200":"blackAlpha.200",_hover:{color:void 0},cursor:"pointer",children:t})},F={bg:"red.100",_hover:{bg:"red.200"},borderColor:"red.600",color:"red.600"},B={bg:"green.100",_hover:{bg:"green.200"},borderColor:"green.600",color:"green.600"},R=e=>{let{rating:t,setRating:l,RatingButtons:h,trackFeedback:b,feedbackTags:y}=e,{isOpen:v,onOpen:k,onClose:S}=(0,n.j)(),I=(0,C.useCallback)(e=>{l(e),k()},[l,k]),[F,B]=(0,C.useState)(""),[R,_]=(0,C.useState)(new Set),M=(0,C.useCallback)(()=>{B(""),_(new Set),S()},[S]),E=(0,o.d)(),T=(0,C.useCallback)(()=>{null==b||b(t,A().sanitize(F),Array.from(R)),E({title:(0,a.jsx)(w.x6,{id:"+Rq0s/"}),status:"success",position:"top",duration:2e3,isClosable:!0}),M()},[F,R,t,b,E,M]);return(0,a.jsxs)(i.A,{isOpen:v,onOpen:k,onClose:M,placement:"top",closeOnBlur:!0,isLazy:!0,variant:"modal",children:[(0,a.jsx)(r.W,{children:(0,a.jsx)(h,{rating:t,setRating:I})}),(0,a.jsx)(s.Z,{children:(0,a.jsxs)(d.h,{borderRadius:"lg",borderWidth:"1px",borderColor:"gray.200",shadow:"xl",p:3,children:[(0,a.jsx)(u.q,{}),(0,a.jsxs)(c.B,{alignItems:"flex-end",children:[(0,a.jsx)(m.E,{alignSelf:"flex-start",fontSize:"sm",color:"gray.500",children:"good"===t?(0,a.jsx)(w.x6,{id:"uA8iBc"}):(0,a.jsx)(w.x6,{id:"tq89gP"})}),t&&"good"!==t&&y&&y.length>0&&(0,a.jsx)(f.B,{children:y.map(e=>{let{key:t,label:l}=e;return(0,a.jsx)(f.Q,{onClick:()=>{_(e=>{let l=new Set(e);return l.has(t)?l.delete(t):l.add(t),l})},children:(0,a.jsx)(j,{label:l,isSelected:R.has(t)})},t)})}),(0,a.jsx)(z._,{initialHeight:"4em",value:F,onChange:e=>B(e.target.value),fontSize:"sm",placeholder:x.Ru._({id:"eYeGuP"}),p:1,px:2,borderRadius:"0"}),(0,a.jsxs)(p.e,{size:"sm",children:[(0,a.jsx)(g.$,{variant:"ghost",onClick:M,children:(0,a.jsx)(w.x6,{id:"6Uau97"})}),(0,a.jsx)(g.$,{variant:"solid",onClick:T,children:(0,a.jsx)(w.x6,{id:"1m41/U"})})]})]})]})})]})},_=(0,h.R)((e,t)=>{let{rating:l,setRating:n}=e,o=(0,I.wP)();return(0,a.jsxs)(p.e,{spacing:0,p:0,isAttached:!0,ref:t,children:[(0,a.jsx)(k.Tz,{label:(0,a.jsx)(w.x6,{id:"kR82DG"}),placement:"top",children:(0,a.jsx)(b.K,{...o,icon:(0,a.jsx)(v.g,{icon:y.lS9}),"aria-label":x.Ru._({id:"kqV4i0"}),..."poor"===l?F:{},onClick:()=>n("poor"),position:"relative",zIndex:"poor"===l?1:0})}),(0,a.jsx)(k.Tz,{label:(0,a.jsx)(w.x6,{id:"y1GvbS"}),placement:"top",children:(0,a.jsx)(b.K,{...o,icon:(0,a.jsx)(v.g,{icon:y.Wcv}),"aria-label":x.Ru._({id:"nnIO9F"}),position:"relative",left:"-1px",..."good"===l?B:{},onClick:()=>n("good")})})]})});_.displayName="CardRatingButtons";let M=(0,h.R)((e,t)=>{let{rating:l,setRating:n}=e;return(0,a.jsxs)(p.e,{size:"sm",ref:t,children:[(0,a.jsx)(k.Tz,{label:(0,a.jsx)(w.x6,{id:"kR82DG"}),placement:"top",children:(0,a.jsx)(b.K,{"aria-label":"thumbs down",color:"poor"===l?"red.600":void 0,borderWidth:"1px",borderColor:"poor"===l?"red.600":"transparent",bg:"poor"===l?"red.100":void 0,_hover:{bg:"poor"===l?"red.200":"red.100"},icon:(0,a.jsx)(v.g,{icon:y.lS9}),onClick:()=>{n("poor")}})}),(0,a.jsx)(k.Tz,{label:(0,a.jsx)(w.x6,{id:"y1GvbS"}),placement:"top",children:(0,a.jsx)(b.K,{"aria-label":"thumbs up",color:"good"===l?"green.600":void 0,borderWidth:"1px",borderColor:"good"===l?"green.600":"transparent",bg:"good"===l?"green.100":void 0,_hover:{bg:"good"===l?"green.200":"green.100"},icon:(0,a.jsx)(v.g,{icon:y.Wcv}),onClick:()=>{n("good")}})})]})});M.displayName="ImageRatingButtons"},99548:(e,t,l)=>{"use strict";l.d(t,{BO:()=>o,OK:()=>r,oA:()=>a,pn:()=>i,rh:()=>n});let a=6,n=8,o=15,i=5,r={id:"",interactionId:"",status:"draft",docGenerationId:"",content:"",prompt:"",format:"deck",settings:{numCards:8,locale:"en",editorMode:"freeform",imageProvider:"web",imageLicense:"All",audience:"",tone:"",textAmount:"md",textMode:"generate",themeId:void 0,styleTemplate:"deck_default"}}},14452:(e,t,l)=>{"use strict";l.d(t,{DB:()=>n,rd:()=>a}),l(9911),l(99548);let a=e=>e.split("\n---\n").length,n=(e,t)=>{let l=e.match(/```([a-zA-Z]*)?\n([\s\S]*?)(\n(?:\s*)```|$)/);return(l?l[2]:t?"":e).trim()}},89654:(e,t,l)=>{"use strict";l.d(t,{$:()=>n});var a=l(99742);let n=()=>(0,a.Ak)()},25465:(e,t,l)=>{"use strict";l.d(t,{V1:()=>m,wo:()=>u});var a=l(83603),n=l(77914),o=l(88808),i=l(55640),r=l(30358);let s=e=>!(0,o.vI)(e).some(e=>["BAD_USER_INPUT"].includes(e)),d=async e=>{let{fn:t,retries:l,backoff:a=1e3,timeout:n}=e;try{return await Promise.race([t(),new Promise((e,t)=>{setTimeout(()=>t(Error("Request timeout (".concat(n,"ms)"))),n)})])}catch(r){var o;let e=null===(o=r.message)||void 0===o?void 0:o.startsWith("Request timeout");e&&console.debug("[AI] Request timeout. Not retrying");let i=s(r)&&!e;if(l>0&&i)return await new Promise(e=>setTimeout(e,a)),d({fn:t,retries:l-1,backoff:2*a,timeout:n});throw r}},u=async e=>{var t;let l=await c({messages:e.messages,maxTokens:null!==(t=e.params.maxTokens)&&void 0!==t?t:null,models:["gpt-3.5-turbo","gpt-3.5-turbo-16k"]});return{...e,params:{...e.params,model:l}}},c=async e=>{var t;let{messages:l,maxTokens:o,models:r}=e,{data:s}=await (0,n.H4n)().query({query:i.l3I,returnPartialData:!1,variables:{input:{messages:l,maxTokens:o,models:r}}}),d=null==s?void 0:s.canRunChatCompletion;if(!d||0===d.length)throw Error("No response received");let u=null===(t=d.find(e=>!!e.canRun))||void 0===t?void 0:t.model;if(!u)throw new a.tq("Input too long for models: "+JSON.stringify(r));return u},m=async function(e){var t,l;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{timeout:6e4,retries:0};return console.debug("[AI][fetchChatCompletion]",e.messages,e.params),d({fn:()=>(0,n.H4n)().mutate({mutation:i.aA3,variables:{input:{...e,workspaceId:(0,r.gx)()}}}).then(e=>{let{data:t}=e,l=null==t?void 0:t.chatCompletion;if(!l||0===l.length)throw Error("No response received");return console.debug("[AI] Got chat completion",l),t}),timeout:null!==(t=a.timeout)&&void 0!==t?t:6e4,retries:null!==(l=a.retries)&&void 0!==l?l:0})}},81768:(e,t,l)=>{"use strict";l.d(t,{F:()=>o});var a=l(77914),n=l(53547);class o extends n.U{getSystemChatMessage(e){return{role:a.VDI.System,operation:this.systemPromptOperation,variables:e}}getUserChatMessage(e){return{role:a.VDI.User,operation:this.userPromptOperation,variables:e}}constructor({variables:e,systemPromptOperation:t,userPromptOperation:l,params:a}){super({params:a}),this.variables=e,this.systemPromptOperation=t,this.userPromptOperation=l}}},53547:(e,t,l)=>{"use strict";l.d(t,{U:()=>n});let a={model:"gpt-3.5-turbo-1106",provider:l(77914).eON.Azure};class n{prepare(e){let{variables:t,history:l=[],params:a}=e;return{messages:[this.getSystemChatMessage(t),...l,this.getUserChatMessage(t)],params:{...this.params,...a}}}constructor({params:e}){this.params={...a,...e}}}},57450:(e,t,l)=>{"use strict";l.d(t,{U:()=>o});var a=l(32899),n=l(25465);let o=async function(e,t){var l,o;let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=a.of.get("aiRequestRetries").chat;i.retries=null!==(o=i.retries)&&void 0!==o?o:r;let s=await (0,n.V1)({...e,interactionId:t},i);return null==s?void 0:null===(l=s.chatCompletion)||void 0===l?void 0:l[0].content}},63587:(e,t,l)=>{"use strict";l.d(t,{K:()=>i});var a=l(13236),n=l(69e3),o=l(57215);let i=(e,t)=>{let l=r(e),a=n.FK.from(t),i=l.serializeFragment(a),s=(0,o.H)(i),d=document.createElement("div");return d.appendChild(s),d.innerHTML},r=e=>{let{schema:t,extensionManager:l}=e;if(t.cached.aiDomSerializer)return t.cached.aiDomSerializer;let o=n.ZF.marksFromSchema(t),i=n.ZF.nodesFromSchema(t),r=e.extensionManager.attributes;l.extensions.forEach(e=>{if(!e.config.renderHTMLforAI)return;let t=r.filter(t=>t.type===e.name);i[e.name]&&(i[e.name]=l=>{let n=(0,a.zU)(l,t);return e.config.renderHTMLforAI.bind(e)({node:l,HTMLAttributes:n})}),o[e.name]&&(o[e.name]=(l,n)=>{let o=(0,a.zU)(l,t);return e.config.renderHTMLforAI.bind(e)({mark:l,inline:n,HTMLAttributes:o})})});let s=new n.ZF(i,o);return t.cached.aiDomSerializer=s,s}},87116:(e,t,l)=>{"use strict";l.d(t,{i4:()=>x,pt:()=>w});var a=l(14041),n=l(73893);class o extends Error{constructor(e,t){super(e),this.name="StreamError",this.code="stream_error",t&&(this.code=t)}}class i extends o{constructor(e){super(e),this.name="StreamTimeoutError",this.code="timeout"}}class r extends o{constructor(e){super(e),this.name="StreamOnOpenError",this.code="on_open"}}class s extends o{constructor(e){super(e),this.name="StreamUnexpectedCloseError",this.code="unexpected_close"}}var d=l(39448);async function u(e,t){let l;let a=e.getReader();for(;!(l=await a.read()).done;)t(l.value)}function c(){return{data:"",event:"",id:"",retry:void 0}}let m="text/event-stream",f="last-event-id";function p(e){let t=e.headers.get("content-type");if(!(null==t?void 0:t.startsWith(m)))throw Error("Expected content-type to be ".concat(m,", Actual: ").concat(t))}class g extends d.Rv{constructor(){super({transform:async(e,t)=>{if("error"===e.event){t.error(new o("StreamError message received: ".concat(JSON.stringify(e)),e.data));return}t.enqueue(e)}})}}class h extends Error{constructor(e){super(),this.timeout=e}}var b=l(99742);let y=(e,t)=>{let l=e.getReader(),a=async()=>{var e,n,o;try{let{done:o,value:i}=await l.read();if(o)null===(n=t.onDone)||void 0===n||n.call(t);else{null===(e=t.onMessage)||void 0===e||e.call(t,i),a();return}}catch(e){null===(o=t.onError)||void 0===o||o.call(t,e instanceof Error?e:Error(e))}};a()};(0,b.d_)("0123456789abcdefghijklmnopqrstuvwxyz",16);var v=l(87064);class k extends d.Rv{getContent(){return this.content}constructor(e){super({start:()=>{var t;null===(t=e.onStart)||void 0===t||t.call(e)},transform:async(t,l)=>{var a,n,o;"content"===t.event&&(this.content+=t.data,null===(a=e.onContent)||void 0===a||a.call(e,this.content)),"done"===t.event&&(null===(n=e.onComplete)||void 0===n||n.call(e,this.content)),"cancel"===t.event&&(null===(o=e.onCancel)||void 0===o||o.call(e)),l.enqueue(t)},flush(){var t;null===(t=e.onFlush)||void 0===t||t.call(e)}}),this.content=""}}l(60490);let w=(e,t)=>({generate:(0,a.useCallback)(l=>x({...l,promptKey:e,opts:t}),[t,e])}),x=e=>{let{promptKey:t,opts:l,variables:a,interactionId:o,workspaceId:b}=e,{cancel:w,stream:x}=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=n.$.API_HOST+"/ai/v2/generation",a={"Content-Type":"application/json"};return t.streamId&&(a["gamma-chat-completion-stream-id"]=t.streamId),function(e,t,l){var a;let n=l.retries||0,o=l.backoff||1e3,b=l.timeout||null,y=null!==(a=l.streamResumingEnabled)&&void 0!==a&&a,v=0,k=new AbortController,w=!1,x=!1,S=!1,A=null,C=!1,z=()=>o*Math.pow(2,Math.max(v-1,0)),I={};return y&&(I["gamma-stream-resuming-enabled"]="true"),{stream:new d.ZY({async start(l){null!=b&&(A=setTimeout(()=>{C=!0,k.abort(),l.error(new i("Stream timed out after ".concat(b,"ms")))},b));let{headers:a,...o}=t;(function(e,t){let{signal:l,headers:a,onopen:n,onmessage:o,onclose:i,onerror:r,openWhenHidden:s,fetch:d,...g}=t;return new Promise((t,h)=>{let b;let y={...a};function v(){b.abort(),document.hidden||C()}y.accept||(y.accept=m),s||document.addEventListener("visibilitychange",v);let k=1e3,w=0;function x(){document.removeEventListener("visibilitychange",v),window.clearTimeout(w),b.abort()}null==l||l.addEventListener("abort",()=>{x(),t()});let S=null!=d?d:window.fetch,A=null!=n?n:p;async function C(){var l,a;b=new AbortController;try{let a,n,r,s;let d=await S(e,{...g,headers:y,signal:b.signal});await A(d),await u(d.body,(l=function(e,t,l){let a=c(),n=new TextDecoder,o=!1;return function(i,r){if(0===i.length)null==l||l(a),a=c(),o=!1;else if(r>0){let l=n.decode(i.subarray(0,r)),s=r+(32===i[r+1]?2:1),d=n.decode(i.subarray(s));switch(l){case"data":o?a.data=a.data+"\n"+d:(a.data=d,o=!0);break;case"event":a.event=d;break;case"id":e(a.id=d);break;case"retry":let u=parseInt(d,10);isNaN(u)||t(a.retry=u)}}}}(e=>{e?y[f]=e:delete y[f]},e=>{k=e},o),s=!1,function(e){void 0===a?(a=e,n=0,r=-1):a=function(e,t){let l=new Uint8Array(e.length+t.length);return l.set(e),l.set(t,e.length),l}(a,e);let t=a.length,o=0;for(;n{if(!e.ok||e.headers.get("content-type")!==m){if(e.status>=400&&e.status<500&&429!==e.status)k.abort(),l.error(new r("Unable to complete request"));else if(v++{A&&(clearTimeout(A),A=null),S||l.error(e)})}}).pipeThrough(new g),cancel:()=>{S||(S=!0)}}}(l,{method:"POST",headers:a,body:JSON.stringify(e)},t)}({promptKey:t,variables:a,interactionId:o=o||(0,v.$F)(),workspaceId:b},{timeout:l.timeout}),S=new k(l),A=x.pipeThrough(S);return{cancel:w,promise:new Promise((e,t)=>{y(A,{onError(e){var a;null===(a=l.onError)||void 0===a||a.call(l,e),t(e)},onDone(){e(S.getContent())}})})}}},78784:(e,t,l)=>{"use strict";l.d(t,{Fs:()=>y,pn:()=>b});var a=l(8796);let n={isOtherClientStreaming:!1,streams:{},tracking:{},timing:{}},o=(0,a.Z0)({name:"AIStream",initialState:n,reducers:{reset:()=>n,setOtherClientStreaming(e,t){e.isOtherClientStreaming=t.payload},recordAIRequestSent(e,t){let{interactionId:l}=t.payload;e.tracking[l]={...e.tracking[l],...t.payload}},recordCardTiming(e,t){let{interactionId:l,data:a}=t.payload;e.timing[l]=e.timing[l]||{tokens:0,duration:0,isDone:!1,cardsCompleted:0},e.timing[l].tokens+=a.numTokens,e.timing[l].duration+=a.duration,e.timing[l].cardsCompleted++},recordAIStreamStart(e,t){let{interactionId:l,docId:a}=t.payload,n=e.tracking[l];n&&(e.tracking[l]={...n,docId:a})},recordAIRequestDone(e,t){let{interactionId:l,outputContent:a,endTime:n}=t.payload,o=e.tracking[l];if(!o||!o.startTime)return;let i=e.timing[l];i&&(e.timing[l]={...i,isDone:!0}),e.tracking[l]={...o,latency:n-o.startTime},void 0!==a&&(e.tracking[l].outputContent=a)},addStream(e,t){let{stream:l}=t.payload;e.streams[l.id]=l},setStreamDocId(e,t){let{id:l,docId:a,lastCompletedCardId:n}=t.payload;e.streams[l]&&(e.streams[l].docId=a,e.streams[l].lastCompletedCardId=n),e.tracking[l]&&(e.tracking[l].docId=a)},abortStream(e,t){let{id:l}=t.payload;delete e.streams[l],delete e.timing[l],delete e.tracking[l]},completeStream(e,t){let{id:l,status:a}=t.payload;e.streams[l]&&(e.streams[l].status=a),e.timing[l]&&(e.timing[l].isDone=!0)}}}),{addStream:i,setStreamDocId:r,completeStream:s,abortStream:d,reset:u,recordAIStreamStart:c,recordAIRequestSent:m,recordAIRequestDone:f,recordCardTiming:p,setOtherClientStreaming:g}=o.actions,h=e=>t=>{if(e)return Object.values(t.AIStream.streams).find(t=>t.docId===e)},b=e=>t=>{if(!e)return!1;let l=h(e)(t);return(null==l?void 0:l.status)==="running"},y=o.reducer},74109:(e,t,l)=>{"use strict";let a;l.d(t,{$0:()=>s,WW:()=>i,p9:()=>r});var n=l(73893),o=l(30503);if("true"!==l(39907).env.SCHEMA_BUILD&&!window.Cypress&&!(0,o.NF)()){let e=n.$.ASSETS_CDN_HOST||"cdn.gamma.app";l.e(9015).then(l.bind(l,69015)).then(t=>{let{get_encoding:l,init:n}=t;fetch("https://".concat(e,"/_app_static/js/tiktoken-640a99ed3ce5ba67.wasm")).then(e=>e.arrayBuffer()).then(e=>n(t=>WebAssembly.instantiate(e,t))).then(()=>{a=l("cl100k_base")}).catch(e=>{console.warn("Failed to load tokenizer",e)})})}let i=e=>e?a?a.encode(e).length:Math.ceil(e.length/3.75):0;function r(e){return a?a.encode(e):new Uint32Array}function s(e){if(!a)return"";let t=new TextDecoder,l=a.decode(e);return t.decode(l)}},87064:(e,t,l)=>{"use strict";l.d(t,{$F:()=>r.$,D8:()=>g,UL:()=>d,WN:()=>f,XD:()=>m,Yh:()=>u,pS:()=>p,rl:()=>s,tB:()=>c});var a=l(73893),n=l(78821),o=l(10458),i=l(60490),r=l(89654);let s=e=>{o.zS.track(o.VV.AI_REQUEST_SENT,{...e,gitSHA:a.$.GIT_SHA})},d=e=>{o.zS.track(o.VV.AI_REQUEST_COMPLETE,{...e,gitSHA:a.$.GIT_SHA})},u=e=>{o.zS.track(o.VV.AI_REQUEST_RESPONSE,{...e,gitSHA:a.$.GIT_SHA})},c=e=>{o.zS.track(o.VV.AI_REQUEST_ERROR,{...e,gitSHA:a.$.GIT_SHA})},m=e=>{o.zS.track(o.VV.AI_IMAGE_FEEDBACK_SUBMITTED,{...e,gitSHA:a.$.GIT_SHA,product:(0,n.A4)((0,i.vp)())})},f=e=>{o.zS.track(o.VV.AI_IMAGE_RATED,{...e,gitSHA:a.$.GIT_SHA,product:(0,n.A4)((0,i.vp)())})},p=e=>{o.zS.track(o.VV.AI_CARD_FEEDBACK,{...e,gitSHA:a.$.GIT_SHA})},g=e=>{o.zS.track(o.VV.AI_CARD_RATING,{...e,gitSHA:a.$.GIT_SHA})}},60953:(e,t,l)=>{"use strict";l.d(t,{A:()=>a});let a="ai-parsed-attrs"},97391:(e,t,l)=>{"use strict";let a;l.d(t,{e:()=>p,a:()=>g});var n=l(87064),o=l(20221),i=l(26917),r=l(17539);class s{getKey(e){let{query:t,provider:l,options:a}=e;return"".concat(l,"__").concat(t,"__").concat(JSON.stringify(a))}markUsed(e){this.usedImages.add(e)}isUsed(e){return this.usedImages.has(e)}async findImage(e){let t,l=!(arguments.length>1)||void 0===arguments[1]||arguments[1];if(e.loadImageId){let t=this.foundImages.get(e.loadImageId);if(t)return t}await this.loadImageResults(e);let a=this.getKey(e);return this.validImagePromises.has(a)?(t=this.validImagePromises.get(a).then(()=>this.findValidImage(e)),this.validImagePromises.set(a,t)):t=this.findValidImage(e),this.validImagePromises.set(a,t),t.then(t=>(t&&l&&this.markUsed(t.imageUrl),t&&e.loadImageId&&this.foundImages.set(e.loadImageId,t),t))}async findValidImage(e){let t=this.getKey(e);for(let e of this.results.get(t)){let{image:t}=e;if(!this.isUsed(t.imageUrl)&&(void 0===e.isValid&&(e.isValid=await (0,r.Ef)(t.imageUrl)),e.isValid))return e.image}return null}async loadImageResults(e){let{query:t,provider:l,options:a,count:n}=e,o=this.getKey({query:t,provider:l,options:a});if(this.results.has(o))return;if(this.requestPromises.has(o)){await this.requestPromises.get(o);return}this.debugRequests.push(o);let s=(0,i.g)({query:t,count:n,options:a,provider:l}).then(e=>e.filter(e=>(0,r.zk)(e.imageUrl))).then(e=>{let t=e.map(e=>({image:e,isValid:void 0}));return this.results.set(o,t),e});this.requestPromises.set(o,s),await s}async generateImage(e,t){let l="aiGenerated__".concat(t.prompt,"__").concat(e);if(this.debugRequests.push(l),this.generateImagePromises.has(e))return this.generateImagePromises.get(e);let a=(0,o.hU)(t);return this.generateImagePromises.set(e,a),a}debugInfo(){return{requests:this.debugRequests}}constructor(){this.usedImages=new Set,this.results=new Map,this.requestPromises=new Map,this.validImagePromises=new Map,this.debugRequests=[],this.generateImagePromises=new Map,this.foundImages=new Map}}let d=()=>(a||(a=new s),a);var u=l(90937),c=l(4977),m=l(952),f=l(12127);let p=e=>{let{query:t,provider:l,license:a,model:n,stylePreset:o,stylePrompt:i}=e;return t?("aiGenerated"!==l&&(t=t.split(", ")[0]),{loadImageParams:{provider:l,query:t,options:"aiGenerated"===l?{model:n,stylePreset:o,stylePrompt:i}:{license:a}},loadImageStatus:"queued",loadImageId:(0,f.z)(),source:u.j[l]}):{loadImageStatus:"error"}},g=async e=>{let{loadImageId:t,loadImageParams:l,context:a,markUsed:o=!0}=e,{provider:i,query:r,options:s}=l,{interactionId:f,...p}=a;try{if("aiGenerated"===i){let e={...s,interactionId:f||(0,n.$F)(),steps:30,...p,prompt:r,count:1},l=await d().generateImage(t,e);if(!l[0])return{loadImageStatus:"error"};return{...l[0].attrs,tempUrl:null,loadImageStatus:"done",uploadStatus:c.A.Queued}}{let e=await d().findImage({query:r,provider:l.provider,options:l.options,loadImageId:t},o);if(!e)return{query:r,source:u.j[i],loadImageStatus:"error"};return{...(0,m.TF)(e,r,i),loadImageStatus:"done",uploadStatus:c.A.Queued}}}catch(e){return console.error("[AIStream] An error occurred while fetching image: ".concat(e.message),e.stack),{loadImageStatus:"error"}}}},33587:(e,t,l)=>{"use strict";l.d(t,{D:()=>m,e:()=>r});var a=l(60953),n=l(97391),o=l(82064),i=l(60490);let r=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{let l=new DOMParser().parseFromString(e,"text/html");d(l),t.removeImagesFromLayouts&&(s(l),c(l));let r=(0,i.gx)(),m=(0,o.h)(l,"img[searches], img[query]").map(async e=>{var l,o,i,s,d,u;if(e.getAttribute("bookmark"))return;let c=e.getAttribute("query")||e.getAttribute("searches")||"",m=null===(l=t.imageOptions)||void 0===l?void 0:l.generateStyle,f=null===(o=t.imageOptions)||void 0===o?void 0:o.stylePreset,p="icon"===e.getAttribute("type"),g="web"==e.getAttribute("provider")?"web":"aiGenerated",h=(null===(i=t.imageOptions)||void 0===i?void 0:i.provider)=="auto"?g:null===(s=t.imageOptions)||void 0===s?void 0:s.provider,b=(0,n.e)({query:c,provider:p?"fontawesome":h||"web",license:null===(d=t.imageOptions)||void 0===d?void 0:d.license,model:null===(u=t.imageOptions)||void 0===u?void 0:u.model,stylePrompt:m,stylePreset:f}),y=t.loadImages?await (0,n.a)({loadImageId:b.loadImageId,loadImageParams:b.loadImageParams,context:{workspaceId:r}}):{};e.setAttribute(a.A,JSON.stringify({...b,...y}))});return await Promise.all(m),(0,o.h)(l,"images, icons").forEach(u),l.body.innerHTML}catch(t){return console.error("Error transforming AI HTML",t),e}},s=e=>{e.querySelectorAll(":is(boxes, timeline, table, bullets, arrows, pyramid, funnel, staircase, numbers, percentages, circles, flower, ring, cycle, circle, semicircle) img").forEach(e=>{e.remove()})},d=e=>{let t=e.getElementsByTagName("*");for(let e=0;e{(0,o.h)(e,"div > img:first-child").forEach(e=>{let t=e.parentElement;if(!t)return;let l=JSON.parse(e.getAttribute(a.A)||"null");l&&t.setAttribute("data-image",JSON.stringify(l));let n=e.getAttribute("bookmark");n&&t.setAttribute("image-bookmark",n);let o=e.getAttribute("src");o&&t.setAttribute("data-image",JSON.stringify({src:o,source:"image.custom"})),e.remove()})},c=e=>{e.querySelectorAll("section").forEach(e=>{if(!e.querySelector("div.body"))return;let t=e.querySelector(":scope > img:not(.accent-image)");t&&t.classList.add("accent-image")})},m=e=>{try{let t=e.getAttribute(a.A);return JSON.parse(t||"")}catch(t){return console.error("[Image] Error parsing ".concat(a.A," attrs"),e,t),!1}}},45214:(e,t,l)=>{"use strict";l.d(t,{Ic:()=>c,S6:()=>u,YB:()=>m,hn:()=>f,lN:()=>b,qw:()=>g,wQ:()=>h});var a=l(8796),n=l(41054);let o={cardSuggestionsMap:{},isSuggestingDocLevel:!1},i=(0,a.Z0)({name:"AIVariations",initialState:o,reducers:{reset:()=>o,setSuggestingDocLevel(e,t){e.isSuggestingDocLevel=t.payload},setCardSuggestionsStatus(e,t){var l,a;let{cardId:n,status:o}=t.payload;null!==(a=(l=e.cardSuggestionsMap)[n])&&void 0!==a||(l[n]={variants:[],status:o}),e.cardSuggestionsMap[n].status=o},setCardSuggestions(e,t){let{cardId:l,suggestions:a}=t.payload;e.cardSuggestionsMap[l]=a},removeCardSuggestions(e,t){let{cardId:l}=t.payload;l?delete e.cardSuggestionsMap[l]:e.cardSuggestionsMap={}},addCardVariant(e,t){var l,a;let{cardId:n,variant:o,autoselect:i}=t.payload;null!==(a=(l=e.cardSuggestionsMap)[n])&&void 0!==a||(l[n]={variants:[],status:"loading"}),e.cardSuggestionsMap[n].variants.push(o),i&&(e.cardSuggestionsMap[n].selected=o.id)},addCardVariants(e,t){t.payload.forEach(t=>{var l,a;let{cardId:n,variant:o,autoselect:i}=t;null!==(a=(l=e.cardSuggestionsMap)[n])&&void 0!==a||(l[n]={variants:[],status:"done"}),e.cardSuggestionsMap[n].variants.push(o),i&&(e.cardSuggestionsMap[n].selected=o.id)})},selectCardVariant(e,t){let{cardId:l,variantId:a}=t.payload,n=e.cardSuggestionsMap[l];n&&(n.selected=a)}}}),{reset:r,setSuggestingDocLevel:s,addCardVariants:d,selectCardVariant:u,setCardSuggestions:c,removeCardSuggestions:m}=i.actions,f=e=>e.AIVariations.isSuggestingDocLevel,p=e=>e.AIVariations.cardSuggestionsMap;(0,n.Mz)(e=>Object.values(p(e)),e=>e.reduce((e,t)=>(e[t.status]=(e[t.status]||0)+1,e),{total:e.length}));let g=e=>t=>t.AIVariations.cardSuggestionsMap[e],h=e=>t=>{var l;return null===(l=t.AIVariations.cardSuggestionsMap[e])||void 0===l?void 0:l.status},b=i.reducer},88808:(e,t,l)=>{"use strict";l.d(t,{vI:()=>a}),"undefined"==typeof ErrorEvent||ErrorEvent;let a=e=>{let t=(null==e?void 0:e.graphQLErrors)||[];return null==t?void 0:t.map(e=>e.code)}},55640:(e,t,l)=>{"use strict";l.d(t,{AZr:()=>aa,D7K:()=>ax,DNM:()=>am,EB6:()=>lu,Ekg:()=>ah,GQw:()=>lZ,Gc5:()=>l5,JhL:()=>lW,N3Q:()=>l1,SjR:()=>lc,Snx:()=>at,SzF:()=>as,Tyz:()=>an,U$g:()=>lU,UEL:()=>lb,VDI:()=>ld,Vd7:()=>lf,aA3:()=>l$,abJ:()=>l6,b2u:()=>ai,b_w:()=>l9,eON:()=>lr,eRM:()=>au,eXh:()=>l8,eaJ:()=>ak,l3I:()=>lQ,lgx:()=>lY,mc:()=>ls,nXf:()=>lh,nkJ:()=>ay,pZI:()=>lJ,pfv:()=>lG,rWX:()=>lg,roT:()=>ap,soQ:()=>ao,tiT:()=>li,vY2:()=>lm,yKx:()=>ly,zut:()=>lp});var a=l(83292),n=l(5276),o=l(42455),i=l(23968),r=l(49636);function s(){let e=(0,a._)(["\n fragment DocGenerateInputFragment on DocGenerateInput {\n id\n docGenerationId\n interactionId\n status\n prompt\n content\n format\n settings\n docId\n docGenerateOutputId\n createdTime\n updatedTime\n}\n "]);return s=function(){return e},e}function d(){let e=(0,a._)(["\n fragment DocGenerationFragment on DocGeneration {\n id\n generationType\n userId\n workspaceId\n draftInput {\n ...DocGenerateInputFragment\n }\n docGenerateInputs {\n ...DocGenerateInputFragment\n }\n createdTime\n updatedTime\n}\n ",""]);return d=function(){return e},e}function u(){let e=(0,a._)(["\n fragment Font on Font {\n id\n name\n cssUrl\n fontFiles {\n id\n name\n weight\n isItalic\n fileType\n sourceUrl\n }\n workspaceId\n archived\n fontFileCount\n}\n "]);return u=function(){return e},e}function c(){let e=(0,a._)(["\n fragment SavedMediaFragment on SavedMedia {\n id\n userId\n workspaceId\n interactionId\n docId\n themeId\n context\n type\n source\n attrs\n createdTime\n updatedTime\n}\n "]);return c=function(){return e},e}function m(){let e=(0,a._)(["\n fragment DocFieldsFragment on Doc {\n id\n title\n archived\n createdTime\n updatedTime\n editedTime\n currentSnapshotId\n titleCard {\n id\n previewUrl\n createdTime\n updatedTime\n }\n createdBy {\n profileImageUrl\n displayName\n id\n }\n collaborators {\n docId\n user {\n id\n }\n permission\n }\n docUser {\n id\n docId\n lastViewed\n lastEdited\n favorited\n }\n channels {\n id\n name\n slug\n permission\n }\n organization {\n id\n name\n }\n orgAccess\n editors {\n docId\n user {\n id\n displayName\n email\n profileImageUrl\n }\n lastEdited\n }\n}\n "]);return m=function(){return e},e}function f(){let e=(0,a._)(["\n fragment SearchChannelResult on Channel {\n id\n name\n slug\n members {\n profileImageUrl\n displayName\n id\n }\n memberCount\n isMember\n workspaceId\n createdTime\n updatedTime\n}\n "]);return f=function(){return e},e}function p(){let e=(0,a._)(["\n fragment SearchDocResult on DocResult {\n id\n title\n text\n archived\n previewUrl\n createdBy {\n id\n displayName\n profileImageUrl\n }\n organization {\n id\n }\n editors {\n user {\n id\n displayName\n profileImageUrl\n }\n lastViewed\n lastEdited\n }\n docUser {\n lastViewed\n lastEdited\n favorited\n }\n orgAccess\n updatedTime\n createdTime\n editedTime\n}\n "]);return p=function(){return e},e}function g(){let e=(0,a._)(["\n fragment DocCollaboratorsUpdate on Doc {\n collaborators {\n docId\n user {\n id\n displayName\n email\n profileImageUrl\n }\n permission\n guest\n }\n}\n "]);return g=function(){return e},e}function h(){let e=(0,a._)(["\n fragment ShareSearchUser on User {\n id\n displayName\n email\n profileImageUrl\n}\n "]);return h=function(){return e},e}function b(){let e=(0,a._)(["\n fragment DocChannelsUpdate on Doc {\n channels {\n id\n name\n slug\n }\n}\n "]);return b=function(){return e},e}function y(){let e=(0,a._)(["\n fragment ShareSearchChannel on Channel {\n id\n name\n slug\n isMember\n memberCount\n members {\n id\n displayName\n email\n profileImageUrl\n }\n}\n "]);return y=function(){return e},e}function v(){let e=(0,a._)(["\n fragment DefaultDomainsFields on Domain {\n id\n name\n status\n builtin\n createdTime\n siteId\n}\n "]);return v=function(){return e},e}function k(){let e=(0,a._)(["\n fragment DefaultThemeFontFields on ThemeFont {\n id\n name\n url\n}\n "]);return k=function(){return e},e}function w(){let e=(0,a._)(["\n fragment DefaultThemeFields on Theme {\n id\n workspaceId\n name\n headingFont\n headingFontWeight\n bodyFont\n bodyFontWeight\n accentColor\n logoUrl\n config\n priority\n previewUrl\n archived\n createdTime\n updatedTime\n fonts {\n ... on ThemeFont {\n ...DefaultThemeFontFields\n }\n }\n}\n ",""]);return w=function(){return e},e}function x(){let e=(0,a._)(["\n fragment SiteFragment on Site {\n id\n workspaceId\n name\n domains {\n ...DefaultDomainsFields\n }\n hasCustomDomain\n routes {\n id\n siteId\n docId\n path\n offline\n doc {\n id\n title\n orgAccess\n publishedTime\n publishedSnapshotId\n currentSnapshotId\n editedTime\n archived\n createdTime\n }\n }\n currentDeployment {\n id\n buildHost\n deploymentTime\n siteSettings\n }\n createdTime\n updatedTime\n previewUrl\n pageCount\n archived\n enabled\n faviconUrl\n themeId\n createdBy {\n email\n profileImageUrl\n displayName\n id\n }\n theme {\n ...DefaultThemeFields\n }\n navEnabled\n navContent\n gtmContainerId\n metaPixelId\n}\n ","\n",""]);return x=function(){return e},e}function S(){let e=(0,a._)(["\n fragment CommentAuthorFields on User {\n id\n displayName\n profileImageUrl\n email\n}\n "]);return S=function(){return e},e}function A(){let e=(0,a._)(["\n fragment ReactionFields on Reaction {\n emoji\n count\n targetId\n targetType\n docId\n users {\n id\n displayName\n profileImageUrl\n }\n}\n "]);return A=function(){return e},e}function C(){let e=(0,a._)(["\n fragment ReplyFields on Comment {\n id\n commentId\n content\n createdTime\n updatedTime\n archived\n user {\n ...CommentAuthorFields\n }\n reactions {\n ...ReactionFields\n }\n}\n ","\n",""]);return C=function(){return e},e}function z(){let e=(0,a._)(["\n fragment CommentFields on Comment {\n id\n docId\n cardId\n content\n targetText\n targetHtml\n createdTime\n updatedTime\n archived\n targetId\n status\n user {\n ...CommentAuthorFields\n }\n replies {\n ...ReplyFields\n }\n reactions {\n ...ReactionFields\n }\n}\n ","\n","\n",""]);return z=function(){return e},e}function I(){let e=(0,a._)(["\n fragment DocCollaboratorFields on DocCollaborator {\n docId\n user {\n id\n displayName\n email\n profileImageUrl\n }\n permission\n guest\n accessLinkId\n}\n "]);return I=function(){return e},e}function j(){let e=(0,a._)(["\n fragment DocInvitationsFields on DocInvitation {\n id\n docId\n email\n permission\n}\n "]);return j=function(){return e},e}function F(){let e=(0,a._)(["\n fragment DocChannelFields on DocChannel {\n id\n name\n slug\n permission\n}\n "]);return F=function(){return e},e}function B(){let e=(0,a._)(["\n fragment DocEditorsFields on DocEditor {\n user {\n id\n displayName\n email\n profileImageUrl\n }\n lastEdited\n}\n "]);return B=function(){return e},e}function R(){let e=(0,a._)(["\n fragment DocSiteFields on Site {\n id\n archived\n workspaceId\n name\n domains {\n id\n siteId\n name\n status\n builtin\n }\n hasCustomDomain\n routes {\n id\n siteId\n docId\n path\n offline\n doc {\n id\n title\n }\n }\n currentDeployment {\n id\n siteId\n buildHost\n deploymentTime\n }\n createdTime\n updatedTime\n previewUrl\n pageCount\n archived\n enabled\n faviconUrl\n themeId\n navEnabled\n navContent\n gtmContainerId\n metaPixelId\n}\n "]);return R=function(){return e},e}function _(){let e=(0,a._)(["\n fragment DocReactionsCreate on Doc {\n reactions {\n ...ReactionFields\n }\n}\n ",""]);return _=function(){return e},e}function M(){let e=(0,a._)(["\n fragment DocCommentsCreate on Doc {\n comments {\n id\n docId\n cardId\n content\n targetText\n targetHtml\n createdTime\n updatedTime\n archived\n targetId\n status\n user {\n ...CommentAuthorFields\n }\n }\n}\n ",""]);return M=function(){return e},e}function E(){let e=(0,a._)(["\n fragment DocRepliesCreate on Doc {\n comments {\n id\n replies {\n ...ReplyFields\n }\n }\n}\n ",""]);return E=function(){return e},e}function T(){let e=(0,a._)(["\n fragment DocCommentsUpdate on Doc {\n comments {\n id\n docId\n content\n updatedTime\n reactions {\n ...ReactionFields\n }\n }\n}\n ",""]);return T=function(){return e},e}function O(){let e=(0,a._)(["\n fragment DocRepliesUpdate on Doc {\n comments {\n id\n replies {\n id\n docId\n content\n updatedTime\n reactions {\n ...ReactionFields\n }\n }\n }\n}\n ",""]);return O=function(){return e},e}function P(){let e=(0,a._)(["\n fragment DocCommentsRemove on Doc {\n comments {\n id\n archived\n }\n}\n "]);return P=function(){return e},e}function N(){let e=(0,a._)(["\n fragment DocRepliesRemove on Doc {\n comments {\n id\n replies {\n id\n archived\n }\n }\n}\n "]);return N=function(){return e},e}function D(){let e=(0,a._)(["\n fragment DocUserUpdate on Doc {\n docUser {\n id\n docId\n lastViewed\n lastEdited\n favorited\n }\n}\n "]);return D=function(){return e},e}function L(){let e=(0,a._)(["\n fragment HomeDocFields on Doc {\n id\n title\n archived\n createdTime\n updatedTime\n editedTime\n currentSnapshotId\n titleCard {\n id\n previewUrl\n createdTime\n updatedTime\n }\n createdBy {\n profileImageUrl\n displayName\n id\n email\n }\n collaborators {\n docId\n user {\n id\n }\n permission\n }\n docUser {\n id\n docId\n lastViewed\n lastEdited\n favorited\n }\n channels {\n id\n name\n slug\n permission\n }\n organization {\n id\n name\n }\n orgAccess\n editors {\n docId\n user {\n id\n displayName\n email\n profileImageUrl\n }\n lastEdited\n }\n accessLinks {\n id\n docId\n permission\n token\n url\n }\n site {\n id\n name\n archived\n enabled\n faviconUrl\n previewUrl\n domains {\n ...DefaultDomainsFields\n }\n currentDeployment {\n id\n buildHost\n deploymentTime\n }\n createdTime\n updatedTime\n previewUrl\n pageCount\n createdBy {\n profileImageUrl\n displayName\n id\n email\n }\n }\n}\n ",""]);return L=function(){return e},e}function W(){let e=(0,a._)(["\n fragment ChannelDocActivityFields on DocActivity {\n editors {\n id\n displayName\n profileImageUrl\n }\n presenters {\n id\n displayName\n profileImageUrl\n }\n doc {\n ...HomeDocFields\n }\n}\n ",""]);return W=function(){return e},e}function U(){let e=(0,a._)(["\n fragment ChannelFieldsFragment on Channel {\n id\n name\n slug\n members {\n profileImageUrl\n displayName\n id\n }\n memberCount\n isMember\n workspaceId\n createdTime\n updatedTime\n archived\n activity {\n activeUsers {\n id\n displayName\n profileImageUrl\n email\n }\n }\n}\n "]);return U=function(){return e},e}function G(){let e=(0,a._)(["\n fragment DocChannelUpdate on Doc {\n id\n channels {\n id\n name\n slug\n permission\n }\n}\n "]);return G=function(){return e},e}function H(){let e=(0,a._)(["\n mutation ReportAbuse($input: AbuseReportInput!) {\n reportAbuse(input: $input)\n}\n "]);return H=function(){return e},e}function V(){let e=(0,a._)(["\n mutation ChatCompletion($input: ChatCompletionInput!) {\n chatCompletion(input: $input) {\n role\n content\n }\n}\n "]);return V=function(){return e},e}function q(){let e=(0,a._)(["\n query CanRunChatCompletion($input: CanRunChatCompletionRequest!) {\n canRunChatCompletion(input: $input) {\n model\n canRun\n }\n}\n "]);return q=function(){return e},e}function K(){let e=(0,a._)(["\n mutation CreateDocGeneration($input: CreateDocGenerationInput!) {\n createDocGeneration(input: $input) {\n ...DocGenerationFragment\n }\n}\n ",""]);return K=function(){return e},e}function J(){let e=(0,a._)(["\n mutation UpdateDocGenerationDraftInput($docGenerateInputId: ID!, $input: UpdateDocGenerateInput!) {\n updateDocGenerationDraftInput(\n docGenerateInputId: $docGenerateInputId\n input: $input\n ) {\n ...DocGenerationFragment\n }\n}\n ",""]);return J=function(){return e},e}function $(){let e=(0,a._)(["\n mutation GenerateDoc($docGenerateInputId: ID!, $options: GenerateDocOptions!) {\n generateDoc(docGenerateInputId: $docGenerateInputId, options: $options) {\n id\n docGenerateInput {\n ...DocGenerateInputFragment\n }\n }\n}\n ",""]);return $=function(){return e},e}function Q(){let e=(0,a._)(["\n mutation GenerateDocFromImport($docGenerateInputId: ID!, $options: GenerateDocFromImportOptions!) {\n generateDocFromImport(\n docGenerateInputId: $docGenerateInputId\n options: $options\n ) {\n id\n docGenerateInput {\n ...DocGenerateInputFragment\n }\n }\n}\n ",""]);return Q=function(){return e},e}function Y(){let e=(0,a._)(["\n query GetDocGeneration($id: ID!) {\n docGeneration(id: $id) {\n ...DocGenerationFragment\n }\n}\n ",""]);return Y=function(){return e},e}function X(){let e=(0,a._)(["\n query GetDocGenerations($workspaceId: ID!, $first: Int, $after: String, $last: Int, $before: String, $generationTypes: [GenerationType!]) {\n docGenerations(\n workspaceId: $workspaceId\n first: $first\n after: $after\n last: $last\n before: $before\n generationTypes: $generationTypes\n ) {\n edges {\n cursor\n node {\n ...DocGenerationFragment\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n ",""]);return X=function(){return e},e}function Z(){let e=(0,a._)(["\n mutation ParseDocxHtml($input: ParseDocxHtmlInput!) {\n parseDocxHtml(input: $input) {\n html\n htmlUrl\n }\n}\n "]);return Z=function(){return e},e}function ee(){let e=(0,a._)(["\n mutation GenerateImportPptTheme($input: GeneratePptThemeInput!) {\n generateImportPptTheme(input: $input) {\n thumbnails {\n url\n width\n height\n index\n }\n theme {\n headingFont {\n suggested\n original\n }\n headingFontWeight\n bodyFont {\n suggested\n original\n }\n bodyFontWeight\n headingColors\n bodyColors\n accentColors\n cardColors\n backgroundColors\n logos {\n url\n width\n height\n }\n }\n }\n}\n "]);return ee=function(){return e},e}function et(){let e=(0,a._)(["\n mutation GetPptHtml($input: GetPptHtmlInput!) {\n getPptHtml(input: $input) {\n slideHtml\n htmlUrl\n }\n}\n "]);return et=function(){return e},e}function el(){let e=(0,a._)(["\n query getCredits($workspaceId: ID!) {\n credits(workspaceId: $workspaceId) {\n userId\n credits\n }\n}\n "]);return el=function(){return e},e}function ea(){let e=(0,a._)(["\n mutation deductCredits($value: Int!, $workspaceId: ID!) {\n deductCredits(value: $value, workspaceId: $workspaceId) {\n userId\n credits\n }\n}\n "]);return ea=function(){return e},e}function en(){let e=(0,a._)(["\n subscription SubscribeToCredits($workspaceId: ID!) {\n credits(workspaceId: $workspaceId) {\n userId\n credits\n }\n}\n "]);return en=function(){return e},e}function eo(){let e=(0,a._)(["\n query GetDocWithSnapshot($id: ID!) {\n doc(id: $id) {\n id\n title\n theme {\n ...DefaultThemeFields\n }\n organization {\n id\n name\n products\n __typename\n }\n currentSnapshot {\n id\n docId\n content\n }\n titleCard {\n previewUrl\n text\n }\n }\n}\n ",""]);return eo=function(){return e},e}function ei(){let e=(0,a._)(["\n query GetDocPreviewUrl($id: ID!) {\n doc(id: $id) {\n id\n titleCard {\n previewUrl\n }\n }\n}\n "]);return ei=function(){return e},e}function er(){let e=(0,a._)(["\n query GetWorkspaceFonts($workspaceId: ID, $archived: Boolean, $sortBy: FontSortOrder) {\n fonts(workspaceId: $workspaceId, archived: $archived, sortBy: $sortBy) {\n ...Font\n }\n}\n ",""]);return er=function(){return e},e}function es(){let e=(0,a._)(["\n query GetGlobalFonts {\n fonts(workspaceId: null, archived: false, sortBy: {field: name, direction: asc}) {\n ...Font\n }\n}\n ",""]);return es=function(){return e},e}function ed(){let e=(0,a._)(["\n query GetFont($id: ID!) {\n font(id: $id) {\n ...Font\n }\n}\n ",""]);return ed=function(){return e},e}function eu(){let e=(0,a._)(["\n mutation CreateFont($input: CreateFontInput) {\n createFont(input: $input) {\n ...Font\n }\n}\n ",""]);return eu=function(){return e},e}function ec(){let e=(0,a._)(["\n mutation UpdateFont($input: UpdateFontInput) {\n updateFont(input: $input) {\n ...Font\n }\n}\n ",""]);return ec=function(){return e},e}function em(){let e=(0,a._)(["\n mutation ArchiveFont($id: ID!, $workspaceId: ID!) {\n archiveFont(id: $id, workspaceId: $workspaceId) {\n ...Font\n }\n}\n ",""]);return em=function(){return e},e}function ef(){let e=(0,a._)(["\n mutation CreateSavedMedia($input: CreateSavedMediaInput!) {\n createSavedMedia(input: $input) {\n ...SavedMediaFragment\n }\n}\n ",""]);return ef=function(){return e},e}function ep(){let e=(0,a._)(["\n mutation ArchiveSavedMedia($id: ID!) {\n archiveSavedMedia(id: $id) {\n id\n }\n}\n "]);return ep=function(){return e},e}function eg(){let e=(0,a._)(["\n mutation DeleteSavedMedia($id: ID!) {\n deleteSavedMedia(id: $id)\n}\n "]);return eg=function(){return e},e}function eh(){let e=(0,a._)(["\n query GetSavedMedia($docId: ID, $themeId: ID, $interactionId: ID, $context: SavedMediaContext, $type: MediaType!, $source: String!, $sortBy: SavedMediaSortOrder, $first: Int, $after: String, $last: Int, $before: String) {\n savedMedia(\n docId: $docId\n themeId: $themeId\n interactionId: $interactionId\n context: $context\n type: $type\n source: $source\n sortBy: $sortBy\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n node {\n ...SavedMediaFragment\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n ",""]);return eh=function(){return e},e}function eb(){let e=(0,a._)(["\n query GetUserSavedMedia($workspaceId: ID!, $types: [MediaType!]!, $source: String, $docId: ID, $themeId: ID, $interactionId: ID, $sortBy: SavedMediaSortOrder, $first: Int, $after: String, $last: Int, $before: String) {\n userSavedMedia(\n workspaceId: $workspaceId\n types: $types\n source: $source\n docId: $docId\n themeId: $themeId\n interactionId: $interactionId\n sortBy: $sortBy\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n node {\n ...SavedMediaFragment\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n ",""]);return eb=function(){return e},e}function ey(){let e=(0,a._)(["\n query GetWorkspaceSavedMedia($workspaceId: ID!, $types: [MediaType!]!, $source: String, $docId: ID, $themeId: ID, $interactionId: ID, $sortBy: SavedMediaSortOrder, $first: Int, $after: String, $last: Int, $before: String) {\n workspaceSavedMedia(\n workspaceId: $workspaceId\n types: $types\n source: $source\n docId: $docId\n themeId: $themeId\n interactionId: $interactionId\n sortBy: $sortBy\n first: $first\n after: $after\n last: $last\n before: $before\n ) {\n edges {\n node {\n ...SavedMediaFragment\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n ",""]);return ey=function(){return e},e}function ev(){let e=(0,a._)(["\n query Products($workspaceId: ID, $productPriceFilter: ProductPriceInput) {\n products(workspaceId: $workspaceId, productPriceFilter: $productPriceFilter) {\n id\n key\n prices {\n id\n price\n currency\n discount {\n price\n discountPercent\n discountAmount\n }\n frequencyUnit\n frequencyInterval\n }\n }\n}\n "]);return ev=function(){return e},e}function ek(){let e=(0,a._)(["\n mutation CreateCheckoutSession($workspaceId: ID!, $items: [CheckoutItemInput!]!) {\n createCheckoutSession(workspaceId: $workspaceId, items: $items) {\n url\n }\n}\n "]);return ek=function(){return e},e}function ew(){let e=(0,a._)(["\n mutation UpdateSubscriptionProduct($id: ID!, $productPriceId: String!) {\n updateSubscriptionProduct(id: $id, productPriceId: $productPriceId) {\n id\n }\n}\n "]);return ew=function(){return e},e}function ex(){let e=(0,a._)(["\n query SearchDocsAndChannels($workspaceId: ID, $query: String!) {\n search(orgId: $workspaceId, query: $query, types: [doc, channel]) {\n __typename\n ... on DocResult {\n ...SearchDocResult\n }\n ... on Channel {\n ...SearchChannelResult\n }\n }\n}\n ","\n",""]);return ex=function(){return e},e}function eS(){let e=(0,a._)(["\n query GetDocsForGlobalSearch($first: Int, $after: String, $workspaceId: ID, $createdBy: ID, $archived: Boolean, $sortBy: DocSortOrder) {\n docs(\n first: $first\n after: $after\n workspaceId: $workspaceId\n createdBy: $createdBy\n archived: $archived\n sortBy: $sortBy\n ) {\n edges {\n node {\n ...DocFieldsFragment\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n ",""]);return eS=function(){return e},e}function eA(){let e=(0,a._)(["\n query SharingSearchUser($workspaceId: ID!, $query: String!) {\n search(orgId: $workspaceId, query: $query, types: [user]) {\n __typename\n ... on User {\n ...ShareSearchUser\n }\n }\n}\n ",""]);return eA=function(){return e},e}function eC(){let e=(0,a._)(["\n query SharingSearchChannel($workspaceId: ID!, $query: String!) {\n search(orgId: $workspaceId, query: $query, types: [channel]) {\n __typename\n ... on Channel {\n ...ShareSearchChannel\n }\n }\n}\n ",""]);return eC=function(){return e},e}function ez(){let e=(0,a._)(["\n mutation UpdatePublicChannels($input: DocSharingInput!) {\n updatePublicChannels(input: $input) {\n id\n channels {\n id\n name\n permission\n }\n }\n}\n "]);return ez=function(){return e},e}function eI(){let e=(0,a._)(["\n mutation UpdateDocSharing($id: ID!, $sharing: [DocJSONPatch!]) {\n updateDoc(input: {id: $id, sharing: $sharing}) {\n id\n channels {\n id\n name\n slug\n permission\n }\n }\n}\n "]);return eI=function(){return e},e}function ej(){let e=(0,a._)(["\n mutation CreateSite($input: CreateSiteInput!) {\n createSite(input: $input) {\n ...SiteFragment\n }\n}\n ",""]);return ej=function(){return e},e}function eF(){let e=(0,a._)(["\n mutation UpdateSite($input: UpdateSiteInput!) {\n updateSite(input: $input) {\n id\n name\n faviconUrl\n themeId\n navEnabled\n navContent\n gtmContainerId\n metaPixelId\n }\n}\n "]);return eF=function(){return e},e}function eB(){let e=(0,a._)(["\n mutation ArchiveSite($id: ID!) {\n archiveSite(id: $id) {\n id\n archived\n }\n}\n "]);return eB=function(){return e},e}function eR(){let e=(0,a._)(["\n mutation UnarchiveSite($id: ID!) {\n unarchiveSite(id: $id) {\n id\n enabled\n archived\n }\n}\n "]);return eR=function(){return e},e}function e_(){let e=(0,a._)(["\n mutation DisableSite($id: ID!) {\n disableSite(id: $id) {\n id\n enabled\n }\n}\n "]);return e_=function(){return e},e}function eM(){let e=(0,a._)(["\n mutation EnableSite($id: ID!) {\n enableSite(id: $id) {\n id\n enabled\n }\n}\n "]);return eM=function(){return e},e}function eE(){let e=(0,a._)(["\n mutation UpdateRoutes($input: UpdateSiteRoutesInput!) {\n updateRoutes(input: $input) {\n id\n routes {\n id\n path\n docId\n }\n }\n}\n "]);return eE=function(){return e},e}function eT(){let e=(0,a._)(["\n mutation AddDomain($input: AddDomainInput!) {\n addDomain(input: $input) {\n id\n domains {\n id\n name\n status\n }\n routes {\n id\n path\n docId\n }\n }\n}\n "]);return eT=function(){return e},e}function eO(){let e=(0,a._)(["\n mutation DeleteDomain($id: ID!) {\n deleteDomain(id: $id) {\n id\n }\n}\n "]);return eO=function(){return e},e}function eP(){let e=(0,a._)(["\n mutation changeBuiltinDomain($input: ChangeBuiltinDomainInput!) {\n changeBuiltinDomain(input: $input) {\n id\n domains {\n name\n status\n builtin\n }\n routes {\n id\n path\n docId\n }\n }\n}\n "]);return eP=function(){return e},e}function eN(){let e=(0,a._)(["\n query GetSites($workspaceId: ID!) {\n sites(workspaceId: $workspaceId) {\n ...SiteFragment\n }\n}\n ",""]);return eN=function(){return e},e}function eD(){let e=(0,a._)(["\n query GetSite($id: ID!) {\n site(id: $id) {\n ...SiteFragment\n }\n}\n ",""]);return eD=function(){return e},e}function eL(){let e=(0,a._)(["\n query GetDomains($workspaceId: ID!, $name: String!) {\n domains(workspaceId: $workspaceId, name: $name) {\n ...DefaultDomainsFields\n siteId\n siteName\n siteArchived\n }\n}\n ",""]);return eL=function(){return e},e}function eW(){let e=(0,a._)(["\n query GetDocWithPublishedSnapshot($id: ID!) {\n publishedDoc(id: $id) {\n id\n title\n organization {\n products\n id\n __typename\n }\n editors {\n docId\n user {\n id\n displayName\n profileImageUrl\n }\n lastEdited\n }\n theme {\n ...DefaultThemeFields\n }\n publishedSnapshot {\n id\n docId\n content\n }\n titleCard {\n previewUrl\n text\n title\n }\n editedTime\n site {\n routes {\n path\n docId\n }\n hasCustomDomain\n faviconUrl\n navContent\n navEnabled\n gtmContainerId\n metaPixelId\n }\n links {\n url\n nodeType\n status\n }\n }\n}\n ",""]);return eW=function(){return e},e}function eU(){let e=(0,a._)(["\n query GetPublishedDoc($id: ID!) {\n publishedDoc(id: $id) {\n id\n publishedTime\n publishedSnapshot {\n id\n content\n }\n }\n}\n "]);return eU=function(){return e},e}function eG(){let e=(0,a._)(["\n mutation PublishSite($id: ID!) {\n publishSite(id: $id) {\n ...SiteFragment\n }\n}\n ",""]);return eG=function(){return e},e}function eH(){let e=(0,a._)(["\n mutation PublishDoc($id: ID!) {\n publishDoc(id: $id) {\n id\n publishedTime\n publishedSnapshot {\n id\n }\n }\n}\n "]);return eH=function(){return e},e}function eV(){let e=(0,a._)(["\n mutation archivePage($id: ID!) {\n archivePage(id: $id) {\n id\n publishedTime\n publishedSnapshot {\n id\n }\n }\n}\n "]);return eV=function(){return e},e}function eq(){let e=(0,a._)(["\n mutation VerifyDomain($id: ID!) {\n verifyDomain(id: $id) {\n id\n domains {\n id\n name\n status\n }\n }\n}\n "]);return eq=function(){return e},e}function eK(){let e=(0,a._)(["\n mutation TransferDomain($id: ID!, $siteId: ID!) {\n transferDomain(id: $id, siteId: $siteId) {\n id\n siteId\n name\n }\n}\n "]);return eK=function(){return e},e}function eJ(){let e=(0,a._)(["\n mutation SetRoute($input: SetRouteInput!) {\n setRoute(input: $input) {\n id\n name\n routes {\n id\n path\n docId\n doc {\n title\n }\n offline\n }\n }\n}\n "]);return eJ=function(){return e},e}function e$(){let e=(0,a._)(["\n query CheckDomain($name: String!) {\n checkDomain(name: $name) {\n ok\n dns {\n status\n errors {\n code\n message\n }\n }\n ssl {\n ok\n errors {\n code\n message\n }\n }\n http {\n ok\n errors {\n code\n message\n }\n }\n actions {\n code\n data\n }\n }\n}\n "]);return e$=function(){return e},e}function eQ(){let e=(0,a._)(["\n mutation CreateTheme($input: CreateThemeInput!) {\n createTheme(input: $input) {\n ...DefaultThemeFields\n docCount\n }\n}\n ",""]);return eQ=function(){return e},e}function eY(){let e=(0,a._)(["\n mutation UpdateTheme($input: UpdateThemeInput!) {\n updateTheme(input: $input) {\n ...DefaultThemeFields\n docCount\n }\n}\n ",""]);return eY=function(){return e},e}function eX(){let e=(0,a._)(["\n mutation MakeThemeStandard($id: ID!, $newId: ID) {\n makeThemeStandard(id: $id, newId: $newId) {\n ...DefaultThemeFields\n docCount\n }\n}\n ",""]);return eX=function(){return e},e}function eZ(){let e=(0,a._)(["\n mutation DuplicateTheme($id: ID!) {\n duplicateTheme(id: $id) {\n ...DefaultThemeFields\n }\n}\n ",""]);return eZ=function(){return e},e}function e0(){let e=(0,a._)(["\n query GetTheme($id: ID) {\n theme(id: $id) {\n ...DefaultThemeFields\n createdBy {\n id\n displayName\n email\n profileImageUrl\n }\n }\n}\n ",""]);return e0=function(){return e},e}function e1(){let e=(0,a._)(["\n query GetThemeWithCount($id: ID) {\n theme(id: $id) {\n ...DefaultThemeFields\n docCount\n siteCount\n createdBy {\n id\n displayName\n email\n profileImageUrl\n }\n }\n}\n ",""]);return e1=function(){return e},e}function e2(){let e=(0,a._)(["\n query GetThemes($workspaceId: ID, $archived: Boolean) {\n themes(workspaceId: $workspaceId, archived: $archived) {\n ...DefaultThemeFields\n createdBy {\n id\n displayName\n email\n profileImageUrl\n }\n }\n}\n ",""]);return e2=function(){return e},e}function e6(){let e=(0,a._)(["\n mutation ArchiveTheme($id: ID!) {\n archiveTheme(id: $id) {\n ...DefaultThemeFields\n docCount\n siteCount\n }\n}\n ",""]);return e6=function(){return e},e}function e4(){let e=(0,a._)(["\n mutation UnarchiveTheme($id: ID!) {\n unarchiveTheme(id: $id) {\n ...DefaultThemeFields\n }\n}\n ",""]);return e4=function(){return e},e}function e5(){let e=(0,a._)(["\n query GetDocMention($id: ID!) {\n doc(id: $id) {\n id\n title\n updatedTime\n editedTime\n titleCard {\n previewUrl\n }\n createdTime\n createdBy {\n id\n displayName\n email\n profileImageUrl\n }\n docUser {\n id\n docId\n lastViewed\n lastEdited\n favorited\n }\n editors {\n user {\n id\n displayName\n profileImageUrl\n }\n lastViewed\n lastEdited\n }\n }\n}\n "]);return e5=function(){return e},e}function e3(){let e=(0,a._)(["\n subscription SubscribeToDocMention($id: ID!) {\n doc(id: $id) {\n ... on DocSubscription {\n id\n title\n updatedTime\n editedTime\n titleCard {\n previewUrl\n }\n editors {\n user {\n id\n displayName\n profileImageUrl\n }\n lastViewed\n lastEdited\n }\n }\n }\n}\n "]);return e3=function(){return e},e}function e8(){let e=(0,a._)(["\n mutation UpdateUser($input: UpdateUserInput!) {\n updateUser(input: $input) {\n id\n jobFunction\n referrer\n }\n}\n "]);return e8=function(){return e},e}function e7(){let e=(0,a._)(["\n mutation UpdateUserSettings($patch: [JSONPatch!]) {\n updateUserSettings(patch: $patch) {\n showWorkspaceSetup\n showGetStarted\n welcomeDocId\n locale\n unsubscribeAnnouncementEmails\n unsubscribeOnboardingEmails\n goals\n }\n}\n "]);return e7=function(){return e},e}function e9(){let e=(0,a._)(["\n query GetGraphqlUser {\n user {\n id\n displayName\n profileImageUrl\n email\n workspaceMemberships {\n workspace {\n id\n name\n adminCount\n memberCount\n }\n role\n disabled\n }\n }\n}\n "]);return e9=function(){return e},e}function te(){let e=(0,a._)(["\n mutation DeleteUser {\n deleteUser {\n id\n }\n}\n "]);return te=function(){return e},e}function tt(){let e=(0,a._)(["\n mutation CreateIntegration($input: CreateIntegrationInput!) {\n createIntegration(input: $input) {\n id\n integrations\n }\n}\n "]);return tt=function(){return e},e}function tl(){let e=(0,a._)(["\n query UserIntegrations {\n userIntegrations {\n id\n integrations\n }\n}\n "]);return tl=function(){return e},e}function ta(){let e=(0,a._)(["\n query GetWorkspaceSubscription($workspaceId: ID!, $includeExpired: Boolean) {\n subscription(workspaceId: $workspaceId, includeExpired: $includeExpired) {\n id\n status\n billingSubscriptionId\n discountPercent\n createdByUser {\n id\n email\n displayName\n billingCustomerId\n }\n products {\n id\n name\n key\n productPrice {\n id\n price\n currency\n frequencyUnit\n frequencyInterval\n }\n units\n createdTime\n }\n createdTime\n nextBillingTime\n expirationTime\n cancellationRequestedTime\n }\n}\n "]);return ta=function(){return e},e}function tn(){let e=(0,a._)(["\n mutation UpdateWorkspace($input: UpdateWorkspaceInput!) {\n updateWorkspace(input: $input) {\n id\n name\n defaultThemeId\n logoUrl\n workspaceMemberPermission\n accessLinkPermission\n }\n}\n "]);return tn=function(){return e},e}function to(){let e=(0,a._)(["\n query GetWorkspaceMembers($first: Int, $after: String, $sortBy: WorkspaceMembersSortOrder, $id: ID!) {\n workspaceMembers(id: $id, first: $first, after: $after, sortBy: $sortBy) {\n edges {\n node {\n displayName\n id\n createdTime\n profileImageUrl\n email\n workspaceMemberships {\n workspace {\n id\n }\n role\n createdTime\n disabled\n }\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n "]);return to=function(){return e},e}function ti(){let e=(0,a._)(["\n query GetWorkspace($id: String!) {\n workspace(id: $id) {\n id\n name\n adminCount\n memberCount\n invitations {\n id\n email\n createdTime\n }\n defaultThemeId\n logoUrl\n workspaceMemberPermission\n accessLinkPermission\n }\n}\n "]);return ti=function(){return e},e}function tr(){let e=(0,a._)(["\n mutation UpdateMemberRole($workspaceId: ID!, $userId: ID!, $role: WorkspaceRole) {\n updateMemberRole(workspaceId: $workspaceId, userId: $userId, role: $role) {\n id\n workspaceMemberships {\n workspace {\n id\n name\n }\n role\n disabled\n createdTime\n }\n }\n}\n "]);return tr=function(){return e},e}function ts(){let e=(0,a._)(["\n mutation RemoveMember($workspaceId: ID!, $userId: ID!) {\n removeMember(workspaceId: $workspaceId, userId: $userId) {\n id\n name\n adminCount\n }\n}\n "]);return ts=function(){return e},e}function td(){let e=(0,a._)(["\n mutation RevokeWorkspaceInvitation($id: ID!) {\n revokeWorkspaceInvitation(id: $id) {\n id\n invitations {\n id\n email\n createdTime\n }\n }\n}\n "]);return td=function(){return e},e}function tu(){let e=(0,a._)(["\n query SearchMention($workspaceId: ID!, $query: String!, $types: [SearchType!] = [user, doc]) {\n search(orgId: $workspaceId, query: $query, types: $types) {\n __typename\n ... on DocResult {\n id\n title\n text\n archived\n previewUrl\n createdBy {\n id\n displayName\n profileImageUrl\n }\n organization {\n id\n }\n editors {\n user {\n id\n displayName\n profileImageUrl\n }\n lastViewed\n lastEdited\n }\n docUser {\n lastViewed\n lastEdited\n favorited\n }\n orgAccess\n updatedTime\n createdTime\n editedTime\n }\n ... on User {\n id\n displayName\n email\n profileImageUrl\n }\n }\n}\n "]);return tu=function(){return e},e}function tc(){let e=(0,a._)(["\n mutation AddCollaborators($docId: ID!, $collaborators: [DocCollaboratorInput!]!) {\n addCollaborators(docId: $docId, collaborators: $collaborators) {\n id\n collaborators {\n ...DocCollaboratorFields\n }\n invitations {\n ...DocInvitationsFields\n }\n }\n}\n ","\n",""]);return tc=function(){return e},e}function tm(){let e=(0,a._)(["\n mutation RemoveCollaborators($docId: ID!, $collaborators: [DocCollaboratorRemovalInput!]!) {\n removeCollaborators(docId: $docId, collaborators: $collaborators) {\n id\n collaborators {\n ...DocCollaboratorFields\n }\n invitations {\n ...DocInvitationsFields\n }\n }\n}\n ","\n",""]);return tm=function(){return e},e}function tf(){let e=(0,a._)(["\n mutation AddCollaboratorByAccessLink($docId: ID!) {\n addCollaboratorByAccessLink(docId: $docId) {\n id\n collaborators {\n ...DocCollaboratorFields\n }\n }\n}\n ",""]);return tf=function(){return e},e}function tp(){let e=(0,a._)(["\n query GetDoc($id: ID!, $password: String) {\n doc(id: $id, password: $password) {\n id\n title\n titleEdited\n titleCard {\n previewUrl\n }\n archived\n disabled\n createdTime\n updatedTime\n editedTime\n savedTime\n currentSnapshotId\n publishedSnapshotId\n publishedSnapshot {\n content\n }\n publishedTime\n comments {\n ...CommentFields\n }\n reactions {\n ...ReactionFields\n }\n accessLinks {\n id\n docId\n type\n permission\n token\n url\n }\n links {\n url\n status\n }\n orgAccess\n organization {\n id\n name\n products\n }\n theme {\n ...DefaultThemeFields\n fonts {\n id\n name\n url\n }\n }\n collaborators {\n ...DocCollaboratorFields\n }\n invitations {\n ...DocInvitationsFields\n }\n editors {\n ...DocEditorsFields\n }\n createdBy {\n displayName\n id\n email\n }\n channels {\n ...DocChannelFields\n }\n site {\n ...DocSiteFields\n }\n docGenerateInput {\n id\n settings\n docGeneration {\n id\n generationType\n }\n }\n }\n}\n ","\n","\n","\n","\n","\n","\n","\n",""]);return tp=function(){return e},e}function tg(){let e=(0,a._)(["\n query GetDocRobots($id: ID!) {\n doc(id: $id) {\n id\n title\n createdTime\n updatedTime\n currentSnapshot {\n id\n docId\n content\n }\n titleCard {\n previewUrl\n text\n }\n organization {\n id\n name\n products\n }\n createdBy {\n displayName\n id\n email\n }\n }\n}\n "]);return tg=function(){return e},e}function th(){let e=(0,a._)(["\n subscription SubscribeToDoc($id: ID!) {\n doc(id: $id) {\n ... on DocSubscription {\n id\n title\n titleEdited\n titleCard {\n previewUrl\n }\n archived\n updatedTime\n editedTime\n savedTime\n publishedTime\n accessLinks {\n id\n docId\n type\n permission\n token\n url\n }\n channels {\n ...DocChannelFields\n }\n collaborators {\n ...DocCollaboratorFields\n }\n editors {\n ...DocEditorsFields\n }\n invitations {\n ...DocInvitationsFields\n }\n theme {\n ...DefaultThemeFields\n }\n reactions {\n ...ReactionFields\n }\n orgAccess\n }\n ... on DocCommentsSubscription {\n id\n comments {\n ...CommentFields\n }\n }\n ... on DocReactionsSubscription {\n id\n reactions {\n ...ReactionFields\n }\n }\n ... on DocLinksSubscription {\n id\n links {\n url\n status\n }\n }\n }\n}\n ","\n","\n","\n","\n","\n","\n",""]);return th=function(){return e},e}function tb(){let e=(0,a._)(["\n mutation UpdateDocTitle($id: ID!, $title: String, $titleEdited: Boolean) {\n updateDoc(input: {id: $id, title: $title, titleEdited: $titleEdited}) {\n id\n title\n titleEdited\n }\n}\n "]);return tb=function(){return e},e}function ty(){let e=(0,a._)(["\n mutation UpdateDocOrgAccess($id: ID!, $orgAccess: Permission) {\n updateDoc(input: {id: $id, orgAccess: $orgAccess}) {\n id\n orgAccess\n }\n}\n "]);return ty=function(){return e},e}function tv(){let e=(0,a._)(["\n mutation UpdateDocAccessLinks($id: ID!, $accessLinks: [AccessLinkInput!]) {\n updateDoc(input: {id: $id, accessLinks: $accessLinks}) {\n id\n accessLinks {\n permission\n id\n }\n }\n}\n "]);return tv=function(){return e},e}function tk(){let e=(0,a._)(["\n mutation UpdateDocTheme($id: ID!, $themeId: String) {\n updateDoc(input: {id: $id, themeId: $themeId}) {\n id\n theme {\n ...DefaultThemeFields\n }\n }\n}\n ",""]);return tk=function(){return e},e}function tw(){let e=(0,a._)(["\n mutation InviteMembers($workspaceId: ID!, $invitees: [InvitationInput!]!) {\n inviteMembers(orgId: $workspaceId, invitees: $invitees) {\n id\n name\n invitations {\n email\n }\n }\n}\n "]);return tw=function(){return e},e}function tx(){let e=(0,a._)(["\n mutation CreateComment($input: CreateCommentInput) {\n createComment(input: $input) {\n id\n docId\n cardId\n content\n targetText\n targetHtml\n createdTime\n updatedTime\n commentId\n archived\n targetId\n status\n user {\n ...CommentAuthorFields\n }\n replies {\n ...ReplyFields\n }\n reactions {\n ...ReactionFields\n }\n }\n}\n ","\n","\n",""]);return tx=function(){return e},e}function tS(){let e=(0,a._)(["\n mutation UpdateComment($input: UpdateCommentInput!) {\n updateComment(input: $input) {\n id\n docId\n content\n updatedTime\n }\n}\n "]);return tS=function(){return e},e}function tA(){let e=(0,a._)(["\n mutation UpdateCommentStatus($input: UpdateCommentStatusInput!) {\n updateCommentStatus(input: $input) {\n id\n status\n updatedTime\n }\n}\n "]);return tA=function(){return e},e}function tC(){let e=(0,a._)(["\n mutation RemoveComment($id: ID!) {\n archiveComment(id: $id) {\n id\n archived\n }\n}\n "]);return tC=function(){return e},e}function tz(){let e=(0,a._)(["\n mutation AddReaction($reactionInput: AddReactionInput!) {\n addReaction(input: $reactionInput) {\n ...ReactionFields\n }\n}\n ",""]);return tz=function(){return e},e}function tI(){let e=(0,a._)(["\n mutation RemoveReaction($reactionInput: RemoveReactionInput!) {\n removeReaction(input: $reactionInput) {\n ...ReactionFields\n }\n}\n ",""]);return tI=function(){return e},e}function tj(){let e=(0,a._)(["\n query GetMemoAnalytics($memoId: ID!) {\n memoStats(id: $memoId) {\n memoId\n uniqueViewers\n uniqueEditors\n cardCount\n lastOpened\n viewers {\n user {\n id\n displayName\n email\n profileImageUrl\n }\n visitorId\n lastOpened\n cardsViewed\n }\n dailyViews {\n dayCount\n timezone\n everyone {\n date\n uniqueVisitors\n }\n viewers {\n date\n uniqueVisitors\n }\n }\n }\n}\n "]);return tj=function(){return e},e}function tF(){let e=(0,a._)(["\n query GetDocCardsAnalytics($docId: ID!, $userId: ID) {\n docCardsStats(docId: $docId, userId: $userId) {\n docId\n uniqueVisitors\n uniqueEditors\n cardCount\n everyone {\n cardId\n viewTimePercent\n viewersPercent\n }\n viewers {\n cardId\n viewTimePercent\n viewersPercent\n }\n }\n}\n "]);return tF=function(){return e},e}function tB(){let e=(0,a._)(["\n mutation SetDocPassword($docId: ID!, $password: String!) {\n setDocPassword(id: $docId, password: $password) {\n id\n accessLinks {\n id\n permission\n type\n }\n }\n}\n "]);return tB=function(){return e},e}function tR(){let e=(0,a._)(["\n mutation RemoveDocPassword($docId: ID!) {\n removeDocPassword(id: $docId) {\n id\n accessLinks {\n id\n permission\n type\n }\n }\n}\n "]);return tR=function(){return e},e}function t_(){let e=(0,a._)(["\n query GetDocPassword($docId: ID!) {\n getDocPassword(id: $docId)\n}\n "]);return t_=function(){return e},e}function tM(){let e=(0,a._)(["\n query GetPublicDoc($docId: ID!) {\n publicDoc(id: $docId) {\n id\n logoUrl\n }\n}\n "]);return tM=function(){return e},e}function tE(){let e=(0,a._)(["\n query GetDocCurrentSnapshotId($id: ID!) {\n doc(id: $id) {\n id\n currentSnapshotId\n }\n}\n "]);return tE=function(){return e},e}function tT(){let e=(0,a._)(["\n mutation CreateDoc($workspaceId: ID!, $title: String, $themeId: String, $source: DocSource, $initialContent: BaseSnapshotInput, $channels: [DocChannelInput!], $orgAccess: Permission, $mainPage: Boolean) {\n createDoc(\n input: {orgId: $workspaceId, title: $title, source: $source, initialContent: $initialContent, channels: $channels, themeId: $themeId, orgAccess: $orgAccess, mainPage: $mainPage}\n ) {\n id\n }\n}\n "]);return tT=function(){return e},e}function tO(){let e=(0,a._)(["\n mutation ArchiveDoc($id: ID!) {\n archiveDoc(id: $id) {\n id\n archived\n }\n}\n "]);return tO=function(){return e},e}function tP(){let e=(0,a._)(["\n mutation DeleteDoc($id: ID!) {\n deleteDoc(id: $id)\n}\n "]);return tP=function(){return e},e}function tN(){let e=(0,a._)(["\n mutation UnArchiveDoc($id: ID!) {\n unarchiveDoc(id: $id) {\n id\n archived\n }\n}\n "]);return tN=function(){return e},e}function tD(){let e=(0,a._)(["\n mutation FavoriteDoc($input: DocUserInput!) {\n updateDocUser(input: $input) {\n id\n docId\n lastViewed\n lastEdited\n favorited\n }\n}\n "]);return tD=function(){return e},e}function tL(){let e=(0,a._)(["\n query GetPreviewChannelDocs($first: Int, $after: String, $channelId: ID!) {\n previewChannelDocs(first: $first, after: $after, channelId: $channelId) {\n edges {\n node {\n ...HomeDocFields\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n ",""]);return tL=function(){return e},e}function tW(){let e=(0,a._)(["\n query GetChannelDocActivity($first: Int, $channelId: ID!) {\n channelDocActivity(first: $first, channelId: $channelId) {\n edges {\n node {\n ...ChannelDocActivityFields\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n ",""]);return tW=function(){return e},e}function tU(){let e=(0,a._)(["\n query GetDocs($first: Int, $after: String, $workspaceId: ID, $createdBy: ID, $archived: Boolean, $sortBy: DocSortOrder, $isPrivate: Boolean, $channelId: ID) {\n docs(\n first: $first\n after: $after\n workspaceId: $workspaceId\n createdBy: $createdBy\n archived: $archived\n sortBy: $sortBy\n isPrivate: $isPrivate\n channelId: $channelId\n ) {\n edges {\n node {\n ...HomeDocFields\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n ",""]);return tU=function(){return e},e}function tG(){let e=(0,a._)(["\n query GetSharedDocs($first: Int, $after: String, $archived: Boolean, $sortBy: DocSortOrder) {\n sharedDocs(first: $first, after: $after, archived: $archived, sortBy: $sortBy) {\n edges {\n node {\n ...HomeDocFields\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n ",""]);return tG=function(){return e},e}function tH(){let e=(0,a._)(["\n query GetSnapshots($docId: ID!, $first: Int, $after: String) {\n snapshots(docId: $docId, first: $first, after: $after) {\n edges {\n node {\n id\n docId\n createdTime\n editors {\n displayName\n id\n }\n schemaVersion\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n "]);return tH=function(){return e},e}function tV(){let e=(0,a._)(["\n mutation DuplicateDoc($duplicateDocInput: DuplicateDocInput!) {\n duplicateDoc(input: $duplicateDocInput) {\n id\n title\n }\n}\n "]);return tV=function(){return e},e}function tq(){let e=(0,a._)(["\n query GetSnapshot($snapshotId: ID!, $docId: ID!, $password: String) {\n snapshot(id: $snapshotId, docId: $docId, password: $password) {\n id\n content\n schemaVersion\n }\n}\n "]);return tq=function(){return e},e}function tK(){let e=(0,a._)(["\n query GetDocForSnapshotViewer($id: ID!) {\n doc(id: $id) {\n id\n currentSnapshotId\n createdTime\n title\n createdBy {\n profileImageUrl\n displayName\n id\n }\n }\n}\n "]);return tK=function(){return e},e}function tJ(){let e=(0,a._)(["\n subscription ChannelActivity($channelId: ID!) {\n channelDocActivity(channelId: $channelId) {\n editors {\n id\n displayName\n profileImageUrl\n }\n presenters {\n id\n displayName\n profileImageUrl\n }\n doc {\n ...HomeDocFields\n }\n }\n}\n ",""]);return tJ=function(){return e},e}function t$(){let e=(0,a._)(["\n query GetChannels($workspaceId: ID!) {\n channels(workspaceId: $workspaceId) {\n ...ChannelFieldsFragment\n }\n}\n ",""]);return t$=function(){return e},e}function tQ(){let e=(0,a._)(["\n query GetChannel($id: ID!, $workspaceId: ID!) {\n channel(id: $id, workspaceId: $workspaceId) {\n ...ChannelFieldsFragment\n }\n}\n ",""]);return tQ=function(){return e},e}function tY(){let e=(0,a._)(["\n query GetWorkspaceChannels($workspaceId: ID!, $first: Int, $after: String, $query: String, $sortBy: ChannelSortOrder) {\n workspaceChannels(\n workspaceId: $workspaceId\n first: $first\n after: $after\n query: $query\n sortBy: $sortBy\n ) {\n edges {\n node {\n ...ChannelFieldsFragment\n }\n }\n pageInfo {\n endCursor\n hasNextPage\n }\n }\n}\n ",""]);return tY=function(){return e},e}function tX(){let e=(0,a._)(["\n mutation CreateChannel($input: CreateChannelInput!) {\n createChannel(input: $input) {\n ...ChannelFieldsFragment\n }\n}\n ",""]);return tX=function(){return e},e}function tZ(){let e=(0,a._)(["\n mutation JoinChannel($channelId: ID!) {\n joinChannel(channelId: $channelId) {\n ...ChannelFieldsFragment\n }\n}\n ",""]);return tZ=function(){return e},e}function t0(){let e=(0,a._)(["\n mutation LeaveChannel($channelId: ID!) {\n leaveChannel(channelId: $channelId) {\n ...ChannelFieldsFragment\n }\n}\n ",""]);return t0=function(){return e},e}function t1(){let e=(0,a._)(["\n mutation ArchiveChannel($channelId: ID!, $workspaceId: ID!) {\n archiveChannel(id: $channelId, workspaceId: $workspaceId) {\n ...ChannelFieldsFragment\n }\n}\n ",""]);return t1=function(){return e},e}function t2(){let e=(0,a._)(["\n mutation UpdateChannel($input: UpdateChannelInput) {\n updateChannel(input: $input) {\n ...ChannelFieldsFragment\n }\n}\n ",""]);return t2=function(){return e},e}function t6(){let e=(0,a._)(["\n query SearchChannels($workspaceId: ID, $query: String!) {\n search(orgId: $workspaceId, query: $query, types: [doc, channel]) {\n __typename\n ... on Channel {\n ...ChannelFieldsFragment\n }\n }\n}\n ",""]);return t6=function(){return e},e}function t4(){let e=(0,a._)(["\n subscription Channels($workspaceId: ID!) {\n channels(workspaceId: $workspaceId) {\n ...ChannelFieldsFragment\n }\n}\n ",""]);return t4=function(){return e},e}function t5(){let e=(0,a._)(["\n mutation SendCode($input: SendCodeInput!) {\n sendCode(input: $input) {\n emailSent\n provider\n link\n }\n}\n "]);return t5=function(){return e},e}function t3(){let e=(0,a._)(["\n query VerifyCode($input: VerifyCodeInput!) {\n verifyCode(input: $input) {\n verified\n isNew\n }\n}\n "]);return t3=function(){return e},e}function t8(){let e=(0,a._)(["\n mutation Signin($input: SigninInput!) {\n signin(input: $input) {\n success\n }\n}\n "]);return t8=function(){return e},e}function t7(){let e=(0,a._)(["\n mutation Signup($input: SignupInput!) {\n signup(input: $input) {\n id\n organizations {\n id\n }\n settings {\n showWorkspaceSetup\n showGetStarted\n welcomeDocId\n }\n }\n}\n "]);return t7=function(){return e},e}function t9(){let e=(0,a._)(["\n mutation ResetPassword($input: ResetPasswordInput!) {\n resetPassword(input: $input) {\n success\n }\n}\n "]);return t9=function(){return e},e}function le(){let e=(0,a._)(["\n mutation ChangePassword($input: ChangePasswordInput!) {\n changePassword(input: $input) {\n success\n }\n}\n "]);return le=function(){return e},e}function lt(){let e=(0,a._)(["\n query GetDocInvitation($docId: ID!, $email: String!, $inviteCode: String!) {\n docInvitation(docId: $docId, email: $email, inviteCode: $inviteCode) {\n docId\n docTitle\n email\n invitedBy {\n displayName\n }\n permission\n }\n}\n "]);return lt=function(){return e},e}function ll(){let e=(0,a._)(["\n mutation AcceptDocInvitation($docId: ID!, $email: String!, $inviteCode: String!) {\n acceptDocInvitation(docId: $docId, email: $email, inviteCode: $inviteCode) {\n id\n }\n}\n "]);return ll=function(){return e},e}function la(){let e=(0,a._)(["\n query GetWorkspaceInvitation($email: String!, $inviteCode: String!, $workspaceId: String) {\n workspaceInvitation(\n email: $email\n inviteCode: $inviteCode\n workspaceId: $workspaceId\n ) {\n email\n workspaceId\n workspaceName\n invitedBy {\n displayName\n }\n }\n}\n "]);return la=function(){return e},e}function ln(){let e=(0,a._)(["\n mutation JoinWorkspace($input: Invite!) {\n joinWorkspace(input: $input) {\n success\n }\n}\n "]);return ln=function(){return e},e}let lo={};var li=function(e){return e.DeceptiveOrMisleading="deceptive_or_misleading",e.Explicit="explicit",e.Other="other",e.Spam="spam",e.Inappropriate="inappropriate",e}({}),lr=function(e){return e.Azure="azure",e.Openai="openai",e}({}),ls=function(e){return e.GetShortenedSystem="getShortenedSystem",e.GetShortenedUser="getShortenedUser",e.GetOutlineSystem="getOutlineSystem",e.GetOutlineUser="getOutlineUser",e.GenerateDocumentSystem="generateDocumentSystem",e.GenerateDocumentUser="generateDocumentUser",e.GeneratePresentationSystem="generatePresentationSystem",e.GeneratePresentationUser="generatePresentationUser",e.GenerateWebpageSystem="generateWebpageSystem",e.GenerateWebpageUser="generateWebpageUser",e.GenerateDocumentAdvancedSystem="generateDocumentAdvancedSystem",e.GenerateDocumentAdvancedUser="generateDocumentAdvancedUser",e.GeneratePresentationAdvancedSystem="generatePresentationAdvancedSystem",e.GeneratePresentationAdvancedUser="generatePresentationAdvancedUser",e.GenerateWebpageAdvancedSystem="generateWebpageAdvancedSystem",e.GenerateWebpageAdvancedUser="generateWebpageAdvancedUser",e.ClassifySystem="classifySystem",e.ClassifyUser="classifyUser",e.AddCardSystem="addCardSystem",e.AddCardUser="addCardUser",e.BasicReplyChatSystem="basicReplyChatSystem",e.BasicReplyChatUser="basicReplyChatUser",e.SuggestTextSystem="suggestTextSystem",e.SuggestTextUser="suggestTextUser",e.SuggestThemeSystem="suggestThemeSystem",e.SuggestThemeUser="suggestThemeUser",e.SuggestImagesSystem="suggestImagesSystem",e.SuggestImagesUser="suggestImagesUser",e.RateImagesSystem="rateImagesSystem",e.RateImagesUser="rateImagesUser",e.ReplaceContentSystem="replaceContentSystem",e.ReplaceContentUser="replaceContentUser",e.ChangeAccentImageLayoutSystem="changeAccentImageLayoutSystem",e.ChangeAccentImageLayoutUser="changeAccentImageLayoutUser",e.ChangeContentLayoutSystem="changeContentLayoutSystem",e.ChangeContentLayoutUser="changeContentLayoutUser",e.ChangeContentSystem="changeContentSystem",e.ChangeContentUser="changeContentUser",e.GenerateImagePromptSystem="generateImagePromptSystem",e.GenerateImagePromptUser="generateImagePromptUser",e.Raw="raw",e}({}),ld=function(e){return e.Assistant="assistant",e.System="system",e.User="user",e}({}),lu=function(e){return e.Open="open",e.Closed="closed",e}({}),lc=function(e){return e.Aud="AUD",e.Brl="BRL",e.Cad="CAD",e.Cny="CNY",e.Eur="EUR",e.Gbp="GBP",e.Idr="IDR",e.Inr="INR",e.Jpy="JPY",e.Krw="KRW",e.Kzt="KZT",e.Mxn="MXN",e.Twd="TWD",e.Usd="USD",e.Vnd="VND",e}({}),lm=function(e){return e.Title="title",e.LastViewed="lastViewed",e.LastEdited="lastEdited",e.Favorited="favorited",e.CreatedTime="createdTime",e.EditedTime="editedTime",e.UpdatedTime="updatedTime",e}({}),lf=function(e){return e.Day="day",e.Week="week",e.Month="month",e.Year="year",e}({}),lp=function(e){return e.Video="video",e.Embed="embed",e.Image="image",e}({}),lg=function(e){return e.Doc="doc",e.Theme="theme",e.Dashboard="dashboard",e}({}),lh=function(e){return e.User="user",e.Doc="doc",e.Channel="channel",e}({}),lb=function(e){return e.Asc="asc",e.Desc="desc",e}({}),ly=function(e){return e.Card="card",e.Comment="comment",e.Decoration="decoration",e}({});let lv=(0,n.J1)(s()),lk=(0,n.J1)(d(),lv),lw=(0,n.J1)(u()),lx=(0,n.J1)(c()),lS=(0,n.J1)(m()),lA=(0,n.J1)(f()),lC=(0,n.J1)(p());(0,n.J1)(g());let lz=(0,n.J1)(h());(0,n.J1)(b());let lI=(0,n.J1)(y()),lj=(0,n.J1)(v()),lF=(0,n.J1)(k()),lB=(0,n.J1)(w(),lF),lR=(0,n.J1)(x(),lj,lB),l_=(0,n.J1)(S()),lM=(0,n.J1)(A()),lE=(0,n.J1)(C(),l_,lM),lT=(0,n.J1)(z(),l_,lE,lM),lO=(0,n.J1)(I()),lP=(0,n.J1)(j()),lN=(0,n.J1)(F()),lD=(0,n.J1)(B()),lL=(0,n.J1)(R()),lW=(0,n.J1)(_(),lM);(0,n.J1)(M(),l_),(0,n.J1)(E(),lE);let lU=(0,n.J1)(T(),lM);(0,n.J1)(O(),lM),(0,n.J1)(P()),(0,n.J1)(N());let lG=(0,n.J1)(D()),lH=(0,n.J1)(L(),lj),lV=(0,n.J1)(W(),lH),lq=(0,n.J1)(U());(0,n.J1)(G());let lK=(0,n.J1)(H());function lJ(e){let t={...lo,...e};return o.n(lK,t)}let l$=(0,n.J1)(V()),lQ=(0,n.J1)(q()),lY=((0,n.J1)(K(),lk),(0,n.J1)(J(),lk),(0,n.J1)($(),lv),(0,n.J1)(Q(),lv),(0,n.J1)(Y(),lk),(0,n.J1)(X(),lk),(0,n.J1)(Z()),(0,n.J1)(ee()),(0,n.J1)(et()),(0,n.J1)(el()),(0,n.J1)(ea())),lX=((0,n.J1)(en()),(0,n.J1)(eo(),lB),(0,n.J1)(ei()),(0,n.J1)(er(),lw),(0,n.J1)(es(),lw),(0,n.J1)(ed(),lw),(0,n.J1)(eu(),lw),(0,n.J1)(ec(),lw),(0,n.J1)(em(),lw),(0,n.J1)(ef(),lx),(0,n.J1)(ep()));function lZ(e){let t={...lo,...e};return o.n(lX,t)}(0,n.J1)(eg());let l0=(0,n.J1)(eh(),lx);function l1(e){let t={...lo,...e};return i.I(l0,t)}let l2=(0,n.J1)(eb(),lx);function l6(e){let t={...lo,...e};return i.I(l2,t)}let l4=(0,n.J1)(ey(),lx);function l5(e){let t={...lo,...e};return i.I(l4,t)}(0,n.J1)(ev()),(0,n.J1)(ek()),(0,n.J1)(ew());let l3=(0,n.J1)(ex(),lC,lA);function l8(e){let t={...lo,...e};return r._(l3,t)}let l7=(0,n.J1)(eS(),lS);function l9(e){let t={...lo,...e};return i.I(l7,t)}(0,n.J1)(eA(),lz),(0,n.J1)(eC(),lI),(0,n.J1)(ez()),(0,n.J1)(eI()),(0,n.J1)(ej(),lR),(0,n.J1)(eF()),(0,n.J1)(eB()),(0,n.J1)(eR()),(0,n.J1)(e_()),(0,n.J1)(eM()),(0,n.J1)(eE()),(0,n.J1)(eT()),(0,n.J1)(eO()),(0,n.J1)(eP()),(0,n.J1)(eN(),lR),(0,n.J1)(eD(),lR),(0,n.J1)(eL(),lj),(0,n.J1)(eW(),lB),(0,n.J1)(eU()),(0,n.J1)(eG(),lR),(0,n.J1)(eH()),(0,n.J1)(eV()),(0,n.J1)(eq()),(0,n.J1)(eK()),(0,n.J1)(eJ()),(0,n.J1)(e$()),(0,n.J1)(eQ(),lB),(0,n.J1)(eY(),lB),(0,n.J1)(eX(),lB),(0,n.J1)(eZ(),lB),(0,n.J1)(e0(),lB),(0,n.J1)(e1(),lB);let ae=(0,n.J1)(e2(),lB);function at(e){let t={...lo,...e};return i.I(ae,t)}(0,n.J1)(e6(),lB),(0,n.J1)(e4(),lB);let al=(0,n.J1)(e5());function aa(e){let t={...lo,...e};return i.I(al,t)}let an=(0,n.J1)(e3()),ao=(0,n.J1)(e8()),ai=(0,n.J1)(e7()),ar=((0,n.J1)(e9()),(0,n.J1)(te()),(0,n.J1)(tt()),(0,n.J1)(tl()),(0,n.J1)(ta()),(0,n.J1)(tn()),(0,n.J1)(to()),(0,n.J1)(ti()),(0,n.J1)(tr()),(0,n.J1)(ts()),(0,n.J1)(td()),(0,n.J1)(tu()));function as(e){let t={...lo,...e};return i.I(ar,t)}(0,n.J1)(tc(),lO,lP),(0,n.J1)(tm(),lO,lP),(0,n.J1)(tf(),lO),(0,n.J1)(tp(),lT,lM,lB,lO,lP,lD,lN,lL),(0,n.J1)(tg()),(0,n.J1)(th(),lN,lO,lD,lP,lB,lM,lT),(0,n.J1)(tb()),(0,n.J1)(ty()),(0,n.J1)(tv()),(0,n.J1)(tk(),lB),(0,n.J1)(tw());let ad=(0,n.J1)(tx(),l_,lE,lM);function au(e){let t={...lo,...e};return o.n(ad,t)}let ac=(0,n.J1)(tS());function am(e){let t={...lo,...e};return o.n(ac,t)}let af=(0,n.J1)(tA());function ap(e){let t={...lo,...e};return o.n(af,t)}let ag=(0,n.J1)(tC());function ah(e){let t={...lo,...e};return o.n(ag,t)}let ab=(0,n.J1)(tz(),lM);function ay(e){let t={...lo,...e};return o.n(ab,t)}let av=(0,n.J1)(tI(),lM);function ak(e){let t={...lo,...e};return o.n(av,t)}(0,n.J1)(tj()),(0,n.J1)(tF()),(0,n.J1)(tB()),(0,n.J1)(tR()),(0,n.J1)(t_()),(0,n.J1)(tM()),(0,n.J1)(tE()),(0,n.J1)(tT()),(0,n.J1)(tO()),(0,n.J1)(tP()),(0,n.J1)(tN());let aw=(0,n.J1)(tD());function ax(e){let t={...lo,...e};return o.n(aw,t)}(0,n.J1)(tL(),lH),(0,n.J1)(tW(),lV),(0,n.J1)(tU(),lH),(0,n.J1)(tG(),lH),(0,n.J1)(tH()),(0,n.J1)(tV()),(0,n.J1)(tq()),(0,n.J1)(tK()),(0,n.J1)(tJ(),lH),(0,n.J1)(t$(),lq),(0,n.J1)(tQ(),lq),(0,n.J1)(tY(),lq),(0,n.J1)(tX(),lq),(0,n.J1)(tZ(),lq),(0,n.J1)(t0(),lq),(0,n.J1)(t1(),lq),(0,n.J1)(t2(),lq),(0,n.J1)(t6(),lq),(0,n.J1)(t4(),lq),(0,n.J1)(t5()),(0,n.J1)(t3()),(0,n.J1)(t8()),(0,n.J1)(t7()),(0,n.J1)(t9()),(0,n.J1)(le()),(0,n.J1)(lt()),(0,n.J1)(ll()),(0,n.J1)(la()),(0,n.J1)(ln())},91559:(e,t,l)=>{"use strict";l.d(t,{u:()=>r});var a=l(31757),n=l(65998),o=l(5720),i=l(88957);function r(){let e=(0,n.u)("offlineTest"),{online:t}=(0,i.GV)(a.mN),l=(0,i.GV)(o.yy);return e?{isConnected:!1,isInOfflineMode:l}:{isConnected:t,isInOfflineMode:l&&!t}}},77914:(e,t,l)=>{"use strict";let a;l.d(t,{eON:()=>D.eON,mc:()=>D.mc,VDI:()=>D.VDI,EB6:()=>D.EB6,SjR:()=>D.SjR,lgx:()=>D.lgx,U$g:()=>D.U$g,JhL:()=>D.JhL,vY2:()=>D.vY2,pfv:()=>D.pfv,Vd7:()=>D.Vd7,zut:()=>D.zut,rWX:()=>D.rWX,nXf:()=>D.nXf,UEL:()=>D.UEL,Tyz:()=>D.Tyz,yKx:()=>D.yKx,soQ:()=>D.soQ,b2u:()=>D.b2u,H4n:()=>N,nkJ:()=>D.nkJ,GQw:()=>D.GQw,eRM:()=>D.eRM,D7K:()=>D.D7K,AZr:()=>D.AZr,b_w:()=>D.b_w,N3Q:()=>D.N3Q,Snx:()=>D.Snx,abJ:()=>D.abJ,Gc5:()=>D.Gc5,utY:()=>G.u,Ekg:()=>D.Ekg,eaJ:()=>D.eaJ,eXh:()=>D.eXh,SzF:()=>D.SzF,DNM:()=>D.DNM,roT:()=>D.roT});var n=l(16692),o=l(87105),i=l(93978),r=l(8301),s=l(69011),d=l.n(s);l(14041);var u=l(73893);l(27132);var c=l(41263),m=l.n(c),f=l(52103),p=l.n(f),g=l(73450),h=l.n(g),b=l(46123),y=l.n(b);let v=(e,t)=>{for(let l in e){let a=e[l];if("ROOT_QUERY"===l)for(let e in a)t("".concat(l,".").concat(e),a[e]);else t(l,a)}};class k{async write(){return Promise.all([this.db.writeNormalizedCache(this.cache),this.db.writeCacheTimes(this.cacheTimes)])}async load(){return Promise.all([this.db.getNormalizedCache().then(e=>{this.cache=e?{...e,ROOT_QUERY:e.ROOT_QUERY?e.ROOT_QUERY:{}}:{ROOT_QUERY:{}}}),this.db.getCacheTimes().then(e=>{console.debug("offlineMode - [MergeCacheOperation] loaded cache times",e),this.cacheTimes=e})]).then(()=>{})}async merge(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};await this.loaded;let l=[];return v(e,(e,t)=>{this.has(e)||l.push(e),this.set(e,t)}),console.debug("[ApolloOfflineCache] merged offline <- online cache ",{newEntries:l,expiredKeys:t.expireEntries?this.expireEntries():null}),this.cache}expireEntries(){let e=Date.now(),t=[];return v(this.cache,l=>{let a=this.cacheTimes[l];a&&a+this.ttl{this.del(e)}),t}has(e){return p()(this.cache,e)}set(e,t){m()(this.cache,e,t),this.cacheTimes[e]=Date.now()}get(e){return y()(this.cache,e)}del(e){h()(this.cache,e),delete this.cacheTimes[e]}constructor(e,t=12096e5){this.db=e,this.ttl=t,this.loaded=this.load()}}class w{async initDB(){if(!this.isIndexedDBAvailable()){u.$.IS_CLIENT_SIDE&&console.warn("IndexedDB is not available. Falling back to no-op implementation.");return}return new Promise((e,t)=>{let l=indexedDB.open(this.dbName,1);l.onerror=()=>{console.error("Error opening IndexedDB"),t()},l.onsuccess=t=>{this.db=t.target.result,e()},l.onupgradeneeded=e=>{e.target.result.createObjectStore(this.storeName)}})}isIndexedDBAvailable(){return"undefined"!=typeof indexedDB}async getObjectStore(e){return(await this.initPromise,this.db)?this.db.transaction([this.storeName],e).objectStore(this.storeName):null}async getItem(e){if(!this.isIndexedDBAvailable())return null;let t=await this.getObjectStore("readonly");return t?new Promise(l=>{let a=t.get(e);a.onsuccess=()=>l(a.result),a.onerror=()=>l(null)}):null}async setItem(e,t){if(!this.isIndexedDBAvailable())return;let l=await this.getObjectStore("readwrite");if(l)return new Promise((a,n)=>{let o=l.put(t,e);o.onsuccess=()=>a(),o.onerror=()=>n()})}async removeItem(e){if(!this.isIndexedDBAvailable())return;let t=await this.getObjectStore("readwrite");if(t)return new Promise(l=>{let a=t.delete(e);a.onsuccess=()=>l(),a.onerror=()=>l()})}constructor(e="ApolloCache",t="data"){this.dbName=e,this.storeName=t,this.db=null,this.initPromise=this.initDB()}}class x{async getCacheTimes(){return await this.db.getItem(this.cacheTimesKey)||{}}async getNormalizedCache(){return await this.db.getItem(this.key)||{ROOT_QUERY:{}}}async writeNormalizedCache(e){return this.db.setItem(this.key,e)}async writeCacheTimes(e){return this.db.setItem(this.cacheTimesKey,e)}async purge(){return Promise.all([this.db.removeItem(this.key),this.db.removeItem(this.cacheTimesKey)]).then(()=>{})}constructor(){this.key="apollo-offline-cache",this.cacheTimesKey="cache-times",this.db=new w("ApolloCache_v2","data")}}var S=l(36832);class A extends S.b{}let C=e=>{let{cache:t}=e,l=new A,a=t.write,n=t.evict,o=t.modify,i=t.gc;return t.write=e=>{let n=a.call(t,e);return l.emit("write",{input:e}),n},t.evict=e=>{let a=n.call(t,e);return l.emit("evict",{input:e}),a},t.modify=e=>{let a=o.call(t,e);return l.emit("modify",{input:e}),a},t.gc=()=>{let e=i.call(t);return l.emit("gc",{}),e},{emitter:l,uninstall:()=>{t.write=a,t.evict=n,t.modify=o,t.gc=i}}};class z{pause(){this.clearTimeout(),this.paused=!0}resume(){this.paused=!1}uninstall(){this.cleanup&&this.cleanup()}fire(){if(this.paused)return;this.clearTimeout();let e=this.opts.debounce||1e3;this.timeout=setTimeout(()=>this.persist(),e)}persist(){this.paused||this.opts.onPersist(this.opts.cache.extract())}clearTimeout(){null!=this.timeout&&(clearTimeout(this.timeout),this.timeout=null)}constructor(e){this.opts=e,this.timeout=null,this.paused=!1;let{emitter:t,uninstall:l}=C({cache:e.cache});t.on("write",()=>this.fire()),t.on("evict",()=>this.fire()),t.on("modify",()=>this.fire()),t.on("gc",()=>this.fire()),this.cleanup=()=>{l(),this.cleanup=null,this.paused=!0,this.emitter&&(this.emitter.off("write"),this.emitter.off("evict"),this.emitter.off("modify"),this.emitter.off("gc"),this.emitter=null)},this.emitter=t}}var I=l(88957),j=l(5720);class F{async setClient(e){if(this.apolloClient){console.warn("offlineMode - [ApolloOfflineCache] already has a client");return}this.apolloClient=e,this.resolveClientReady(e)}async enable(){let e=await this.clientReady;this.trigger=new z({cache:e.cache,onPersist:async e=>this.writeCache(e),debounce:1e3})}async disable(){var e;console.debug("offlineMode - [ApolloOfflineCache] Disabling ApolloOfflineCache"),this.trigger&&(console.debug("offlineMode - [ApolloOfflineCache] Purging ApolloOfflineCache"),this.db.purge(),null===(e=this.trigger)||void 0===e||e.uninstall(),this.store.dispatch((0,j.MN)()),this.trigger=null)}async useOfflineCache(){var e;let t=await this.clientReady;if(this.usingOfflineCache)return;this.usingOfflineCache=!0,this.savedCache=t.cache.extract(),null===(e=this.trigger)||void 0===e||e.pause();let l=new k(this.db),a=await l.merge(this.savedCache);console.debug("offlineMode - [ApolloOfflineCache] Using offline cache PAUSING -- restoring cache",a),t.cache.restore(a)}async backOnline(){var e;if(!this.usingOfflineCache)return;let t=await this.clientReady;console.debug("offlineMode - [ApolloOfflineCache] Back online"),t.cache.restore(this.savedCache),this.savedCache=null,null===(e=this.trigger)||void 0===e||e.resume(),this.usingOfflineCache=!1}async writeCache(e){let t=performance.now(),l=new k(this.db),a=await l.merge(e,{expireEntries:!0});await l.write(),console.debug("offlineMode - [ApolloOfflineCache] wrote cache in ",Math.round(performance.now()-t),"ms",a)}async gc(){if(!this.apolloClient)throw Error("Cannot gc(), apollo client not set");this.apolloClient.cache.gc()}async debug(){return{client:this.apolloClient}}constructor(){this.store=(0,I.KA)(),this.trigger=null,this.apolloClient=null,this.savedCache=null,this.usingOfflineCache=!1,this.clientReady=new Promise(e=>{this.resolveClientReady=e}),this.db=new x}}d()(()=>new F),l(95564);var B=l(97104);let R=e=>null==e,_=(e,t,l)=>{let{mergeObjects:a}=l;return R(t)?e:a(e,t)},M=(e,t)=>R(t)&&void 0!==e?e:t,E=(e,t)=>void 0!==t||void 0===e?t:e,T=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e,t)=>e("id",t);return function(){let l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],{readField:n,mergeObjects:o,fieldName:i}=arguments.length>2?arguments[2]:void 0,r=Object.create(null);return a?(l&&l.forEach((e,l)=>{r[t(n,e)]=l}),a.reduce((l,a)=>{let i=t(n,a),s=r[i],d=n("deleted",a),u=e&&n("archived",a),c=d||u;return"number"==typeof s?c?l[s]=null:l[s]=o(l[s],a):c||(r[i]=l.length,l.push(a)),l},l?[...l]:[]).filter(Boolean)):l}},O={typePolicies:{Channel:{fields:{name:{merge:_},slug:{merge:_},isMember:{merge:_},memberCount:{merge:_},members:{merge:M},createdTime:{merge:_},updatedTime:{merge:_},activity:{merge:_}}},Comment:{fields:{createdTime:{merge:_},user:{merge:_},content:{merge:_},commentId:{merge:_},updatedTime:{merge:_},reactions:{merge:T(!1,(e,t)=>e("emoji",t))},replies:{merge:T(!0)},targetId:{merge:_},targetHtml:{merge:_},targetText:{merge:_},status:{merge:M}}},Doc:{fields:{accessLinks:{merge:M},archived:{merge:_},cards:{merge:T(!0)},channels:{merge:M},collaborators:{merge:M},comments:{merge:T(!0)},createdBy:{merge:_},createdTime:{merge:_},currentSnapshotId:{merge:E},currentSnapshot:{merge:_},docUser:{merge:E},editedTime:{merge:_},editors:{merge:T(!0,(e,t)=>{let l=e("user",t);return e("id",l)})},invitations:{merge:M},links:{merge:T(!0,(e,t)=>e("url",t))},organization:{merge:_},orgAccess:{merge:E},publishedTime:{merge:E},publishedSnapshotId:{merge:E},reactions:{merge:T(!1,(e,t)=>{let l=e("targetId",t),a=e("emoji",t);return"".concat(a,":").concat(l)})},sites:{merge:M},theme:{merge:M},title:{merge:M},titleCard:{merge:_},titleEdited:{merge:_},updatedTime:{merge:_}}},Card:{fields:{title:{merge:M},text:{merge:M},comments:{merge:T(!0)}}},Font:{fields:{fontFiles:{merge:E}}},Organization:{fields:{invitations:{merge:M}}},Site:{fields:{archived:{merge:M},name:{merge:M},faviconUrl:{merge:E},currentDeployment:{merge:M},domains:{merge:E},routes:{merge:E},themeId:{merge:M},theme:{merge:M}}},Theme:{fields:{name:{merge:_},fonts:{merge:M},headingFont:{merge:E},bodyFont:{merge:E},headingFontWeight:{merge:E},bodyFontWeight:{merge:E},accentColor:{merge:E},logoUrl:{merge:E},config:{merge:M},createdTime:{merge:_},updatedTime:{merge:_},archived:{merge:_},previewUrl:{merge:_}}},Query:{fields:{channels:{merge:T(!0)},workspaceChannels:(0,B.NB)(),channelDocActivity:(0,B.NB)(["channelId"]),docs:(0,B.NB)(["workspaceId","archived","sortBy","createdBy","isPrivate","channelId"]),docCards:{merge:T(!0)},savedMedia:(0,B.NB)(["docId","type","source"]),docGenerations:(0,B.NB)(["workspaceId"]),sites:{merge:T(!0)},snapshots:(0,B.NB)(["docId"]),themes:{merge:T(!1)},workspaceMembers:(0,B.NB)()}}}},P={watchQuery:{fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",returnPartialData:!0,errorPolicy:"all"},query:{fetchPolicy:"cache-first",returnPartialData:!0,errorPolicy:"all"}},N=()=>a;d()(()=>{let e=(0,n.$)({uri:"".concat(u.$.API_HOST,"/graphql"),credentials:"include"}),t=(0,n.$)({uri:"".concat(u.$.CONTENTFUL_GRAPHQL_ENDPOINT),headers:{Authorization:"Bearer ".concat(u.$.CONTENTFUL_API_TOKEN)}}),l=(0,o.l)(e=>"contentfulGraphql"===e.getContext().clientName,t,e);return new i.R({link:l,defaultOptions:P,cache:new r.D(O)})});var D=l(55640);l(88808),l(31085);let L=[];console.warn,e=>{L.some(t=>t(e))||console.error(e)};var W=l(93518);let U=new W.Configuration({basePath:"".concat(u.$.API_HOST),credentials:"include"});new W.OrganizationsApi(U);var G=l(91559)},55278:(e,t,l)=>{"use strict";l.d(t,{Us:()=>o,h6:()=>i}),l(14041);var a=l(73893);l(77914);var n=l(83479);l(60490),l(62849);let o=()=>{if(""===a.$.SHARE_TOKEN)return;let{searchParams:e}=new URL(window.location.href);e.delete("token");let t=Object.fromEntries(e.entries());(0,n.g5)({query:t})},i=(e,t)=>{var l;if(!e||t)return null;let n=null==e?void 0:null===(l=e.accessLinks)||void 0===l?void 0:l.find(e=>e.token===a.$.SHARE_TOKEN);return n&&n.permission?n:null}},8178:(e,t,l)=>{"use strict";l.d(t,{v:()=>g,W:()=>h});var a=l(73893),n=l(77914);let o=()=>{window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"sign_up_complete"})};var i=l(67238),r=l(56233),s=l(69087),d=l(10458),u=l(6874);let c=e=>{let{data:t,redirectTo:l}=e,a=l||"/";if(t){let{newWorkspace:e}=t;e&&(a="/create")}return a},m=e=>{if(!e)return;let{userId:t,workspaceId:l}=e;d.zS.identify(t,{user_org_id:l,anonymous_user:!1,gamma_user_id:t})},f=(e,t)=>(0,n.H4n)().mutate({mutation:n.soQ,variables:{input:{id:e,referrer:t}}}),p=()=>{let e=(0,i.H)(),t=(0,u.qU)({set:{locale:e}});return(0,n.H4n)().mutate({mutation:n.b2u,variables:{patch:t}})},g=e=>{let{redirectTo:t,data:l,doneCallback:a,shouldClientSideRedirect:n=!1,googleMethod:o}=e,i=(0,s.g)().get();if(m(l),d.zS.track(d.VV.LOGIN,{provider:"google",extra:{googleMethod:o}},{context:i}),!t&&a){a();return}n&&(window.location.href=t||"/")},h=e=>{let{data:t,doneCallback:l,redirectTo:n,shouldClientSideRedirect:u=!1,googleMethod:g}=e,h=(0,s.g)().get();m(t);let b=new Promise(e=>{d.zS.track(d.VV.SIGNUP,{flow:null==t?void 0:t.signupFlow,provider:"google",extra:{googleMethod:g}},{context:h},e),(0,r.jb)({flow:null==t?void 0:t.signupFlow,provider:"google",googleMethod:g}),o()}),y=null==t?void 0:t.userId,v=y&&a.$.IS_USER_TESTING_SESSION?f(y,"USER_TESTING"):Promise.resolve();y&&(0,i._Y)()&&p();let k=n||"/",w=null==t?void 0:t.isFirstWorkspace;if(!n&&l&&!w){l();return}if(w&&t){if(l){l();return}k=c({data:t,redirectTo:n})}Promise.all([v,b]).then(()=>{u&&(window.location.href=k)})}},79430:(e,t,l)=>{"use strict";l.d(t,{AH:()=>o,EM:()=>n});var a=l(73893);l(65998),l(44507);let n=()=>new BroadcastChannel("gamma_app_login"),o=async e=>await fetch("".concat(a.$.API_HOST,"/jwt/generate"),{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({provider:e})}).then(e=>e.text()).catch(t=>{console.warn("[fetchJWT] provider:".concat(e," error"),t)})||void 0},94445:(e,t,l)=>{"use strict";l.d(t,{Ff:()=>m,Iw:()=>c,Ix:()=>u,Lz:()=>i,rd:()=>d});var a=l(8796),n=l(41054);let o=(0,a.Z0)({name:"CardNotes",initialState:{activeNoteCardId:null,isCardNotesPanelOpen:!1,mountEditor:void 0,destroyEditor:void 0},reducers:{resetCardNoteProps:e=>{e.activeNoteCardId=null,e.mountEditor=void 0,e.destroyEditor=void 0},setCardNoteProps:(e,t)=>{let{activeNoteCardId:l,mountEditor:a,destroyEditor:n}=t.payload;e.activeNoteCardId=l||null,e.mountEditor=a,e.destroyEditor=n},setCardNotesPanelOpen:(e,t)=>{e.isCardNotesPanelOpen=t.payload.isOpen}}}),{setCardNoteProps:i,setCardNotesPanelOpen:r,resetCardNoteProps:s}=o.actions,d=(0,n.Mz)(e=>e.CardNotes.activeNoteCardId,e=>e.CardNotes.mountEditor,e=>e.CardNotes.destroyEditor,(e,t,l)=>({activeNoteCardId:e,mountEditor:t,destroyEditor:l})),u=e=>e.CardNotes.activeNoteCardId,c=e=>e.CardNotes.isCardNotesPanelOpen,m=o.reducer},15072:(e,t,l)=>{"use strict";l.d(t,{d:()=>d});var a=l(5377),n=l(46343),o=l.n(n),i=l(88957),r=l(22844),s=l(67397);let d=e=>{let{editor:t,node:l,cardId:n}=e,d=(0,i.GV)((0,r.UZ)(n),function(){for(var e=arguments.length,t=Array(e),l=0;l{"use strict";l.d(t,{E5:()=>d,EB:()=>f,F1:()=>c,Qi:()=>i,UZ:()=>u,cL:()=>r,ow:()=>m,rZ:()=>s});var a=l(8796);let n={cards:[],localCardTextMap:{}},o=(0,a.Z0)({name:"Cards",initialState:n,reducers:{reset:()=>n,setCardText(e,t){window.cardTitleMap?e.localCardTextMap={...e.localCardTextMap,...t.payload.localCardTextMap}:e.localCardTextMap=t.payload.localCardTextMap}}}),{setCardText:i,reset:r}=o.actions,s=e=>Object.values(e.Cards.localCardTextMap),d=e=>{var t;return null===(t=Object.values(e.Cards.localCardTextMap).find(e=>e.isFirstCard))||void 0===t?void 0:t.text},u=e=>t=>{if(e&&t.Cards.localCardTextMap[e])return t.Cards.localCardTextMap[e]},c=e=>t=>{if(e&&t.Cards.localCardTextMap[e])return t.Cards.localCardTextMap[e].title},m=e=>e.Cards.localCardTextMap,f=o.reducer},67397:(e,t,l)=>{"use strict";l.d(t,{mF:()=>u,oZ:()=>d});var a=l(5377),n=l(46108),o=l.n(n);l(12784);var i=l(69e3);l(14041),l(88957);var r=l(19534),s=l(22844);let d=(e,t)=>{let l={};e.state.doc.descendants((t,n)=>{if((0,r.jg)(t)&&t.attrs.id){let o=t.toJSON(),i=(0,a.getCardTitle)(o),r=e.state.doc.resolve(n),s=0===r.parentOffset&&1===r.depth;l[t.attrs.id]={id:t.attrs.id,title:i,text:u(e.schema,o,i),isFirstCard:s}}return!0}),t((0,s.Qi)({localCardTextMap:l}))},u=(e,t,l)=>{try{var n;let r=o()(t),s=(0,a.removeNodesOfType)(r,["cardNotes"]);if(!s)return"";s.content=null===(n=s.content)||void 0===n?void 0:n.map(e=>{if("card"!==e.type)return e;let t=(0,a.getCardTitle)(e);return{type:"paragraph",content:t?[{type:"text",text:t}]:[]}});let d=i.bP.fromJSON(e,s),u=d.textBetween(0,d.content.size,"\n\n",e=>{let t=e.type.name;return a.nodeSerializers[t]&&a.nodeSerializers[t](e)||""});if(l)return(0,a.removeTitle)(u,l);return u}catch(e){return""}}},96362:(e,t,l)=>{"use strict";l.d(t,{M:()=>d});var a=l(2940),n=l.n(a),o=l(1602),i=l.n(o),r=l(42391),s=l(77936);let d=n()(function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"complement",{matchBrightness:a=!1,contrastColor:n,minContrast:o=3}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},d=Array.from(new Set(t));if(0===d.length)return new Map;if(1===d.length){let t=i()(e);return n&&(0,r.vd)(t,n,o),new Map([[d[0],t.toHex8String()]])}return new Map([...(()=>{switch(l){case"monochrome":{let t=i()(e),l={min:15,max:95};if(n){let e=(e,t,l)=>{let a=u(e,t);return(0,r.vd)(a,n,o,l),Math.round(100*a.toHsl().l)};l.min=e(t,l.min,"lighten"),l.max=e(t,l.max,"darken")}let s=(l.max-l.min)/d.length,c=t.getBrightness();return new Map(d.map((e,n)=>{let o=u(t,l.min+s*n);return a&&(0,r.jB)(o,c),[e,o]}))}case"spin":{let t=i()(e),l=t.getBrightness(),n=Math.ceil((d.length-1)/2),o=360/d.length<22?360/d.length:22,u=(0,s.xV)(d.map((e,i)=>{let s=0;in&&(s=(i-n)*o);let d=t.clone().spin(s);return a&&(0,r.jB)(d,l),d}),d.length%2==0?n:n+1);return new Map(d.map((e,t)=>[e,u[t]]))}default:{let t=i()(e),n=180/(d.length-1),o=t.getBrightness();return new Map(d.map((e,i)=>{let s=t.clone().spin(n*i*("complement2"===l?-1:1));return a&&(0,r.jB)(s,o),[e,s]}))}}})().entries()].map(e=>{let[t,l]=e;return[t,l.toHex8String()]}))});function u(e,t){let l=e.toHsl();return l.l=t,i()(l)}},84511:(e,t,l)=>{"use strict";l.d(t,{PH:()=>u,UG:()=>d,XD:()=>f,fA:()=>c,gb:()=>m});var a=l(31085),n=l(60524),o=l(20501),i=l(3040),r=l(24221),s=l(12327);let d=l(22544).D1?0:.25,u={top:0,right:0,bottom:0,left:0},c={monochrome:{label:()=>s.Ru._({id:"VvdC4u"})},spin:{label:()=>s.Ru._({id:"0LFzg9"})},complement:{label:()=>s.Ru._({id:"2HDXEj"})},complement2:{label:()=>s.Ru._({id:"XTxqsS"})}},m="monochrome",f=Object.freeze({pie:{icon:(0,a.jsx)(r.g,{icon:o.W1p}),selectedIcon:(0,a.jsx)(r.g,{icon:i.W1p}),label:()=>s.Ru._({id:"RT6aCN"})},donut:{icon:(0,a.jsxs)(n.B.span,{className:"fa-layers fa-fw",children:[(0,a.jsx)(r.g,{icon:o.xD0}),(0,a.jsx)(r.g,{icon:o.ZPt})]}),selectedIcon:(0,a.jsxs)(n.B.span,{className:"fa-layers fa-fw",children:[(0,a.jsx)(r.g,{icon:i.xD0}),(0,a.jsx)(r.g,{icon:o.ZPt})]}),label:()=>s.Ru._({id:"Cn5cfQ"})},line:{icon:(0,a.jsx)(r.g,{icon:o.gK3}),selectedIcon:(0,a.jsx)(r.g,{icon:i.gK3}),label:()=>s.Ru._({id:"MZW+2G"})},bar:{icon:(0,a.jsx)(r.g,{icon:o.s67}),selectedIcon:(0,a.jsx)(r.g,{icon:i.s67}),label:()=>s.Ru._({id:"EzalDc"})},"horizontal-bar":{icon:(0,a.jsx)(r.g,{icon:o.Mkm}),selectedIcon:(0,a.jsx)(r.g,{icon:i.Mkm}),label:()=>s.Ru._({id:"CeeoKy"})}})},81003:(e,t,l)=>{"use strict";l.d(t,{TD:()=>n,dg:()=>i,pX:()=>r,sA:()=>o});var a=l(99742);function n(e){var t;let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null!==(t=l.id)&&void 0!==t?t:(0,a.Ak)(),o="auto"===l.dismissable?new Date(Date.now()+5e3):l.dismissable;return{type:"addFeedback",payload:{id:n,message:e,severity:l.severity||"info",dismissable:o}}}function o(){for(var e=arguments.length,t=Array(e),l=0;l{"use strict";l.d(t,{uR:()=>s,en:()=>u});var a=l(31085),n=l(14041),o=l(74505);let i=(e,t)=>{switch(t.type){case"addFeedback":{let l=e.feedback||[];if(l.find(e=>{let{id:l}=e;return l===t.payload.id}))return{...e,feedback:[...l]};return{...e,feedback:[...l,t.payload]}}case"clearFeedback":{let{feedback:t,...l}=e;return{...l}}case"removeFeedback":{let l=e.feedback||[];if(!t.payload.length)return{...e};return{...e,feedback:l.filter(e=>!t.payload.includes(e.id))}}case"reportActiveColumnIds":return{...e,activeColumns:t.payload?[...t.payload]:void 0};case"openContextMenu":return{...e,contextMenu:{isOpen:!0,position:t.payload.position}};case"closeContextMenu":return{...e,contextMenu:{isOpen:!1,position:{x:-1e3,y:-1e3}}};case"setGridFunctions":return{...e,gridFunctions:t.payload};default:(0,o.x)(t)}return e},r={_inContext:!1},s=(0,n.createContext)({state:r,dispatch:()=>{}}),d=e=>{let{children:t}=e,[l,o]=(0,n.useReducer)(i,{...r,_inContext:!0});return(0,a.jsx)(s.Provider,{value:{state:l,dispatch:o},children:t})},u=e=>t=>(0,a.jsx)(d,{children:(0,a.jsx)(e,{...t})})},74207:(e,t,l)=>{"use strict";l.d(t,{n:()=>i});var a=l(919),n=l(83377),o=l(98736);class i{get type(){return this._type}updateType(e,t){let{type:l,format:a="raw"}=t;if(l===this._type&&this.format===a)return;let n=this.getCells(e),i=n.map(e=>e.textValue),r=this.format;this.format=a,this._type=l,n.forEach((t,l)=>{let a=e.getRow(t.position.row);if(!a)throw Error("Row=".concat(a," not found"));let n=e.setEmptyCell(a,this);if((0,o.Z6)(t)&&(0,o.Z6)(n)){n.textValue=t.textValue;return}if((0,o.Z6)(t)&&(0,o.Hr)(n)&&"raw"===r&&(0,o.Sz)(t.data)){n.textValue="".concat(t.data);return}n.textValue=i[l]})}getCellClass(){switch(this.type){case"label":return n.l;case"data":return a.T}}getCells(e){return e.rows.map(t=>e.getCellOrThrow({row:t.id,column:this.id}))}isEmpty(e){for(let t of e.rows)if(!e.getCellOrThrow({column:this.id,row:t.id}).isEmpty)return!1;return!0}findPosition(e){let t=e.columns.indexOf(this);if(-1===t)throw Error("Column not found in data");return t}constructor(e){this.fixedType=!1;let{id:t,type:l,label:a,format:n,fixedType:i}=(0,o.pO)(e);this.id=t,this._type=l,this.label=a.replaceAll(/\r?\n?/g,""),this.format=n||"raw",this.fixedType=i||!1}}},10541:(e,t,l)=>{"use strict";l.d(t,{h:()=>s});var a=l(78647),n=l(74207),o=l(25841),i=l(34408),r=l(98736);class s{get columns(){return this._columns}get rows(){return this._rows}get cells(){return this._rows.flatMap(e=>this.columns.map(t=>this._cells[e.id][t.id]))}getColumn(e){return this.columnsIndex.get(e)}getRow(e){return this.rowsIndex.get(e)}getLines(e){return this["".concat(e,"s")]}getCell(e){var t;let{row:l,column:a}=e;return null===(t=this._cells[l])||void 0===t?void 0:t[a]}getCellAtIndex(e){let{row:t,column:l}=e;if(t>=this._rows.length||l>=this._columns.length)throw Error("Index out of bounds");let a=this._rows[t].id,n=this._columns[l].id;return this.getCellOrThrow({row:a,column:n})}isEmpty(){for(let e of this.columns)if(!e.isEmpty(this))return!1;return!0}canAddColumn(){return this.columns.lengthe.id===t),o=this._rows.findIndex(e=>e.id===l);if(!(n<0)&&!(o<0))return{row:o,column:n}}findCellIndexOrThrow(e){let t=this.findCellIndex(e);if(!t)throw Error("Cell not found");return t}getCellOrThrow(e){let t=this.getCell(e);if(!t)throw Error("Cell not found");return t}addEmptyColumn(){let{type:e="data",format:t="raw"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0,a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!a&&this._columns.length>=i.i)return null;let o=new n.n({type:e,format:t,label:""});for(let e of this._rows)this.setEmptyCell(e,o);switch(l){case void 0:this._columns.push(o);break;case 0:this._columns.unshift(o);break;default:this._columns.splice(l,0,o)}return this.columnsIndex.set(o.id,o),o}addEmptyRow(e,t){if(!t&&this._rows.length>=i.W)return null;let l=new o.N({});for(let e of this._columns)this.setEmptyCell(l,e);switch(e){case void 0:this._rows.push(l);break;case 0:this._rows.unshift(l);break;default:this._rows.splice(e,0,l)}return this.rowsIndex.set(l.id,l),l}deleteColumns(e){let t=Object.fromEntries(e.map(e=>[e,!0]));for(let l of(this._columns=this._columns.filter(e=>{let{id:l}=e;return!t[l]||(this.columnsIndex.delete(l),!1)}),Object.values(this._cells)))for(let t of e)delete l[t];0===this._columns.length&&this.addEmptyColumn()}deleteRows(e){let t=Object.fromEntries(e.map(e=>[e,!0]));this._rows=this._rows.filter(e=>{let{id:l}=e;return!t[l]||(this.rowsIndex.delete(l),delete this._cells[l],!1)}),0===this._rows.length&&this.addEmptyRow()}deleteLines(e,t){switch(e){case"row":return this.deleteRows(t);case"column":return this.deleteColumns(t)}}moveRows(e,t){this.moveLines(e,t,"rows")}moveColumns(e,t){this.moveLines(e,t,"columns")}setEmptyCell(e,t){let l=new(t.getCellClass())({row:e,column:t});return this.setCell(l),l}clone(){let e=s.createEmpty(this.columns.length,this.rows.length);return this.columns.forEach((t,l)=>{e.columns[l].label=this.columns[l].label,e.columns[l].updateType(e,{type:t.type,format:t.format}),this.rows.forEach((t,a)=>{e.getCellAtIndex({row:a,column:l}).textValue=this.getCellAtIndex({row:a,column:l}).textValue})}),e}moveLines(e,t,l){let a="_".concat(l),n=this[a].findIndex(t=>{let{id:l}=t;return l===e[0]});if(-1===n)throw Error("".concat(l,"=").concat(e[0]," not found"));n!==t&&(0,r.al)(this[a],{fromIx:n,toIx:t,count:e.length})}set columns(e){this._columns=e,this.indexColumns(),e&&0!==e.length||this.addEmptyColumn()}set rows(e){this._rows=e,this.indexRows(),e&&0!==e.length||this.addEmptyRow()}set cells(e){for(let t of(this._cells={},e)){let{row:e,column:l}=t.position;if(!this.getColumn(l)){console.error("Column=".concat(l," not found"));continue}if(!this.getRow(e)){console.error("Row=".concat(e," not found"));continue}this.setCell(t)}this._rows.forEach(e=>{this._columns.forEach(t=>{var l;(null===(l=this._cells[e.id])||void 0===l?void 0:l[t.id])||(console.warn("missing cell",e.id,t.id),this.setEmptyCell(e,t))})})}setCell(e){let{row:t,column:l}=e.position;this._cells[t]||(this._cells[t]={}),this._cells[t][l]=e}indexColumns(){this.columnsIndex=(0,r.wQ)(this._columns,"id")}indexRows(){this.rowsIndex=(0,r.wQ)(this._rows,"id")}static createEmpty(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(e<=0||t<=0)throw RangeError("must have at least one column and row");let a=new s;for(let t=0;t{"use strict";l.d(t,{K:()=>n});var a=l(10541);class n{get data(){if(this._data)return this._data;let e=this.findIndices();if(e.labelsOnly){let t=this.source.columns.slice(e.from.column,e.to.column+1);return new a.h({columns:t,rows:[],cells:[]})}let t=this.source.rows.slice(e.from.row,e.to.row+1),l=this.source.columns.slice(e.from.column,e.to.column+1),n=t.flatMap(e=>l.map(t=>this.source.getCell({row:e.id,column:t.id}))).filter(e=>!!e);return new a.h({rows:t,columns:l,cells:n})}clear(){let e=this.findIndices(),{rows:t,columns:l}=this.source;for(let a=e.from.column;a<=e.to.column;a++){let n=l[a];if(this.includesLabels&&(n.label=""),!e.labelsOnly)for(let l=e.from.row;l<=e.to.row;l++){let e=t[l],a=this.source.getCell({row:e.id,column:n.id});a?a.clear():this.source.setEmptyCell(e,n)}}}includes(e){if("isLabel"in e)return this.includesLabelCell(e.column);let t=this.findIndices(),l=this.source.findCellIndex(e);return!!l&&!t.labelsOnly&&t.from.row<=l.row&&t.to.row>=l.row&&t.from.column<=l.column&&t.to.column>=l.column}includesLabelCell(e){if(!this.includesLabels)return!1;let t=this.source.columns.findIndex(t=>{let{id:l}=t;return l===e});if(t<0)return!1;let l=this.findIndices();return l.from.column<=t&&l.to.column>=t}findIndices(){let{rows:e,columns:t}=this.source,l=t.findIndex(e=>{let{id:t}=e;return t===this.from.column}),a=t.findIndex(e=>{let{id:t}=e;return t===this.to.column});if(!this.to.row)return{from:{column:l},to:{column:a},labelsOnly:!0};let n=e.findIndex(e=>{let{id:t}=e;return t===this.from.row}),o=e.findIndex(e=>{let{id:t}=e;return t===this.to.row});if(-1!==[n,o,l,a].indexOf(-1))throw Error("Invalid range");return{from:{row:n,column:l},to:{row:o,column:a},labelsOnly:!1}}static nonEmpty(e){function t(t){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=e.getLines(t);for(let t=l?a.length-1:0;t!==(l?-1:a.length);l?t--:t++){let l=a[t];if(!l.isEmpty(e))return l}return null}let l=t("row"),a=t("row",!0),n=t("column"),o=t("column",!0);return l&&a&&n&&o?new this(e,{row:l.id,column:n.id},{row:a.id,column:o.id},!0):null}constructor(e,t,l,a=!1){this.source=e,this.from=t,this.to=l,this.includesLabels=a,this._data=void 0}}},25841:(e,t,l)=>{"use strict";l.d(t,{N:()=>n});var a=l(98736);class n{getCells(e){return e.columns.map(t=>e.getCellOrThrow({row:this.id,column:t.id}))}isEmpty(e){for(let t of e.columns)if(!e.getCellOrThrow({row:this.id,column:t.id}).isEmpty)return!1;return!0}constructor(e){this.id=(0,a.pO)(e).id}}},78647:(e,t,l)=>{"use strict";l.d(t,{p:()=>a});class a{get isEmpty(){return!1}get hasError(){return!1}get position(){return{row:this.row.id,column:this.column.id}}get key(){return"".concat(this.row.id,":").concat(this.column.id)}constructor({row:e,column:t}){this.row=e,this.column=t}}},919:(e,t,l)=>{"use strict";l.d(t,{T:()=>o});var a=l(4220),n=l(78647);class o extends n.p{get data(){return this._data}set data(e){if(isNaN(e)){this._isEmpty=!0,this._data=0;return}this.invalidValue=null,this._isEmpty=!1,this._data=e}get isEmpty(){return this._isEmpty}get hasError(){return null!==this.invalidValue}get textValue(){return this.invalidValue?this.invalidValue:this._isEmpty?"":this.getFormatter().format(this.data)}set textValue(e){let t=this.getFormatter().parse("".concat(null!=e?e:""),!0);null===t&&(this.invalidValue=e),this.data=null!=t?t:Number.NaN}clear(){this._isEmpty=!0,this._data=0,this.invalidValue=null}getFormatter(){return a.u.get(this.column.format)||a.u.get("raw")}setupInitialData(e){0===e.data&&e.isEmpty?(this._isEmpty=!0,this._data=0,e.invalidValue&&(this.invalidValue=e.invalidValue)):this.data=e.data}constructor(e,t){super(e),this.type="data",this._data=0,this._isEmpty=!0,this.invalidValue=null,t&&this.setupInitialData(t)}}},83377:(e,t,l)=>{"use strict";l.d(t,{l:()=>n});var a=l(78647);class n extends a.p{get isEmpty(){return""===this.label}get textValue(){return this.label}set textValue(e){this.label="".concat(null!=e?e:"").replaceAll(/\r?\n?/g,"")}clear(){this.label=""}setupInitialData(e){this.textValue=e.label}constructor(e,t){super(e),this.type="label",this.label="",t&&this.setupInitialData(t)}}},34408:(e,t,l)=>{"use strict";l.d(t,{W:()=>a,i:()=>n});let a=50,n=5},4220:(e,t,l)=>{"use strict";l.d(t,{u:()=>o});var a=l(98736);let n={type:"raw",parse:e=>{if(!e.match(/^-?[0-9,]*(\.[0-9]+)?$/))return null;let t=Number.parseFloat(e.replaceAll(",",""));return isNaN(t)?null:t},format:e=>new Intl.NumberFormat("en-US").format(e)},o=(0,a.wQ)([{type:"percentage",parse:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=e.match(/^(-?[0-9,]*(?:\.[0-9]+)?)(%)?$/);if(!l||!t&&!l[2])return null;let a=Number.parseFloat(l[1].replaceAll(",",""));return isNaN(a)?null:a},format:e=>"".concat(n.format(e),"%")},{type:"currency",parse:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=e.match(RegExp("^(?:(?-)?(?\\$)?)(?-?[0-9,]*(?:\\.[0-9]+)?)$")),a=null==l?void 0:l.groups;if(!a||!t&&!a.symbol)return null;let n=Number.parseFloat(a.amount.replaceAll(",",""));return isNaN(n)||n<0&&a.minus?null:n*("-"===a.minus?-1:1)},format:e=>{let t=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"});return"".concat(t.format(e))}},n],"type")},50885:(e,t,l)=>{"use strict";l.d(t,{A:()=>d});var a=l(919),n=l(83377),o=l(74207),i=l(10541),r=l(25841),s=l(98736);let d={parse(e){let t=e.columns.map(e=>new o.n(e)),l=e.rows.map(e=>new r.N(e)),d=(0,s.wQ)(t,"id"),u=(0,s.wQ)(l,"id"),c=Object.entries(e.cells).flatMap(e=>{let[t,l]=e;return Object.entries(l).map(e=>{let[l,o]=e;return function(e,t){let{row:l,column:o}=e;switch(t.type){case"label":return new n.l({row:l,column:o},t);case"data":return new a.T({row:l,column:o},t)}}({row:u.get(t),column:d.get(l)},o)})});return new i.h({columns:t,rows:l,cells:c})},serialize(e){let t=e.rows.map(e=>{let{id:t}=e;return{id:t}}),l=e.columns.map(e=>{let{id:t,type:l,label:a,format:n,fixedType:o}=e;return{id:t,type:l,label:a,format:n,fixedType:o}}),o={};for(let t of e.rows)for(let l of e.columns){let i=e.getCell({row:t.id,column:l.id});if(!i)continue;let r=(()=>{if(i instanceof a.T){let{type:e,data:t,isEmpty:l}=i;return{invalidValue:i.hasError&&i.textValue||void 0,isEmpty:l,type:e,data:t}}if(i instanceof n.l){let{type:e,label:t}=i;return{type:e,label:t}}throw Error("Unexpected cell type ".concat(i.type))})();o[t.id]=o[t.id]||{},o[t.id][l.id]=r}return{rows:t,columns:l,cells:o}}}},98736:(e,t,l)=>{"use strict";l.d(t,{Hr:()=>m,Sz:()=>y,Z1:()=>f,Z6:()=>c,aH:()=>p,al:()=>d,pO:()=>s,r4:()=>r,rp:()=>h,wQ:()=>u});var a=l(99742),n=l(919),o=l(83377),i=l(4220);function r(){return(0,a.Ak)(5)}function s(e){var t;let l=null!==(t=e.id)&&void 0!==t?t:r();return{...e,id:l}}function d(e,t){let{fromIx:l,toIx:a,count:n=1}=t;if(n<=0){console.warn("Trying to move ".concat(n," elements"));return}l!==a&&e.splice(a,0,...e.splice(l,n))}function u(e,t){return new Map(e.map(e=>[e[t],e]))}function c(e){return e instanceof n.T}function m(e){return e instanceof o.l}function f(e){return"row"===e?"column":"row"}function p(e,t){let l=e.column,a=l.findPosition(t),n=h(e.textValue,a);return!l.fixedType&&("data"===l.type?((b(e.textValue,a)||e.hasError)&&e.getFormatter().type!==n&&g(n,e.column,t)&&e.column.updateType(t,"label"===n?{type:"label"}:{type:"data",format:n}),!0):!!("label"===l.type&&"label"!==n&&g(n,e.column,t))&&(e.column.updateType(t,{type:"data",format:n}),!0))}function g(e,t,l){let a=t.findPosition(l);return t.getCells(l).every(t=>t.isEmpty||h(t.textValue,a)===e)}function h(e,t){if(b(e,t))return"label";for(let t of i.u.values())if(null!==t.parse(e))return t.type;return"label"}function b(e,t){return!!(0===t&&y(parseInt(e.replaceAll(",",""))))}function y(e){return e%1==0&&e>=1400&&e<=2100}},77936:(e,t,l)=>{"use strict";l.d(t,{us:()=>u,Z7:()=>r,jt:()=>d,Vr:()=>p,OP:()=>f,xV:()=>s,yw:()=>c,jp:()=>m});var a=l(2940),n=l.n(a),o=l(20685),i=l.n(o);let r=n()((e,t,l)=>{let a="__react_svg_text_measurement_id_gamma";l=null!=l?l:document.body;try{let n=document.getElementById(a);if(!n){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.style.width="0",e.style.height="0",e.style.position="absolute",e.style.top="-100%",e.style.left="-100%",(n=document.createElementNS("http://www.w3.org/2000/svg","text")).setAttribute("id",a),e.appendChild(n),l.appendChild(e)}let o=n.ownerSVGElement;o&&o.parentNode&&o.parentNode!==l&&(o.parentNode.removeChild(o),l.appendChild(o)),Object.assign(n.style,t),n.textContent=e;let i=n.getBoundingClientRect();return{width:n.getComputedTextLength(),height:i.height}}catch(e){return null}}),s=(e,t)=>{let l=e.length,a=Array(l);return e.forEach((e,n)=>{a[(n+t)%l]=e}),a},d=e=>e?1:16;function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,l=window.getComputedStyle(e).fontSize;if(!l)return t;let[a,n]=(()=>{let e=l.split(""),a=e.findIndex(e=>e.match(/[a-z]/i));return -1===a?["".concat(t),"px"]:[e.splice(0,a).join(""),e.join("")]})();return"px"!==n.toLowerCase()?t:Number.parseFloat(a)}function c(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=Math.abs(e),n=a%t,o=a-n;return 0===n?e:l*(e<0?-1:1)==-1||0===l&&n2&&void 0!==arguments[2]?arguments[2]:{},{exact:a}=l,o=e.length,r=new Map,s=/\W/,d=-1,u=e,c=0,m=o,f=n()(t);for(;0!==d;){r.set(m,d);let t=Math.floor(Math.abs(m-c)/2);if(0===t){if(a)return!1;if(1===d)return u;if(1===r.get(m-1))return i()(e,{length:m-1,separator:s});return!1}if(c=m,(m+=t*d)>o)return!1;d=f(u=i()(e,{length:m,separator:s}))}return u};function f(e){let t=e.target,l={x:e.clientX,y:e.clientY};if(t instanceof SVGElement){var a,n;t=null!==(n=null===(a=t.ownerSVGElement)||void 0===a?void 0:a.parentElement)&&void 0!==n?n:null}let o=null==t?void 0:t.offsetParent;if(o){let e=o.getBoundingClientRect();l.x-=e.left,l.y-=e.top}return l}let p=n()((e,t)=>{let{fontFamily:l,fontSize:a,fontWeight:n}=t,o={widths:[],heights:[],maxWidth:0,maxHeight:0};return e.length&&e.forEach(e=>{let{width:t,height:i}=r("".concat(e),{fontFamily:l,fontSize:a,fontWeight:n})||{width:0,height:0};o.widths.push(t),o.heights.push(i),t>o.maxWidth&&(o.maxWidth=t),i>o.maxHeight&&(o.maxHeight=i)}),o})},57999:(e,t,l)=>{"use strict";l.d(t,{l:()=>a});let a=new(l(36832)).b},31757:(e,t,l)=>{"use strict";l.d(t,{VZ:()=>r,mN:()=>u});var a=l(8796),n=l(73893);let o=()=>{if(!n.$.IS_CLIENT_SIDE)return{online:!0,navigatorOnline:!0,backgrounded:!1};let e=window.navigator.onLine;return{online:e,navigatorOnline:e,backgrounded:!1}},i=(0,a.Z0)({name:"Connection",initialState:o(),reducers:{resetConnectionState:()=>o(),updateConnectionState:(e,t)=>{for(let l in t.payload){let a=t.payload[l];e[l]=a}}}}),r=i.reducer,{resetConnectionState:s,updateConnectionState:d}=i.actions,u=e=>e.Connection},27132:(e,t,l)=>{"use strict";l(88957),l(31757)},79574:(e,t,l)=>{"use strict";l.d(t,{f:()=>ef});var a=l(31085),n=l(25420),o=l(33023),i=l(31684),r=l(71197),s=l(68572);let d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"ai-credits-modal",t=(0,s.ez)("unlimited_credits"),{lowCreditStatus:l,credits:a,isCreditsReady:n}=(0,r.B9)(),d=(0,i.NZ)(),{onOpen:u,onClose:c,isOpen:m}=(0,o.j)({id:e});return{hasUnlimitedCredits:t,lowCreditStatus:l,credits:a,lowCreditAttributes:d,onAICreditsModalOpen:u,onAICreditsModalClose:c,isAICreditsModalOpen:m,isCreditsReady:n}};var u=l(78776),c=l(69237),m=l(18588),f=l(59742),p=l(57238),g=l(65446),h=l(2600),b=l(61778),y=l(34363),v=l(62313),k=l(80532),w=l(43342),x=l(18658),S=l(74727),A=l(80853),C=l(27670),z=l(3706),I=l(20501),j=l(24221),F=l(95986),B=l(52177),R=l(12327),_=l(14041),M=l(78872),E=l(32202),T=l(43421),O=l(20671),P=l(35687),N=l(76166),D=l(35436);let L=e=>{let{url:t,placeholder:l,isDisabled:n=!1,variant:o="plain",customLabel:i,onClick:r,paddingLeft:s=4,...d}=e,[u,c]=(0,_.useState)(!1),{hasCopied:m,onCopy:f}=(0,M.i)(t),p=(0,_.useRef)(null),g=(0,E.d)(),h="link-copied-toast",b=(0,T.A)({base:!0,sm:!1},{fallback:"sm"});(0,_.useEffect)(()=>{p.current&&u&&(p.current.focus(),p.current.select())},[u]);let y=(0,_.useCallback)(()=>c(!0),[]),v=(0,_.useCallback)(()=>c(!1),[]),k=(0,_.useCallback)(()=>{f(),g.isActive(h)||g({id:h,title:(0,a.jsx)(B.x6,{id:"pQjjYo"}),status:"success",duration:5e3}),null==r||r()},[r,f,g]),w=i||(0,a.jsx)(B.x6,{id:"he3ygx"}),x=!!(b&&void 0!==i),S=(0,a.jsx)(A.$,{isDisabled:n,onClick:k,variant:o,w:"100%",...x?{}:{height:"2rem",margin:2},...n?{opacity:"1 !important",color:"gray.400",_hover:{opacity:"1"},_active:{boxShadow:"0 none"}}:{},children:m?(0,a.jsx)(B.x6,{id:"6V3Ea3"}):w}),C=(0,a.jsx)(O.p,{ref:p,type:"text",variant:"filled",paddingLeft:s,direction:"ltr",value:t,isReadOnly:!0,isDisabled:n,placeholder:l||void 0,onClick:y,onBlur:v,pointerEvents:n?"none":void 0,h:"3rem",...d});return x?(0,a.jsxs)(P.B,{w:"100%",children:[C,S]}):(0,a.jsxs)(N.M,{dir:"ltr",children:[C,(0,a.jsx)(D.t,{h:"3rem",zIndex:1,w:"unset",children:S})]})};var W=l(65998),U=l(23071),G=l(64130),H=l(39286),V=l(43006),q=l(56824),K=l(68984);let J=e=>{let{title:t=(0,a.jsx)(B.x6,{id:"0i4o6E"}),description:l,buttonLabel:o,onOpenCallback:i,onCloseCallback:r,segmentEvent:s,isNarrow:d,...u}=e,c=(0,W.u)("upsellUXEnabled_Pro"),{openUpsellModal:m,product:f}=(0,K.I)(),p={light:{bg:"trueblue.50",bgGradient:"linear-gradient(0deg, var(--chakra-colors-gray-50) 0%, white 100%)",border:"trueblue.200",title:"gray.900",description:"gray.700",borderGradient:"linear-gradient(97deg, #3300D9 -10%, #9D20C9 56.82%, #DF7A6C 120%)"},dark:{bg:"gray.800",bgGradient:"linear-gradient(0deg, var(--chakra-colors-gray-900) 0%, var(--chakra-colors-gray-800) 100%)",border:"trueblue.400",title:"gray.50",description:"gray.100",borderGradient:"linear-gradient(90deg, #3300D9 0%, #9D20C9 57%, #DF7A6C 100%)"}}["light"===(0,q.G6)().colorMode?"light":"dark"];return"pro"!==f&&c?(0,a.jsxs)(n.s,{flex:1,w:"100%",mb:4,p:4,bgGradient:p.bgGradient,position:"relative",flexDirection:d?"column":"row",align:"center",borderRadius:"lg",gap:4,zIndex:1,boxShadow:"md",_before:{content:'""',position:"absolute",inset:0,borderRadius:"lg",border:"".concat(2,"px solid transparent"),background:"".concat(p.borderGradient," border-box"),mask:"linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0)",maskComposite:"subtract",opacity:.7},...u,children:[(0,a.jsxs)(P.B,{flex:2,alignSelf:"stretch",children:[(0,a.jsx)(v.z,{spacing:3,children:(0,a.jsx)(b.E,{color:p.title,fontWeight:"bold",lineHeight:"1.3",children:t})}),(0,a.jsx)(b.E,{color:p.description,fontSize:"md",children:l||(0,a.jsx)(B.x6,{id:"Ah1+bS"})})]}),(0,a.jsx)(P.B,{spacing:1,flex:0,justifyContent:"flex-end",children:(0,a.jsx)(A.$,{variant:"solid",colorScheme:"trueblue",size:"md","data-test-id":"ai-credits-upsell",onClick:()=>{m({onOpenCallback:i,onCloseCallback:r,segmentEvent:s})},children:o||(0,a.jsx)(B.x6,{id:"kwkhPe"})})})]}):null};var $=l(32849),Q=l(10458),Y=l(60490),X=l(92405),Z=l(60353),ee=l(85146),et=l(14892),el=l(84755),ea=l(37586),en=l(58821),eo=l(3601);let ei=e=>{let{onContactUsClick:t,...l}=e,n=(0,W.u)("aiDebits"),o=(0,W.u)("ai-credits").enabled,i=n.generateCard,r=n.wizardCreation,s=n.chatSuggestion,d=n.autocomplete,u=n.generateImage,c=(0,W.u)("aiAutocomplete"),m=(0,W.u)("aiGeneratedImages"),f=(0,W.u)("addCard2");return(0,a.jsxs)(Z.n,{allowMultiple:!0,...l,children:[(0,a.jsx)(er,{accordionLabel:R.Ru._({id:"IVVQ18"}),children:(0,a.jsxs)(ee.Xy,{children:[(0,a.jsxs)(ee.ck,{children:[(0,a.jsx)("strong",{children:(0,a.jsx)(B.x6,{id:"p4u+sD"})})," ",(0,a.jsx)(B.x6,{id:"XSCvWA",values:{aiGeneration:r,GAMMA_ARTIFACT_PROPER_NOUN:H.TP}})]}),f&&(0,a.jsxs)(ee.ck,{children:[(0,a.jsx)("strong",{children:(0,a.jsx)(B.x6,{id:"R8xLRW"})})," ",(0,a.jsx)(B.x6,{id:"M3I7Cf",values:{aiAddCard:i}})]}),(0,a.jsxs)(ee.ck,{children:[(0,a.jsx)("strong",{children:(0,a.jsx)(B.x6,{id:"gPyWmV"})})," ",(0,a.jsx)(B.x6,{id:"8HgQlf",values:{aiEditing:s}}),(0,a.jsx)(B.x6,{id:"bO6EBT"})]}),m&&(0,a.jsxs)(ee.ck,{children:[(0,a.jsx)("strong",{children:(0,a.jsx)(B.x6,{id:"0jmvoW"})})," ",(0,a.jsx)(B.x6,{id:"OY40J+",values:{aiImages:u}})]}),c&&(0,a.jsxs)(ee.ck,{children:[(0,a.jsx)("strong",{children:(0,a.jsx)(B.x6,{id:"eBVeIQ"})})," ",(0,a.jsx)(B.x6,{id:"AJ11w6",values:{aiAutocomplete:d,AUTOCOMPLETE_SLASH_SHORTCUT:eo.g,AUTOCOMPLETE_INPUT_SHORTCUT:eo.H}})]})]})}),o&&(0,a.jsx)(er,{accordionLabel:R.Ru._({id:"1pwdRz"}),children:(0,a.jsx)(B.x6,{id:"AVeiKc",values:{GAMMA_PROPER_NOUN:H.On}})})]})},er=e=>{let{accordionLabel:t,children:l}=e;return(0,a.jsxs)(et.A,{children:[(0,a.jsx)("h2",{children:(0,a.jsxs)(el.J,{px:2,py:2,fontSize:"sm",children:[(0,a.jsx)(k.az,{as:"span",flex:"1",textAlign:"left",fontWeight:500,children:t}),(0,a.jsx)(ea.Q,{})]})}),(0,a.jsx)(en.v,{pb:4,px:2,fontSize:"sm",children:l})]})},es=()=>({friend:{label:R.Ru._({id:"uU68PM"})},teammate:{label:R.Ru._({id:"O/k8gF"})},buy:{label:R.Ru._({id:"/2RIKE"})}}),ed={fontWeight:500,letterSpacing:"normal",color:"gray.600"},eu=e=>{let{isOpen:t,onClose:l,onOpen:n,credits:o,segmentEvent:s=Q.VV.GAMMA_PRO_UPSELL_CALLOUT_AI_CREDITS}=e,d=(0,G.fW)(),{user:u,currentWorkspace:R}=(0,Y.ur)(),M=(0,Y.CX)(),E=(0,W.u)("upsellUXEnabled_Pro"),T=(0,$.ez)("unlimited_credits"),[O,P]=(0,_.useState)(E?"buy":"friend"),N=(0,W.u)("ai-credits"),D=(0,W.u)("intercom"),q=(0,V.k)(),{lowCreditStatus:K}=(0,r.B9)(),Z=(0,_.useMemo)(()=>u?"teammate"===O&&R&&M?(0,X.Fz)({userId:u.id,workspace:R}):"friend"===O?(0,X.Fz)({userId:u.id}):"":"",[M,R,O,u]),ee=N.enabled,et=N.referralBonus,el=es()[O],ea=d?"friend"===O?44:56:void 0,en=(0,_.useCallback)(()=>{q(),l()},[q,l]),eo=(0,i.NZ)();return(0,a.jsx)(F.L8,{isDark:!1,children:(0,a.jsxs)(m.aF,{isOpen:!0,onClose:l,size:"xl",children:[(0,a.jsx)(f.m,{}),(0,a.jsxs)(p.$,{children:[(0,a.jsx)(g.s,{}),(0,a.jsxs)(h.T,{py:4,px:6,textAlign:"center",children:[(0,a.jsx)(b.E,{...ed,fontSize:"md",color:K?eo[K].darkColor:void 0,children:K?eo[K].description:(0,a.jsx)(B.x6,{id:"xy3nnP"})}),(0,a.jsx)(y.r,{p:0,color:K?eo[K].lightColor:void 0,children:(0,a.jsxs)(v.z,{children:[(0,a.jsx)(k.az,{as:"span",fontSize:"xl",children:(0,a.jsx)(j.g,{icon:I.wq_})})," ",null===o?(0,a.jsx)(w.y,{size:"sm"}):(0,a.jsx)(B.x6,{id:"T57gLR",values:{credits:o}})]})}),(0,a.jsx)(b.E,{textAlign:"left",fontSize:"sm",pt:2,...ed,children:(0,a.jsx)(B.x6,{id:"lUUl1i"})})]}),(0,a.jsxs)(x.c,{pb:4,children:[ee?(0,a.jsxs)(h.T,{spacing:4,children:[(0,a.jsxs)(S.e,{variant:"ghost",size:"sm",spacing:0,gap:2,justifyContent:"center",flexWrap:"wrap",alignItems:"center",children:[!T&&E&&(0,a.jsx)(A.$,{onClick:()=>P("buy"),isActive:"buy"===O,color:"buy"===O?void 0:"gray.700",children:(0,a.jsx)(B.x6,{id:"KctW9G"})}),(0,a.jsx)(A.$,{onClick:()=>P("friend"),isActive:"friend"===O,color:"friend"===O?void 0:"gray.700",children:(0,a.jsx)(B.x6,{id:"KSBmDv"})}),M&&(0,a.jsx)(A.$,{leftIcon:(0,a.jsx)(j.g,{icon:I.nWR}),onClick:()=>P("teammate"),isActive:"teammate"===O,color:"teammate"===O?void 0:"gray.700",children:(0,a.jsx)(B.x6,{id:"dUOpaF"})})]}),("friend"===O||"teammate"===O)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(v.z,{spacing:2,children:[(0,a.jsxs)(b.E,{fontSize:"sm",minW:"50%",children:["friend"===O&&(0,a.jsx)(B.x6,{id:"tBKKYy",values:{referralBonusAmount:et,GAMMA_PROPER_NOUN:H.On}}),"teammate"===O&&(0,a.jsx)(B.x6,{id:"q8MWFp",values:{referralBonusAmount:et}})]}),(0,a.jsxs)(C.E,{colorScheme:"green",fontSize:"xs",px:"0.4em",py:"0.2em",children:["+"," ",(0,a.jsx)(B.x6,{id:"NFNFrR",values:{referralBonusAmount:et}})]})]}),(0,a.jsx)(L,{url:Z,paddingLeft:ea,customLabel:el.label,variant:"solid"})]}),"buy"===O&&(0,a.jsx)(J,{segmentEvent:s,onOpenCallback:l,onCloseCallback:n,title:(0,a.jsx)(B.x6,{id:"0i4o6E"})})]}):(0,a.jsxs)(v.z,{align:"baseline",spacing:1,children:[(0,a.jsx)(b.E,{children:(0,a.jsx)(B.x6,{id:"0TJN6B"})}),D?(0,a.jsx)(A.$,{onClick:en,variant:"link",children:(0,a.jsx)(B.x6,{id:"Bhgd0l"})}):(0,a.jsxs)(z.N,{href:"mailto:".concat(U.J),children:[(0,a.jsx)(B.x6,{id:"Bhgd0l"}),(0,a.jsx)(c.p,{ml:1,transform:"translateY(-2px)"})]})]}),(0,a.jsx)(ei,{my:4,onContactUsClick:D?en:void 0})]})]})]})})},ec=(0,_.memo)(e=>e.isOpen?(0,a.jsx)(eu,{...e}):null),em=(0,_.memo)(e=>{let{credits:t,lowCreditStatus:l,onClick:n,variant:o="solid",isDark:r=!1}=e,s=null===t,d=(0,i.NZ)();return(0,a.jsx)(F.Tz,{label:(0,a.jsx)(B.x6,{id:"IY3q+2"}),placement:"top",children:(0,a.jsx)(A.$,{onClick:n,isDisabled:s,..."ghost"===o?{variant:"ghost",size:"sm",colorScheme:r?"gray":"blackAlpha"}:{variant:"unstyled",bg:"white",px:4},color:l?d[l].lightColor:void 0,fontWeight:"500",leftIcon:(0,a.jsx)(j.g,{icon:I.wq_,size:"sm"}),rightIcon:(0,a.jsx)(j.g,{color:r?"var(--chakra-colors-gray-400)":"var(--chakra-colors-gray-600)",icon:I.mEO,size:"xs"}),children:s?(0,a.jsx)(w.y,{size:"xs"}):(0,a.jsx)(b.E,{as:"span",color:null===l?void 0:d[l].lightColor,children:(0,a.jsx)(B.x6,{id:"T57gLR",values:{credits:t}})})})})}),ef=(0,u.A)(e=>{let{modalId:t="ai-credits-modal",variant:l,segmentEvent:o,isDark:i,...r}=e,{hasUnlimitedCredits:s,credits:u,lowCreditStatus:c,onAICreditsModalOpen:m,onAICreditsModalClose:f,isAICreditsModalOpen:p}=d(t);return s?null:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(n.s,{...r,children:(0,a.jsx)(em,{credits:u,onClick:m,lowCreditStatus:c,variant:l,isDark:i})}),(0,a.jsx)(ec,{isOpen:p,onOpen:m,onClose:f,credits:u,segmentEvent:o})]})})},15355:(e,t,l)=>{"use strict";l.d(t,{G:()=>p});var a=l(31085),n=l(27670),o=l(62313),i=l(61778),r=l(20501),s=l(24221),d=l(95986),u=l(52177),c=l(65998),m=l(32849),f=l(31684);let p=e=>{var t;let{type:l,...p}=e,g=(0,c.u)("aiDebits");if((0,m.ez)("unlimited_credits"))return null;let h=null!==(t=g[l])&&void 0!==t?t:f.rA[l];return(0,a.jsx)(d.Tz,{label:(0,a.jsx)(u.x6,{id:"B7jvsP",values:{numCredits:h}}),children:(0,a.jsx)(n.E,{colorScheme:"whiteAlpha",bg:"whiteAlpha.300",textTransform:"none",textShadow:"none",fontSize:"xxs",ml:2,...p,children:(0,a.jsxs)(o.z,{spacing:1,children:[(0,a.jsx)(i.E,{children:h}),(0,a.jsx)(s.g,{icon:r.wq_,size:"sm"})]})})})}},31684:(e,t,l)=>{"use strict";l.d(t,{Bd:()=>i,Fu:()=>r,NZ:()=>s,rA:()=>o});var a=l(12327),n=l(79152);let o={generateImage:10,generateCard:5,editCard:5,generateCardNotes:5,chatSuggestion:10,wizardCreation:40,generateV2:40,generateV2WithImages:40,autocomplete:2,removeBackground:5,pptImportV2:50},i=3,r="wizardCreation",s=()=>({[n.y.EXHAUSTED]:{status:"error",lightColor:"red.600",darkColor:"red.800",description:a.Ru._({id:"15ZVEk"})},[n.y.LOW]:{status:"warning",lightColor:"yellow.600",darkColor:"yellow.800",description:a.Ru._({id:"URgIZH"})}})},71197:(e,t,l)=>{"use strict";l.d(t,{B9:()=>m,tO:()=>c});var a=l(14041);l(77914);var n=l(65998),o=l(10628),i=l(32849),r=l(88957);l(27042),l(15576);var s=l(31684),d=l(54925),u=l(44380);let c=(e,t,l)=>{let{openUpsellModal:n}=(0,o.I)();return(0,a.useCallback)(function(){for(var a=arguments.length,o=Array(a),i=0;i{var e,t,l;let o=(0,r.GV)(d.qj),c=(0,n.u)("aiDebits"),m=(0,i.ez)("unlimited_credits"),f=(0,a.useMemo)(()=>m?null:(0,u.F)(o,c[s.Fu]||s.rA[s.Fu],s.Bd),[m,o,c]),p=null!==o,g=m||p&&o>=(null!==(e=c.wizardCreation)&&void 0!==e?e:s.rA.wizardCreation),h=m||p&&o>=(null!==(t=c.chatSuggestion)&&void 0!==t?t:s.rA.chatSuggestion);return{lowCreditStatus:f,hasEnoughCreditsToGenerateDeck:g,hasEnoughCreditsToGenerateImage:m||p&&o>=(null!==(l=c.generateImage)&&void 0!==l?l:s.rA.generateImage),hasEnoughCreditsToChat:h,credits:o,isCreditsReady:p}}},19717:(e,t,l)=>{"use strict";l.d(t,{R:()=>m,w:()=>c});var a=l(77914),n=l(65998),o=l(32849),i=l(88957),r=l(10458),s=l(30358),d=l(31684),u=l(54925);let c=async(e,t,l)=>{var c,f;let p=(0,o.vT)("unlimited_credits",t),g=null!==(f=n.of.get("aiDebits")[e])&&void 0!==f?f:d.rA[e];if(m(e,t,l),0===g||p)return;let h=(null==t?void 0:t.id)||(0,s.gx)();if(!h)return;let b=(0,a.H4n)(),y=null===(c=(await b.mutate({mutation:a.lgx,variables:{value:g,workspaceId:h}})).data)||void 0===c?void 0:c.deductCredits;return y?(r.zS.track(r.VV.AI_CREDITS_DEDUCTED,{operation:e,used:g,remaining:y.credits,interactionId:l}),(0,i.KA)().dispatch((0,u.z0)({availableCredits:y.credits})),y.credits):null},m=(e,t,l)=>{var a;let i=(0,o.vT)("unlimited_credits",t),s=null!==(a=n.of.get("aiDebits")[e])&&void 0!==a?a:d.rA[e];r.zS.track(r.VV.AI_CREDITS_USED,{operation:e,used:s,has_unlimited_ai:i,interactionId:l})}},54925:(e,t,l)=>{"use strict";l.d(t,{l7:()=>d,qj:()=>s,z0:()=>i});var a=l(8796);let n={availableCredits:null},o=(0,a.Z0)({name:"Credits",initialState:n,reducers:{reset:()=>n,setCredits(e,t){let{availableCredits:l}=t.payload;e.availableCredits=l}}}),{setCredits:i,reset:r}=o.actions,s=e=>e.Credits.availableCredits,d=o.reducer},79152:(e,t,l)=>{"use strict";l.d(t,{y:()=>a});var a=function(e){return e.EXHAUSTED="exhausted",e.LOW="low",e}({})},44380:(e,t,l)=>{"use strict";l.d(t,{F:()=>d,n:()=>u});var a=l(65998),n=l(32849),o=l(88957),i=l(31684),r=l(54925),s=l(79152);let d=(e,t,l)=>null===e?null:e<=0?s.y.EXHAUSTED:e<=t*l?s.y.LOW:null,u=(e,t)=>{var l;let s=(0,n.vT)("unlimited_credits",t),d=null!==(l=a.of.get("aiDebits")[e])&&void 0!==l?l:i.rA[e];if(0===d||s)return!0;let u=(0,o.KA)().getState(),c=(0,r.qj)(u);return!!c&&c>=d}},52609:(e,t,l)=>{"use strict";let a,n,o,i;l.d(t,{mY:()=>c,pP:()=>I,eX:()=>B,F8:()=>E,zB:()=>M,$n:()=>_,Gm:()=>T});var r=l(31085),s=l(43342),d=l(61778),u=l(14041);let c=e=>{let{emojiId:t,fontSize:l="1em"}=e;return(0,r.jsx)(u.Suspense,{fallback:(0,r.jsx)(s.y,{size:"sm"}),children:(0,r.jsx)(d.E,{as:"span",sx:{".emoji-mart-emoji":{fontSize:"1em",span:{cursor:"inherit",fontSize:"1em !important"},":hover::before":{backgroundColor:"transparent"}}},fontSize:l,children:(0,r.jsx)("em-emoji",{id:t,native:!0,size:"0"})})})};var m=l(80532),f=l(56824),p=l(33158),g=l(15422),h=l(98627),b=l(67139),y=l(7586),v=l(67144),k=l(12327);let w={"pt-br":y,ja:h,"zh-cn":v,es:p,fr:g,ko:b},x=()=>w[k.Ru.locale]||void 0;var S=l(72239);let A=l.e(1478).then(l.bind(l,8058));A.then(e=>{a=e.Picker});let C=e=>{let t=(0,u.useRef)(null),l=(0,u.useRef)(null),n=e.dataTargetName?{"data-target-name":e.dataTargetName}:{};return l.current&&l.current.update(e),(0,u.useEffect)(()=>(A.then(()=>{var n;l.current=new a({...e,ref:t}),null===(n=e.onCreate)||void 0===n||n.call(e,l.current)}),()=>{l.current=null}),[]),(0,r.jsx)(m.az,{ref:t,...n})},z=["+1","-1","heart_eyes","thinking_face","question","open_mouth","white_check_mark","x","tada"],I=e=>{let{handlePick:t,shouldFocusSearch:l=!0,perLine:n=12,dataTargetName:o,...i}=e,{colorMode:s}=(0,f.G6)();(0,u.useEffect)(()=>{if(!S.x.getItem("emoji-mart.frequently")){let e=Object.fromEntries(z.map((e,t)=>[e,z.length-t]));S.x.setItem("emoji-mart.frequently",JSON.stringify(e))}},[]);let d=(0,u.useMemo)(()=>x(),[]);return a?(0,r.jsx)(C,{perLine:n,set:"native",theme:"dark"===s?"dark":"light",previewPosition:"none",skinTonePosition:"none",autoFocus:l,onEmojiSelect:e=>{t(e)},maxFrequentRows:2,dataTargetName:o,i18n:d,...i}):(console.warn("[EmojiPicker] Emoji picker hasn't loaded yet"),null)},j={"⭐️":"star","☕️":"coffee","❤":"heart","☺":"relaxed","❄":"snowflake","⚔":"crossed_swords","\uD83C\uDFCB‍♂️":"man-lifting-weights","❤‍\uD83E\uDE79":"mending_heart","❤️️":"heart","\uD83D\uDDE8":"left_speech_bubble","\uD83C\uDFCC":"golfer","️\uD83C\uDC04️":"mahjong","⚡️":"lightning","1⃣":"one","2⃣":"two","3⃣":"three","4⃣":"four","5⃣":"five","6⃣":"six","7⃣":"seven","8⃣":"eight","9⃣":"nine","0⃣":"zero","◽️":"white_medium_small_square","☔️":"umbrella_with_rain_drops","⛄️":"snowman_without_snow","⚽️":"soccer","⛵️":"boat","⛲️":"fountain","⛺️":"tent","⌚️":"watch","⌛️":"hourglass","⚒":"hammer_and_pick","♈︎":"aries","♈️":"aries","♉️":"taurus","♉︎":"taurus","♊️":"gemini","♊︎":"gemini","♋️":"cancer","♋︎":"cancer","♌️":"leo","♌︎":"leo","♍️":"virgo","♍︎":"virgo","♎️":"libra","♎︎":"libra","♏️":"scorpius","♏︎":"scorpius","♐️":"sagittarius","♐︎":"sagittarius","♑️":"capricorn","♑︎":"capricorn","♒️":"aquarius","♒︎":"aquarius","♓️":"pisces","♓︎":"pisces","⭕️":"o","❗️":"exclamation","♿️":"wheelchair","⚪️":"white_circle","◾️":"black_medium_small_square","⬛️":"black_large_square","⬜️":"white_large_square","\uD83D\uDC41‍\uD83D\uDDE8":"eye-in-speech-bubble","\uD83C\uDC04️":"mahjong","\uD83E\uDDD1\uD83C\uDFFB‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFB":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFB‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFC":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFB‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFD":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFB‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFE":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFB‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFF":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFC‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFB":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFC‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFC":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFC‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFD":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFC‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFE":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFC‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFF":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFD‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFB":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFD‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFC":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFD‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFD":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFD‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFE":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFD‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFF":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFE‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFB":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFE‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFC":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFE‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFD":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFE‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFE":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFE‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFF":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFF‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFB":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFF‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFC":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFF‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFD":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFF‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFE":"people_holding_hands","\uD83E\uDDD1\uD83C\uDFFF‍\uD83E\uDD1D‍\uD83E\uDDD1\uD83C\uDFFF":"people_holding_hands","\uD83D\uDC6D\uD83C\uDFFB":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFB‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFC":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFB‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFD":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFB‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFE":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFB‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFF":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFC‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFB":"two_women_holding_hands","\uD83D\uDC6D\uD83C\uDFFC":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFC‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFD":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFC‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFE":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFC‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFF":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFD‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFB":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFD‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFC":"two_women_holding_hands","\uD83D\uDC6D\uD83C\uDFFD":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFD‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFE":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFD‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFF":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFE‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFB":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFE‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFC":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFE‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFD":"two_women_holding_hands","\uD83D\uDC6D\uD83C\uDFFE":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFE‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFF":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFF‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFB":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFF‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFC":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFF‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFD":"two_women_holding_hands","\uD83D\uDC69\uD83C\uDFFF‍\uD83E\uDD1D‍\uD83D\uDC69\uD83C\uDFFE":"two_women_holding_hands","\uD83D\uDC6D\uD83C\uDFFF":"two_women_holding_hands","\uD83D\uDC6B\uD83C\uDFFB":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFB‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFC":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFB‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFD":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFB‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFE":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFB‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFF":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFC‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFB":"man_and_woman_holding_hands","\uD83D\uDC6B\uD83C\uDFFC":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFC‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFD":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFC‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFE":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFC‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFF":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFD‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFB":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFD‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFC":"man_and_woman_holding_hands","\uD83D\uDC6B\uD83C\uDFFD":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFD‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFE":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFD‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFF":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFE‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFB":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFE‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFC":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFE‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFD":"man_and_woman_holding_hands","\uD83D\uDC6B\uD83C\uDFFE":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFE‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFF":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFF‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFB":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFF‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFC":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFF‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFD":"man_and_woman_holding_hands","\uD83D\uDC69\uD83C\uDFFF‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFE":"man_and_woman_holding_hands","\uD83D\uDC6B\uD83C\uDFFF":"man_and_woman_holding_hands","\uD83D\uDC6C\uD83C\uDFFB":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFB‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFC":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFB‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFD":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFB‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFE":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFB‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFF":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFC‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFB":"two_men_holding_hands","\uD83D\uDC6C\uD83C\uDFFC":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFC‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFD":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFC‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFE":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFC‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFF":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFD‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFB":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFD‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFC":"two_men_holding_hands","\uD83D\uDC6C\uD83C\uDFFD":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFD‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFE":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFD‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFF":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFE‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFB":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFE‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFC":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFE‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFD":"two_men_holding_hands","\uD83D\uDC6C\uD83C\uDFFE":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFE‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFF":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFF‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFB":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFF‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFC":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFF‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFD":"two_men_holding_hands","\uD83D\uDC68\uD83C\uDFFF‍\uD83E\uDD1D‍\uD83D\uDC68\uD83C\uDFFE":"two_men_holding_hands","\uD83D\uDC6C\uD83C\uDFFF":"two_men_holding_hands","☹":"white_frowning_face","☠":"skull_and_crossbones","❣":"heavy_heart_exclamation_mark_ornament","\uD83D\uDD73":"hole","\uD83D\uDDEF":"right_anger_bubble","\uD83D\uDD90":"raised_hand_with_fingers_splayed","✌":"v","☝":"point_up","✍":"writing_hand","\uD83D\uDC41":"eye","\uD83D\uDD75":"sleuth_or_spy","\uD83D\uDD74":"man_in_business_suit_levitating","⛷":"skier","⛳️":"golf","⛹":"person_with_ball","\uD83C\uDFCB":"weight_lifter","⚾️":"baseball","\uD83D\uDDE3":"speaking_head_in_silhouette","☘":"shamrock","\uD83D\uDC3F":"chipmunk","\uD83D\uDD4A":"dove_of_peace","\uD83D\uDD77":"spider","\uD83D\uDD78":"spider_web","\uD83C\uDFF5":"rosette","\uD83C\uDF36":"hot_pepper","\uD83C\uDF7D":"knife_fork_plate","\uD83D\uDDFA":"world_map","\uD83C\uDFD4":"snow_capped_mountain","⛰":"mountain","\uD83C\uDFD5":"camping","\uD83C\uDFD6":"beach_with_umbrella","\uD83C\uDFDC":"desert","\uD83C\uDFDD":"desert_island","\uD83C\uDFDE":"national_park","\uD83C\uDFDF":"stadium","\uD83C\uDFDB":"classical_building","\uD83C\uDFD7":"building_construction","\uD83C\uDFD8":"house_buildings","\uD83C\uDFDA":"derelict_house_building","⛩":"shinto_shrine","\uD83C\uDFD9":"cityscape","♨️":"hotsprings","\uD83C\uDFCE":"racing_car","\uD83C\uDFCD":"racing_motorcycle","\uD83D\uDEE3":"motorway","\uD83D\uDEE4":"railway_track","\uD83D\uDEE2":"oil_drum","\uD83D\uDEF3":"passenger_ship","⛴":"ferry","\uD83D\uDEE5":"motor_boat","✈":"airplane","\uD83D\uDEE9":"small_airplane","\uD83D\uDEF0":"satellite","\uD83D\uDECE":"bellhop_bell","⏱":"stopwatch","⏲":"timer_clock","\uD83D\uDD70":"mantelpiece_clock","\uD83C\uDF21":"thermometer","☀":"sunny","☁":"cloud","⛈":"thunder_cloud_and_rain","\uD83C\uDF24":"mostly_sunny","\uD83C\uDF25":"barely_sunny","\uD83C\uDF26":"partly_sunny_rain","\uD83C\uDF27":"rain_cloud","\uD83C\uDF28":"snow_cloud","\uD83C\uDF29":"lightning","\uD83C\uDF2A":"tornado","\uD83C\uDF2B":"fog","\uD83C\uDF2C":"wind_blowing_face","☂":"umbrella","⛱":"umbrella_on_ground","❄️":"snowflake","☃":"snowman","☄":"comet","\uD83C\uDF97":"reminder_ribbon","\uD83C\uDF9F":"admission_tickets","\uD83C\uDF96":"medal","⛸":"ice_skate","\uD83D\uDD79":"joystick","♠️":"spades","♥️":"hearts","♦️":"diamonds","♣️":"clubs","♟":"chess_pawn","\uD83D\uDDBC":"frame_with_picture","\uD83D\uDD76":"dark_sunglasses","\uD83D\uDECD":"shopping_bags","⛑":"helmet_with_white_cross","\uD83C\uDF99":"studio_microphone","\uD83C\uDF9A":"level_slider","\uD83C\uDF9B":"control_knobs","☎":"phone","\uD83D\uDDA5":"desktop_computer","\uD83D\uDDA8":"printer","⌨":"keyboard","\uD83D\uDDB1":"three_button_mouse","\uD83D\uDDB2":"trackball","\uD83C\uDF9E":"film_frames","\uD83D\uDCFD":"film_projector","\uD83D\uDD6F":"candle","\uD83D\uDDDE":"rolled_up_newspaper","\uD83C\uDFF7":"label","✉":"email","\uD83D\uDDF3":"ballot_box_with_ballot","✏":"pencil2","✒":"black_nib","\uD83D\uDD8B":"lower_left_fountain_pen","\uD83D\uDD8A":"lower_left_ballpoint_pen","\uD83D\uDD8C":"lower_left_paintbrush","\uD83D\uDD8D":"lower_left_crayon","\uD83D\uDDC2":"card_index_dividers","\uD83D\uDDD2":"spiral_note_pad","\uD83D\uDDD3":"spiral_calendar_pad","\uD83D\uDD87":"linked_paperclips","✂":"scissors","\uD83D\uDDC3":"card_file_box","\uD83D\uDDC4":"file_cabinet","\uD83D\uDDD1":"wastebasket","\uD83D\uDDDD":"old_key","⛏":"pick","⚒️":"hammer_and_pick","\uD83D\uDEE0":"hammer_and_wrench","\uD83D\uDDE1":"dagger_knife","⚔️":"crossed_swords","\uD83D\uDEE1":"shield","⚙":"gear","\uD83D\uDDDC":"compression","⚖":"scales","⛓":"chains","⚗":"alembic","\uD83D\uDECF":"bed","\uD83D\uDECB":"couch_and_lamp","⚰":"coffin","⚱":"funeral_urn","⚠":"warning","☢":"radioactive_sign","☣":"biohazard_sign","⬆":"arrow_up","↗":"arrow_upper_right","➡":"arrow_right","↘":"arrow_lower_right","⬇":"arrow_down","↙":"arrow_lower_left","⬅":"arrow_left","↖":"arrow_upper_left","↕":"arrow_up_down","↔":"left_right_arrow","↩":"leftwards_arrow_with_hook","↪":"arrow_right_hook","⤴":"arrow_heading_up","⤵":"arrow_heading_down","⚛":"atom_symbol","\uD83D\uDD49":"om_symbol","✡":"star_of_david","☸":"wheel_of_dharma","☯":"yin_yang","✝":"latin_cross","☦":"orthodox_cross","☪":"star_and_crescent","☮":"peace_symbol","▶":"arrow_forward","⏭":"black_right_pointing_double_triangle_with_vertical_bar","⏯":"black_right_pointing_triangle_with_double_vertical_bar","◀":"arrow_backward","⏮":"black_left_pointing_double_triangle_with_vertical_bar","⏸":"double_vertical_bar","⏹":"black_square_for_stop","⏺":"black_circle_for_record","⏏":"eject","♀":"female_sign","♂":"male_sign","⚧":"transgender_symbol","✖":"heavy_multiplication_x","♾":"infinity","‼":"bangbang","⁉":"interrobang","〰":"wavy_dash","⚕":"medical_symbol","♻":"recycle","⚜":"fleur_de_lis","☑":"ballot_box_with_check","✔":"heavy_check_mark","〽":"part_alternation_mark","✳":"eight_spoked_asterisk","✴":"eight_pointed_black_star","❇":"sparkle","\uD83C\uDD70":"a","\uD83C\uDD71":"b",ℹ:"information_source","Ⓜ":"m","\uD83C\uDD7E":"o2","\uD83C\uDD7F":"parking","\uD83C\uDE02":"sa","\uD83C\uDE37":"u6708","㊗":"congratulations","㊙":"secret","◼":"black_medium_square","◻":"white_medium_square","▪":"black_small_square","▫":"white_small_square","\uD83C\uDFF3":"waving_white_flag","♥":"hearts","♠":"spades","♣":"clubs","♦":"diamonds","\uD83E\uDEF1\uD83C\uDFFB‍\uD83E\uDEF2\uD83C\uDFFC":"handshake","\uD83E\uDEF1\uD83C\uDFFB‍\uD83E\uDEF2\uD83C\uDFFD":"handshake","\uD83E\uDEF1\uD83C\uDFFB‍\uD83E\uDEF2\uD83C\uDFFE":"handshake","\uD83E\uDEF1\uD83C\uDFFB‍\uD83E\uDEF2\uD83C\uDFFF":"handshake","\uD83E\uDEF1\uD83C\uDFFC‍\uD83E\uDEF2\uD83C\uDFFB":"handshake","\uD83E\uDEF1\uD83C\uDFFC‍\uD83E\uDEF2\uD83C\uDFFD":"handshake","\uD83E\uDEF1\uD83C\uDFFC‍\uD83E\uDEF2\uD83C\uDFFE":"handshake","\uD83E\uDEF1\uD83C\uDFFC‍\uD83E\uDEF2\uD83C\uDFFF":"handshake","\uD83E\uDEF1\uD83C\uDFFD‍\uD83E\uDEF2\uD83C\uDFFB":"handshake","\uD83E\uDEF1\uD83C\uDFFD‍\uD83E\uDEF2\uD83C\uDFFC":"handshake","\uD83E\uDEF1\uD83C\uDFFD‍\uD83E\uDEF2\uD83C\uDFFE":"handshake","\uD83E\uDEF1\uD83C\uDFFD‍\uD83E\uDEF2\uD83C\uDFFF":"handshake","\uD83E\uDEF1\uD83C\uDFFE‍\uD83E\uDEF2\uD83C\uDFFB":"handshake","\uD83E\uDEF1\uD83C\uDFFE‍\uD83E\uDEF2\uD83C\uDFFC":"handshake","\uD83E\uDEF1\uD83C\uDFFE‍\uD83E\uDEF2\uD83C\uDFFD":"handshake","\uD83E\uDEF1\uD83C\uDFFE‍\uD83E\uDEF2\uD83C\uDFFF":"handshake","\uD83E\uDEF1\uD83C\uDFFF‍\uD83E\uDEF2\uD83C\uDFFB":"handshake","\uD83E\uDEF1\uD83C\uDFFF‍\uD83E\uDEF2\uD83C\uDFFC":"handshake","\uD83E\uDEF1\uD83C\uDFFF‍\uD83E\uDEF2\uD83C\uDFFD":"handshake","\uD83E\uDEF1\uD83C\uDFFF‍\uD83E\uDEF2\uD83C\uDFFE":"handshake","\uD83D\uDC68\uD83C\uDFFB‍❤️‍\uD83D\uDC68\uD83C\uDFFC":"man-heart-man","\uD83D\uDC68\uD83C\uDFFB‍❤️‍\uD83D\uDC68\uD83C\uDFFD":"man-heart-man","\uD83D\uDC68\uD83C\uDFFB‍❤️‍\uD83D\uDC68\uD83C\uDFFE":"man-heart-man","\uD83D\uDC68\uD83C\uDFFB‍❤️‍\uD83D\uDC68\uD83C\uDFFF":"man-heart-man","\uD83D\uDC68\uD83C\uDFFC‍❤️‍\uD83D\uDC68\uD83C\uDFFB":"man-heart-man","\uD83D\uDC68\uD83C\uDFFC‍❤️‍\uD83D\uDC68\uD83C\uDFFD":"man-heart-man","\uD83D\uDC68\uD83C\uDFFC‍❤️‍\uD83D\uDC68\uD83C\uDFFE":"man-heart-man","\uD83D\uDC68\uD83C\uDFFC‍❤️‍\uD83D\uDC68\uD83C\uDFFF":"man-heart-man","\uD83D\uDC68\uD83C\uDFFD‍❤️‍\uD83D\uDC68\uD83C\uDFFB":"man-heart-man","\uD83D\uDC68\uD83C\uDFFD‍❤️‍\uD83D\uDC68\uD83C\uDFFC":"man-heart-man","\uD83D\uDC68\uD83C\uDFFD‍❤️‍\uD83D\uDC68\uD83C\uDFFE":"man-heart-man","\uD83D\uDC68\uD83C\uDFFD‍❤️‍\uD83D\uDC68\uD83C\uDFFF":"man-heart-man","\uD83D\uDC68\uD83C\uDFFE‍❤️‍\uD83D\uDC68\uD83C\uDFFB":"man-heart-man","\uD83D\uDC68\uD83C\uDFFE‍❤️‍\uD83D\uDC68\uD83C\uDFFC":"man-heart-man","\uD83D\uDC68\uD83C\uDFFE‍❤️‍\uD83D\uDC68\uD83C\uDFFD":"man-heart-man","\uD83D\uDC68\uD83C\uDFFE‍❤️‍\uD83D\uDC68\uD83C\uDFFF":"man-heart-man","\uD83D\uDC68\uD83C\uDFFF‍❤️‍\uD83D\uDC68\uD83C\uDFFB":"man-heart-man","\uD83D\uDC68\uD83C\uDFFF‍❤️‍\uD83D\uDC68\uD83C\uDFFC":"man-heart-man","\uD83D\uDC68\uD83C\uDFFF‍❤️‍\uD83D\uDC68\uD83C\uDFFD":"man-heart-man","\uD83D\uDC68\uD83C\uDFFF‍❤️‍\uD83D\uDC68\uD83C\uDFFE":"man-heart-man","\uD83D\uDC69\uD83C\uDFFB‍❤️‍\uD83D\uDC68\uD83C\uDFFC":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFB‍❤️‍\uD83D\uDC68\uD83C\uDFFD":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFB‍❤️‍\uD83D\uDC68\uD83C\uDFFE":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFB‍❤️‍\uD83D\uDC68\uD83C\uDFFF":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFB‍❤️‍\uD83D\uDC69\uD83C\uDFFC":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFB‍❤️‍\uD83D\uDC69\uD83C\uDFFD":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFB‍❤️‍\uD83D\uDC69\uD83C\uDFFE":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFB‍❤️‍\uD83D\uDC69\uD83C\uDFFF":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFC‍❤️‍\uD83D\uDC68\uD83C\uDFFB":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFC‍❤️‍\uD83D\uDC68\uD83C\uDFFD":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFC‍❤️‍\uD83D\uDC68\uD83C\uDFFE":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFC‍❤️‍\uD83D\uDC68\uD83C\uDFFF":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFC‍❤️‍\uD83D\uDC69\uD83C\uDFFB":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFC‍❤️‍\uD83D\uDC69\uD83C\uDFFD":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFC‍❤️‍\uD83D\uDC69\uD83C\uDFFE":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFC‍❤️‍\uD83D\uDC69\uD83C\uDFFF":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFD‍❤️‍\uD83D\uDC68\uD83C\uDFFB":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFD‍❤️‍\uD83D\uDC68\uD83C\uDFFC":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFD‍❤️‍\uD83D\uDC68\uD83C\uDFFE":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFD‍❤️‍\uD83D\uDC68\uD83C\uDFFF":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFD‍❤️‍\uD83D\uDC69\uD83C\uDFFB":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFD‍❤️‍\uD83D\uDC69\uD83C\uDFFC":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFD‍❤️‍\uD83D\uDC69\uD83C\uDFFE":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFD‍❤️‍\uD83D\uDC69\uD83C\uDFFF":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFE‍❤️‍\uD83D\uDC68\uD83C\uDFFB":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFE‍❤️‍\uD83D\uDC68\uD83C\uDFFC":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFE‍❤️‍\uD83D\uDC68\uD83C\uDFFD":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFE‍❤️‍\uD83D\uDC68\uD83C\uDFFF":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFE‍❤️‍\uD83D\uDC69\uD83C\uDFFB":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFE‍❤️‍\uD83D\uDC69\uD83C\uDFFC":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFE‍❤️‍\uD83D\uDC69\uD83C\uDFFD":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFE‍❤️‍\uD83D\uDC69\uD83C\uDFFF":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFF‍❤️‍\uD83D\uDC68\uD83C\uDFFB":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFF‍❤️‍\uD83D\uDC68\uD83C\uDFFC":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFF‍❤️‍\uD83D\uDC68\uD83C\uDFFD":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFF‍❤️‍\uD83D\uDC68\uD83C\uDFFE":"woman-heart-man","\uD83D\uDC69\uD83C\uDFFF‍❤️‍\uD83D\uDC69\uD83C\uDFFB":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFF‍❤️‍\uD83D\uDC69\uD83C\uDFFC":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFF‍❤️‍\uD83D\uDC69\uD83C\uDFFD":"woman-heart-woman","\uD83D\uDC69\uD83C\uDFFF‍❤️‍\uD83D\uDC69\uD83C\uDFFE":"woman-heart-woman","\uD83E\uDDD1\uD83C\uDFFB‍❤️‍\uD83E\uDDD1\uD83C\uDFFC":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFB‍❤️‍\uD83E\uDDD1\uD83C\uDFFD":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFB‍❤️‍\uD83E\uDDD1\uD83C\uDFFE":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFB‍❤️‍\uD83E\uDDD1\uD83C\uDFFF":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFC‍❤️‍\uD83E\uDDD1\uD83C\uDFFB":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFC‍❤️‍\uD83E\uDDD1\uD83C\uDFFD":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFC‍❤️‍\uD83E\uDDD1\uD83C\uDFFE":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFC‍❤️‍\uD83E\uDDD1\uD83C\uDFFF":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFD‍❤️‍\uD83E\uDDD1\uD83C\uDFFB":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFD‍❤️‍\uD83E\uDDD1\uD83C\uDFFC":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFD‍❤️‍\uD83E\uDDD1\uD83C\uDFFE":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFD‍❤️‍\uD83E\uDDD1\uD83C\uDFFF":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFE‍❤️‍\uD83E\uDDD1\uD83C\uDFFB":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFE‍❤️‍\uD83E\uDDD1\uD83C\uDFFC":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFE‍❤️‍\uD83E\uDDD1\uD83C\uDFFD":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFE‍❤️‍\uD83E\uDDD1\uD83C\uDFFF":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFF‍❤️‍\uD83E\uDDD1\uD83C\uDFFB":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFF‍❤️‍\uD83E\uDDD1\uD83C\uDFFC":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFF‍❤️‍\uD83E\uDDD1\uD83C\uDFFD":"couple_with_heart","\uD83E\uDDD1\uD83C\uDFFF‍❤️‍\uD83E\uDDD1\uD83C\uDFFE":"couple_with_heart","\uD83D\uDC68\uD83C\uDFFB‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFC":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFB‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFD":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFB‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFE":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFB‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFF":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFC‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFB":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFC‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFD":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFC‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFE":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFC‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFF":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFD‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFB":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFD‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFC":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFD‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFE":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFD‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFF":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFE‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFB":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFE‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFC":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFE‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFD":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFE‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFF":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFF‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFB":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFF‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFC":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFF‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFD":"man-kiss-man","\uD83D\uDC68\uD83C\uDFFF‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFE":"man-kiss-man","\uD83D\uDC69\uD83C\uDFFB‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFC":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFB‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFD":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFB‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFE":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFB‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFF":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFB‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFC":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFB‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFD":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFB‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFE":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFB‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFF":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFC‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFB":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFC‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFD":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFC‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFE":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFC‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFF":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFC‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFB":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFC‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFD":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFC‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFE":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFC‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFF":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFD‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFB":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFD‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFC":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFD‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFE":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFD‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFF":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFD‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFB":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFD‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFC":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFD‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFE":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFD‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFF":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFE‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFB":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFE‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFC":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFE‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFD":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFE‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFF":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFE‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFB":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFE‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFC":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFE‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFD":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFE‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFF":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFF‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFB":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFF‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFC":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFF‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFD":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFF‍❤️‍\uD83D\uDC8B‍\uD83D\uDC68\uD83C\uDFFE":"woman-kiss-man","\uD83D\uDC69\uD83C\uDFFF‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFB":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFF‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFC":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFF‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFD":"woman-kiss-woman","\uD83D\uDC69\uD83C\uDFFF‍❤️‍\uD83D\uDC8B‍\uD83D\uDC69\uD83C\uDFFE":"woman-kiss-woman","\uD83E\uDDD1\uD83C\uDFFB‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFC":"couplekiss","\uD83E\uDDD1\uD83C\uDFFB‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFD":"couplekiss","\uD83E\uDDD1\uD83C\uDFFB‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFE":"couplekiss","\uD83E\uDDD1\uD83C\uDFFB‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFF":"couplekiss","\uD83E\uDDD1\uD83C\uDFFC‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFB":"couplekiss","\uD83E\uDDD1\uD83C\uDFFC‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFD":"couplekiss","\uD83E\uDDD1\uD83C\uDFFC‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFE":"couplekiss","\uD83E\uDDD1\uD83C\uDFFC‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFF":"couplekiss","\uD83E\uDDD1\uD83C\uDFFD‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFB":"couplekiss","\uD83E\uDDD1\uD83C\uDFFD‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFC":"couplekiss","\uD83E\uDDD1\uD83C\uDFFD‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFE":"couplekiss","\uD83E\uDDD1\uD83C\uDFFD‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFF":"couplekiss","\uD83E\uDDD1\uD83C\uDFFE‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFB":"couplekiss","\uD83E\uDDD1\uD83C\uDFFE‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFC":"couplekiss","\uD83E\uDDD1\uD83C\uDFFE‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFD":"couplekiss","\uD83E\uDDD1\uD83C\uDFFE‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFF":"couplekiss","\uD83E\uDDD1\uD83C\uDFFF‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFB":"couplekiss","\uD83E\uDDD1\uD83C\uDFFF‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFC":"couplekiss","\uD83E\uDDD1\uD83C\uDFFF‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFD":"couplekiss","\uD83E\uDDD1\uD83C\uDFFF‍❤️‍\uD83D\uDC8B‍\uD83E\uDDD1\uD83C\uDFFE":"couplekiss","\uD83D\uDC77‍♀":"female-construction-worker","\uD83D\uDE45‍♀":"woman-gesturing-no","\uD83D\uDD75️‍♀":"female-detective","❌":"x","\uD83E\uDDB8‍♂":"male_superhero","\uD83D\uDEB4‍♀":"woman-biking","\uD83D\uDEB5‍♀":"woman-mountain-biking","\uD83C\uDFF3‍\uD83C\uDF08":"rainbow-flag","\uD83C\uDFC4\uD83C\uDFFF‍♂":"man-surfing","\uD83E\uDDDF‍♂":"male_zombie","\uD83D\uDE4B‍♂":"man-raising-hand","\uD83C\uDFC3‍♀":"woman-running","\uD83C\uDFCB\uD83C\uDFFB‍♀":"woman-lifting-weights","\uD83C\uDFCB‍♀️":"woman-lifting-weights","\uD83E\uDDD6‍♀":"woman_in_steamy_room","♨":"hotsprings","❤‍\uD83D\uDD25":"heart_on_fire","\uD83D\uDD75‍♀️":"female-detective","\uD83E\uDD26\uD83C\uDFFB‍♀":"woman-facepalming","\uD83D\uDD75‍♂️":"male-detective","⤵️":"arrow_heading_down"};A.then(e=>{i=e.init,e.SearchIndex});let{initEmojiMartDataLazy:F,emojisReadyPromise:B}=(()=>{let e;return{initEmojiMartDataLazy:async()=>{let t=(await l.e(2006).then(l.t.bind(l,53222,19))).default;await A,await i({data:t}),n=P(t.emojis),o=t.emojis,e(!0)},emojisReadyPromise:new Promise(t=>e=t)}})(),R=()=>({nativeToEmojiDataMap:n,emojis:o}),_=e=>{var t;return null==e?void 0:null===(t=e.skins)||void 0===t?void 0:t[0].native},M=e=>{var t;let{nativeToEmojiDataMap:l}=R(),a=null==l?void 0:null===(t=l[e])||void 0===t?void 0:t.id;return a||console.error("[emoji.getIdFromNative] Cannot find ID from native:",e),a},E=e=>{let{emojis:t}=R();return null==t?void 0:t[e]},T=()=>{let{emojis:e,nativeToEmojiDataMap:t}=R();return!!t&&!!e},O=(e,t)=>Object.entries(e).reduce((e,l)=>{let[a,n]=l,o=t[n];return e[a]=N(o,{skinIndex:0}),e},{}),P=e=>{let t=O(j,e);return{...Object.entries(e).reduce((e,t)=>{let[l,a]=t;return l&&a&&a.skins.forEach((t,l)=>{e[t.native]=N(a,{skinIndex:l})}),e},{}),...t}},N=(e,t)=>{let{skinIndex:l}=t,a=e.skins[l]||(l=0,e.skins[l]),n={id:e.id,name:e.name,native:a.native,unified:a.unified,keywords:e.keywords,shortcodes:a.shortcodes||e.shortcodes};return e.skins.length>1&&(n.skin=l+1),a.src&&(n.src=a.src),e.aliases&&e.aliases.length&&(n.aliases=e.aliases),e.emoticons&&e.emoticons.length&&(n.emoticons=e.emoticons),n}},32899:(e,t,l)=>{"use strict";l.d(t,{of:()=>h}),l(14041);var a=l(73893),n=l(57999),o=l(10458);let i=(e,t,l)=>{null===o.zS||void 0===o.zS||o.zS.track(o.VV.EXPERIMENT_BUCKETED,{flag:e,variation:t,...l})};var r=l(78821),s=l(4013),d=l(30503),u=l(72239),c=l(18191),m=l(2313);let f=a.$.IS_USER_TESTING_SESSION?{cardLayoutsEnabled:!0}:{};class p{set(e,t){u.x.setItem(e,JSON.stringify(t))}get(e){let t=u.x.getItem(e);if(t)try{return JSON.parse(t)}catch(e){return}}delete(e){u.x.removeItem(e)}}class g{onChange(e){return this.onChangeFns.push(e),()=>{try{let t=this.onChangeFns.indexOf(e);t>-1&&this.onChangeFns.splice(t,1)}catch(e){}}}explain(){return Object.entries(this.defaults).map(e=>{let[t,l]=e,a=this.flags[t],n=this.overrides[t];return{key:t,type:typeof l,defaultValue:l,value:a,overrideValue:n,source:void 0!==n?"override":void 0!==a?"flag":"default"}})}subscribe(e,t){return this.updateFns[e]=this.updateFns[e]||[],this.updateFns[e].push(t),()=>{try{let l=this.updateFns[e].indexOf(t);l>-1&&this.updateFns[e].splice(l,1)}catch(e){}}}initialize(e,t){if(this.hasInitialized){console.warn("[FeatureFlagProvider].initialize has already been called. This is a no-op");return}console.debug("[FeatureFlagProvider].initialize",{initialFlags:t}),this.set(t),this.ldClient=e,this.subscribeToLDChanges(),this.initializePromise.resolve(!0),this.hasInitialized=!0,n.l.on("online",()=>{this.ldClient.setStreaming(!0)}),n.l.on("offline",()=>{this.ldClient.setStreaming(!1)}),window.setFeatureFlag=h.overrideFlag.bind(h),window.allFeatureFlags=h.all.bind(h)}get(e){if(this.ldClient&&this.hasInitialized&&!(e in this.ldFlagVariationMap)){var t;let l=this.ldClient.variation(e);(null===(t=this.ldClient.variationDetail(e).reason)||void 0===t?void 0:t.inExperiment)&&i(e,l),this.ldFlagVariationMap[e]=!0}return this.all()[e]}set(e){for(let[t,l]of Object.entries(e))t in c.V?(this.flags[t]=l,this.emitOnUpdate(t,!1)):(0,d.NF)()||console.debug("[GammaFeatureFlagProvider] flag ".concat(t," not specified in FEATURE_FLAG_DEFAULTS"));this.store.set(this.CACHE_KEY,this.flags),this.processOnChangeFns()}all(){return{...this.defaults,...this.flags,...this.overrides,...f}}overrideFlag(e,t){this.overrides[e]=t,this.emitOnUpdate(e),this.store.set(this.OVERRIDES_KEY,this.overrides)}removeOverride(e){delete this.overrides[e],this.emitOnUpdate(e),this.store.set(this.OVERRIDES_KEY,this.overrides)}updateWorkspaceInLdContext(e){return this.initializePromise.then(()=>{let t={...this.ldClient.getContext()};return e&&(t.workspace={key:e.id,name:e.name,plan:(0,r.A4)(e)}),this.ldClient.identify(t)})}emitOnUpdate(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],l=this.all();(this.updateFns[e]||[]).forEach(t=>{t(l[e])}),t&&this.processOnChangeFns()}processOnChangeFns(){this.onChangeFns.forEach(e=>e())}constructor(e,t={store:new p}){this.CACHE_KEY="gammaFeatureFlagCache",this.OVERRIDES_KEY="gammaFeatureFlagOverrides",this.initializePromise=new s.c,this.hasInitialized=!1,this.flags={},this.overrides={},this.updateFns={},this.onChangeFns=[],this.ldFlagVariationMap={},this.subscribeToLDChanges=()=>{this.ldClient.on("change",e=>{let t=(0,m.fi)(e,void 0);this.set(t)})},this.defaults=e,this.store=t.store,this.flags=this.store.get(this.CACHE_KEY)||{},this.overrides=this.store.get(this.OVERRIDES_KEY)||{}}}let h=new g(c.V)},18191:(e,t,l)=>{"use strict";l.d(t,{V:()=>a});let a={gammaRebrand:!1,debugComments:!1,debugLogging:!1,drawingBlock:!0,tldraw2:!0,uploadPDF:!1,highlight:{enabled:!1,enableStrictPrivacy:!0},realUserMetrics:!1,rumSampleRate:1,rumKeystrokeSampleRate:10,cardViewedThreshold:5e3,channelActivity:!1,customFonts:!0,docImport:!0,presentModeFlat:!0,docPreview:!1,blockReactions:!0,intercom:!0,zendesk:!1,shareFeedback:!1,dataSyncErrorThreshold:-1,dataSyncClockDriftTolerance:5,screenshotsEnabled:!1,math:!1,offline:!1,offlineTest:!1,offlineEditing:!1,layoutResizing:!0,tableOfContentsBlock:!0,presentZoom:!0,linkMetadata:!1,presentFullWidth:!1,presentScaleFont:!1,renderCollapsedCards:!0,cardLayoutsEnabled:!0,presentFullScreen:!1,docFullWidth:!1,aiAutocomplete:!1,aiRewrite:!1,aiCardDesigner:!1,aiWizard:!0,aiWizardLegacy:!1,aiWizardGenerateTimeout:12e4,aiWizardAdvanced:!0,aiWizardOutlineMaxWait:12e3,aiWizardAverageWaitGuided:20,aiWizardAverageWaitAdvanced:60,aiWizardStreaming:!0,aiWizardUnsplashImages:!1,aiWizardGoogleImages:!1,aiWizardBingImages:!1,aiWizardWebImages:!1,webImageProviderType:"2",aiWizardUploadImages:!0,aiPremiumModels:!1,aiChat:!0,aiChatJsx:!1,aiChatEditCardPrompt:!1,aiThemeWizard:!1,bulkUploadAccentImages:!1,aiDebits:l(31684).rA,"ai-credits":{enabled:!1,referralBonus:100,signup:400},publishing:!1,lexicaImageSearch:!1,webImageSearch:!1,signupRedirectTo:"CREATE",openAiStatus:"NORMAL",aiRequestTimeouts:{getOutlineForTopic:4500,classify:5e3,basicReply:5e3,suggestContent:12e3,rateImages:5e3},aiRequestRetries:{wizard:0,wizardAdvanced:0,wizardStreaming:2,chat:3},docEditorForcePublicStatic:!1,pptImport:!0,pptImportDebug:!1,hasProAccess:!1,upsellUXEnabled_Pro:!1,upsellUXEnabled_Plus:!1,"plus-credits":{creditsToAdd:400,enabled:!1},monthlyBillingEnabled:!1,autoZoomToFit:!0,azureOpenAI:!0,passwordProtectedDoc:!1,passwordSignup:!0,docCustomCode:!1,aiGeneratedImages:!0,aiGeneratedImagesCount:1,aiGeneratedImagesInWizard:!0,aiGeneratedImagesDefaultModel:"imagen-3-flash",aiGeneratorDefaultImageProvider:"aiGenerated",aiGeneratedImagesAdvancedOptions:!1,automatedImageProvider:!1,aiImageProviderGiphy:!1,aiImageProviderUnsplash:!1,aiImageProviderPictographic:!1,permanentlyDeleteDoc:!1,i18nEnabled:!1,outageButterbar:{enabled:!1},filmstrip:!0,streamResumingEnabled:!0,sites:!0,sitesNav:!0,circleSmartLayouts:!1,generatorLazyImages:!0,generatorBigModelAlways:!1,imgProxy:!0,recaptcha:{enabled:!0,checkboxRiskLevels:["medium"]},mobileEditing:!1,churnkeyCancelFlowEnabled:!1,churnkeyFailedPaymentWallEnabled:!1,createGenerateV2:!0,cardNotes:!0,defaultAnnualBilling:!0,editorAnimationsEnabled:!1,editorAnimationsDefault:!1,siteAnimationsEnabled:!1,createSiteAi:!0,generateParallel:!0,generateDeckPrompt:"GenerateDeck1.5",generateDeckParallelPrompt:"GenerateDeckParallel",generateOutlineModel:"claude-3-haiku-20240307",generateOutlineSearchModel:"sonar",generateOutlinePrompt:"GenerateOutlineSimple",generateDeckFastModel:"claude-3-haiku-20240307",generateDeckBigModel:"claude-3-5-sonnet-20240620",generateDeckPreserveModel:"claude-3-5-sonnet-20240620",generateDeck3Model:"claude-3-haiku-20240307",generateDeckMaxCards:50,googleSlidesExport:!1,editCardModel:"gemini-1.5-flash-001",uploadThemeImagesToProd:!1,addCard2:!0,imagen3:!0,imagenFlash:!0,linkedInPost:!1,playgroundModel:!0,playground3:!1,flux1Schnell:!0,flux1Ultra:!1,flux1Pro:!0,flux1Quick:!1,ideogram:!0,sdxlModel:!1,dalle3:!1,leonardoPhoenix:!1,lumaPhoton:!1,pptImportV2:!1,importUrl:!0,importPdf:!0,enableCharts:!0,cardTemplatesPlaceholder:!0,hocuspocusOnAuthenticate:!0,knownGoodHostnames:[],aiCardNotes:!1,editCard2:!0,editDocAI:!1,changelog:!1,filterContentErasingTrs:!1,export:!0,waitForGammaPersistenceMeta:!0,linksV2:!1,changePlanModal:!0,purchaseDomain:!1,useTransactionBlockPlugin:!1,themeImportAi:!0,transactionalFilmstrip:!0,galleryV2:!0,googleOneTap:!1,pyimportPptNonVisualImport:!1,aiSearchInGenerate:!1,aiSearchMode:"disabled",aiSearchProvider:"exa-keyword",chartInlineLabels:!0,pictographicImageSearch:!1,aiSocialFormat:!0,importPptModels:{bigModel:"gemini-1.5-pro-002",fastModel:"gemini-1.5-flash-002"},presentModeCursor:!1,socialFormat:!0,themeTextPreviewSVGs:!1,growthSkipThemePickerOnFirstDeck:!1,recraftModel:!1,recraftSvgModel:!1,createWithAiSplashV2:!1,"doc-zoom":!0,scaleToFit:!0,scalePresentationsToFit:!1,enableVirtualization:!0,virtualizeEmbeds:!1,aiImageEditing:!1,blockVariableFontUpload:!1,aiRenderGeneration:!1}},33854:(e,t,l)=>{"use strict";l.d(t,{m:()=>i,u:()=>o});var a=l(14041),n=l(32899);function o(e){let[t,l]=(0,a.useState)(n.of.get(e));return(0,a.useEffect)(()=>(n.of.hasInitialized||n.of.initializePromise.then(()=>{l(n.of.get(e))}),n.of.subscribe(e,e=>{l(e)})),[e]),t}function i(){let[e,t]=(0,a.useState)(n.of.all());return(0,a.useEffect)(()=>n.of.onChange(()=>{t(n.of.all())}),[]),e}},65998:(e,t,l)=>{"use strict";l.d(t,{of:()=>D.of,Gm:()=>g.Gm,Ew:()=>g.Ew,mt:()=>$.m,u:()=>$.u});var a=l(31085),n=l(25420),o=l(19098),i=l(64444),r=l(48574),s=l(95986),d=l(14041),u=l(73893),c=l(60204),m=l(62849),f=l(88957),p=l(86724),g=l(33264),h=l(80532),b=l(78354);let y=()=>{let e=(0,f.GV)(g.RH),t=(0,b.ah)(),[l,o]=(0,d.useState)({width:0,height:0});return((0,d.useEffect)(()=>{let e=()=>{o({width:window.innerWidth,height:window.innerHeight})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e)?(0,a.jsx)(h.az,{position:"fixed",bottom:"0px",left:"100px",px:"4",py:"2",bg:"gray.800",color:"white",zIndex:"1500",fontSize:"xs",borderTopRadius:"lg",_hover:{opacity:1},textAlign:"center",cursor:"default",children:(0,a.jsxs)(n.s,{alignItems:"center",gap:2,children:[(0,a.jsx)(h.az,{children:t}),(0,a.jsxs)(h.az,{children:["(",l.width,"px \xd7 ",l.height,"px)"]})]})}):null};var v=l(93185),k=l(2600),w=l(70323),x=l(49547),S=l(22218),A=l(2219),C=l(59835),z=l(80853),I=l(6256),j=l(76166),F=l(20671),B=l(35436),R=l(9021),_=l(67419),M=l(62313),E=l(74727),T=l(20501),O=l(24221),P=l(68973),N=l(60490),D=l(32899),L=l(61778),W=l(88865);let U=(0,d.memo)(e=>{let{flagKey:t,source:l,currentValue:o,overrideValue:i}=e;return(0,a.jsxs)(n.s,{justify:"space-between",align:"center",children:[(0,a.jsxs)(h.az,{children:[(0,a.jsx)(L.E,{children:(0,a.jsx)("strong",{children:t})}),(0,a.jsx)(W.S,{isChecked:void 0!==i,onChange:e=>{e.target.checked?D.of.overrideFlag(t,o):D.of.removeOverride(t)},children:(0,a.jsx)(L.E,{as:"span",fontSize:"sm",color:"gray.700",children:"override"})})]}),(0,a.jsx)(n.s,{direction:"column",align:"stretch",children:(0,a.jsx)(x.MJ,{display:"flex",flexDirection:"row",justifyContent:"flex-end",children:(0,a.jsxs)(n.s,{direction:"column",alignItems:"flex-end",children:[(0,a.jsx)(L.E,{fontSize:10,fontStyle:"italic",children:l}),(0,a.jsx)(C.d,{id:"".concat(t,"-switch"),isDisabled:void 0===i,isChecked:!!o,onChange:e=>{D.of.overrideFlag(t,e.target.checked)}})]})})})]})});U.displayName="FeatureFlagListItem";var G=l(3706),H=l(27670);let V="production"!==u.$.APPLICATION_ENVIRONMENT||u.$.DEBUG_ENABLED,q=()=>{if(!V)return null;let e=u.$.NEXT_PUBLIC_VERCEL_GIT_COMMIT_MESSAGE?(0,a.jsxs)(L.E,{children:["Commit message for this build: ",(0,a.jsx)("br",{}),u.$.NEXT_PUBLIC_VERCEL_GIT_COMMIT_MESSAGE]}):null;return(0,a.jsx)(s.Tz,{placement:"top",label:e,children:(0,a.jsx)(G.N,{href:u.$.NEXT_PUBLIC_VERCEL_URL,target:"_blank",children:(0,a.jsxs)(H.E,{colorScheme:"orange",children:["SHA: ",u.$.GIT_SHA]})})})},K=()=>{let[e,t]=(0,d.useState)(D.of.explain());return(0,d.useEffect)(()=>(D.of.hasInitialized||D.of.initializePromise.then(()=>{t(D.of.explain())}),D.of.onChange(()=>{t(D.of.explain())})),[]),e},J=(0,d.memo)(e=>{let{initialFocusRef:t}=e,l=(0,f.jL)(),{setSettings:n}=(0,N.ur)(),o=K(),i=D.of.all(),[r,s]=(0,d.useState)(""),u=(0,f.GV)(P.vM),c=(0,f.GV)(g.RH),m=(0,f.GV)(g.Ew),p=(0,f.GV)(g.Gm),[h,b]=(0,d.useState)(!1);if(h)throw Error("[FeatureFlagPanel]: Render Error");let y=o.filter(e=>""===r||e.key.toLocaleLowerCase().indexOf(r.trim())>-1),L=(0,d.useCallback)(e=>{l((0,P.n9)({isActive:e}))},[l]),W=(0,d.useCallback)(e=>{l((0,g.zR)({showBreakpoint:e}))},[l]),G=(0,d.useCallback)(e=>{l((0,g.kj)({showProsemirrorDevTools:e}))},[l]),H=(0,d.useCallback)(e=>{l((0,g.O$)({showDebugCardView:e}))},[l]);return(0,a.jsxs)(v.h,{bg:"white",p:3,width:"max(30vw, 300px)",flexDirection:"column",children:[(0,a.jsxs)(k.T,{align:"start",p:2,children:[(0,a.jsx)(q,{}),(0,a.jsx)(w.c,{}),(0,a.jsxs)(x.MJ,{flexDirection:"row",display:"flex",alignItems:"center",children:[(0,a.jsx)(S.l,{fontSize:"xs",flex:1,m:0,children:(0,a.jsxs)(A.D,{size:"xs",children:[(0,a.jsx)("span",{"aria-label":"QA localization",role:"img",children:"\uD83C\uDF0E"})," ","QA localization"]})}),(0,a.jsx)(C.d,{isChecked:u,onChange:e=>{L(e.target.checked)}})]}),(0,a.jsxs)(x.MJ,{flexDirection:"row",display:"flex",alignItems:"center",children:[(0,a.jsx)(S.l,{fontSize:"xs",flex:1,m:0,children:(0,a.jsxs)(A.D,{size:"xs",children:[(0,a.jsx)("span",{"aria-label":"Debug breakpoints",role:"img",children:"\uD83D\uDDA5️"})," ","Debug breakpoints"]})}),(0,a.jsx)(C.d,{isChecked:c,onChange:e=>{W(e.target.checked)}})]}),(0,a.jsxs)(x.MJ,{flexDirection:"row",display:"flex",alignItems:"center",children:[(0,a.jsx)(S.l,{fontSize:"xs",flex:1,m:0,children:(0,a.jsxs)(A.D,{size:"xs",children:[(0,a.jsx)("span",{"aria-label":"Prosemirror dev tools",role:"img",children:"\uD83E\uDD9C"})," ","Prosemirror dev tools"]})}),(0,a.jsx)(C.d,{isChecked:m,onChange:e=>{G(e.target.checked)}})]}),(0,a.jsxs)(x.MJ,{flexDirection:"row",display:"flex",alignItems:"center",children:[(0,a.jsx)(S.l,{fontSize:"xs",flex:1,m:0,children:(0,a.jsxs)(A.D,{size:"xs",children:[(0,a.jsx)("span",{"aria-label":"Debug card view",role:"img",children:"\uD83C\uDCCF"})," ","Debug card view"]})}),(0,a.jsx)(C.d,{isChecked:p,onChange:e=>{H(e.target.checked)}})]}),(0,a.jsx)(x.MJ,{flexDirection:"row",display:"flex",justifyContent:"flex-end",children:(0,a.jsxs)(z.$,{size:"sm",onClick:()=>{null==n||n({remove:["locale","localeToastSeen"]})},children:["Clear locale \xa0 ",(0,a.jsx)(I.C,{children:"user.settings"})]})}),(0,a.jsx)(w.c,{}),(0,a.jsx)(A.D,{size:"xs",children:"Feature Flags"}),(0,a.jsxs)(j.M,{size:"sm",children:[(0,a.jsx)(F.p,{ref:t,pr:"1.5rem",type:"text",placeholder:"Filter",value:r,onChange:e=>s(e.target.value)}),(0,a.jsx)(B.t,{width:"2rem",children:(0,a.jsx)(R.K,{variant:"ghost",size:"xs",onClick:()=>s(""),icon:(0,a.jsx)(O.g,{icon:T.Qbn}),"aria-label":"clear"})})]})]}),(0,a.jsxs)(k.T,{align:"stretch",overflowY:"auto",h:"55vh",justify:"space-between",spacing:4,children:[(0,a.jsx)(k.T,{p:2,align:"stretch",divider:(0,a.jsx)(_.G,{borderColor:"gray.200"}),children:y.filter(e=>"boolean"===e.type).map(e=>{let t=i[e.key];return(0,a.jsx)(U,{currentValue:t,source:e.source,flagKey:e.key,overrideValue:e.overrideValue},e.key)})}),(0,a.jsxs)(k.T,{align:"start",mt:8,children:[(0,a.jsx)(A.D,{size:"xs",children:"Debugging"}),(0,a.jsx)(M.z,{mb:3,children:(0,a.jsxs)(E.e,{variant:"plain",size:"xs",flexWrap:"wrap",children:[(0,a.jsx)(z.$,{onClick:()=>{throw Error("[FeatureFlagPanel] SyncError")},children:"Throw global err"}),(0,a.jsx)(z.$,{onClick:()=>{b(!0)},children:"Throw render err"}),(0,a.jsx)(z.$,{onClick:()=>{new Promise(e=>setTimeout(e,100)).then(()=>{throw Error("[FeatureFlagPanel] UnhandledPromiseException")})},children:"Throw promise err"})]})})]})]})]})});J.displayName="FeatureFlagPanel",(0,d.memo)(()=>{let e=(0,d.useRef)(null),{isGammaOrgUser:t}=(0,c.u)();return(function(){let e=(0,f.jL)(),t=(0,f.GV)(g.RH),[l,a]=(0,p.M)("showBreakpoint",!1);(0,d.useEffect)(()=>{l&&e((0,g.zR)({showBreakpoint:!0}))},[e,l]),(0,d.useEffect)(()=>{a(t)},[a,t])}(),function(){let e=(0,f.jL)(),t=(0,f.GV)(g.Ew),[l,a]=(0,p.M)("showProsemirrorDevTools",!1);(0,d.useEffect)(()=>{l&&e((0,g.kj)({showProsemirrorDevTools:!0}))},[e,l]),(0,d.useEffect)(()=>{a(t)},[a,t])}(),function(){let e=(0,f.jL)(),t=(0,f.GV)(g.Gm),[l,a]=(0,p.M)("showDebugCardView",!1);(0,d.useEffect)(()=>{l&&e((0,g.O$)({showDebugCardView:!0}))},[e,l]),(0,d.useEffect)(()=>{a(t)},[a,t])}(),(0,d.useEffect)(()=>{!0===t&&(window.gammaDebug=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];document.cookie="gammadebug=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/",document.cookie="gammadebug=; expires=Thu, 01 Jan 1970 00:00:01 GMT; path=/docs";let t=new Date;t.setTime(t.getTime()+7776e6),document.cookie="gammadebug=".concat(e?"gtpwtw":"false","; expires=").concat(t.toUTCString(),"; path=/"),e!==u.$.DEBUG_ENABLED&&window.location.reload()})},[t]),(0,m.En)()&&u.$.DEBUG_ENABLED)?(0,a.jsx)(n.s,{zIndex:"overlay",position:"fixed",bottom:"16px",insetInlineStart:"16px",children:(0,a.jsx)(o.A,{placement:"top",initialFocusRef:e,children:t=>{let{isOpen:l}=t;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.Tz,{label:"Feature Flags",children:(0,a.jsx)(i.W,{children:(0,a.jsx)(r.e,{tabIndex:0,_focus:{shadow:"outline"},transitionProperty:"common",transitionDuration:"normal",width:"40px",height:"40px",src:"https://res.cloudinary.com/bizzaboprod/image/upload/q_auto:best,c_crop,g_custom/v1560896151/yecilv8jlrtehq3zmea2.png",shadow:"base",outline:"none",alignItems:"center",flexDirection:"column",cursor:"pointer",opacity:0,_hover:{shadow:"0 0 0 3px #CBD5E0",opacity:1},...l&&{shadow:"0 0 0 3px #CBD5E0",opacity:1}})})}),(0,a.jsx)(J,{initialFocusRef:e}),(0,a.jsx)(y,{})]})}})}):null}).displayName="FeatureFlagDevtoolBall";var $=l(33854);l(91559),l(78821),l(44507),l(69087),l(2313),l(18191)},33264:(e,t,l)=>{"use strict";l.d(t,{Ew:()=>c,Ff:()=>f,Gm:()=>m,O$:()=>d,RH:()=>u,kj:()=>s,zR:()=>r});var a=l(8796);let n={isDocWorkspaceSet:!1,showBreakpoint:!1,showProsemirrorDevTools:!1,showDebugCardView:!1},o=(0,a.Z0)({name:"FeatureFlags",initialState:n,reducers:{reset:()=>n,setIsDocWorkspaceSet(e,t){let{isDocWorkspaceSet:l}=t.payload;e.isDocWorkspaceSet=l},setShowBreakpoint(e,t){let{showBreakpoint:l}=t.payload;e.showBreakpoint=l},setShowProsemirrorDevTools(e,t){let{showProsemirrorDevTools:l}=t.payload;e.showProsemirrorDevTools=l},setShowDebugCardView(e,t){let{showDebugCardView:l}=t.payload;e.showDebugCardView=l}}}),{setIsDocWorkspaceSet:i,setShowBreakpoint:r,setShowProsemirrorDevTools:s,setShowDebugCardView:d}=o.actions,u=e=>e.FeatureFlags.showBreakpoint,c=e=>e.FeatureFlags.showProsemirrorDevTools,m=e=>e.FeatureFlags.showDebugCardView,f=o.reducer},2313:(e,t,l)=>{"use strict";l.d(t,{fi:()=>a}),l(25827);let a=(e,t)=>{let l={};for(let a in e)t&&void 0===t[a]||(l[a]=e[a].current);return l}},30504:(e,t,l)=>{"use strict";l.d(t,{a:()=>W,c:()=>L});var a=l(31085),n=l(14041),o=l(56824),i=l(70652),r=l(76069),s=l(90534),d=l(31659),u=l(78758),c=l(26848),m=l(19098),f=l(98903),p=l(80532),g=l(93185),h=l(32351),b=l(62313),y=l(2219),v=l(79967),k=l(97864),w=l(92515),x=l(57812),S=l(19727),A=l(71792),C=l(96502),z=l(20501),I=l(24221),j=l(95986),F=l(52177),B=l(23832),R=l(61778),_=l(3040),M=l(12327);let E=e=>{let{prefix:t="",support:l="",suffix:n=""}=e;return(0,a.jsxs)(R.E,{children:[t,(0,a.jsx)(R.E,{color:"gray.400",as:"span",children:l}),n]})},T=()=>[{description:(0,a.jsx)(F.x6,{id:"8aebws"}),shortcut:"/"},{description:(0,a.jsx)(F.x6,{id:"JZEY8K"}),shortcut:"Mod+Shift+O"},{description:(0,a.jsx)(F.x6,{id:"3Lpas4"}),shortcut:"***"},{description:(0,a.jsx)(F.x6,{id:"e+t/xM"}),shortcut:"Mod+P"},{description:(0,a.jsx)(F.x6,{id:"MF+p5R"}),shortcut:"Mod+Enter"},{description:(0,a.jsx)(F.x6,{id:"NiZZRh"}),shortcut:"Mod+K"},{description:(0,a.jsx)(F.x6,{id:"4J90L0"}),shortcut:(0,a.jsx)(E,{prefix:"@",support:"name"})},{description:(0,a.jsx)(F.x6,{id:"1fOM5v"}),shortcut:(0,a.jsx)(E,{prefix:"@",support:"cardTitle"})}],O=()=>[{description:(0,a.jsx)(F.x6,{id:"MHrjPM"}),shortcut:"/title"},{description:(0,a.jsx)(F.x6,{id:"lXKZGw"}),shortcut:["#","Mod+Alt+1"]},{description:(0,a.jsx)(F.x6,{id:"El7NbA"}),shortcut:["##","Mod+Alt+2"]},{description:(0,a.jsx)(F.x6,{id:"SFN6dN"}),shortcut:["###","Mod+Alt+3"]},{description:(0,a.jsx)(F.x6,{id:"nJeKmw"}),shortcut:["####","Mod+Alt+4"]},{description:(0,a.jsx)(F.x6,{id:"yzF66j"}),shortcut:"Mod+K"},{description:(0,a.jsx)(F.x6,{id:"QpoxX6",components:{0:(0,a.jsx)("span",{role:"img","aria-label":M.Ru._({id:"ssT83y"})})}}),shortcut:(0,a.jsx)(E,{prefix:":",support:"heart_eyes",suffix:":"})},{description:(0,a.jsx)(F.x6,{id:"KmydK6"}),shortcut:[(0,a.jsx)(E,{prefix:"*",support:"bold",suffix:"*"},"0"),"Mod+B"]},{description:(0,a.jsx)(F.x6,{id:"pzutoc"}),shortcut:[(0,a.jsx)(E,{prefix:"_",support:"italic",suffix:"_"},"0"),"Mod+I"]},{description:(0,a.jsx)(F.x6,{id:"YyXtnN"}),shortcut:"Mod+U"},{description:(0,a.jsx)(F.x6,{id:"WhOsNE"}),shortcut:"Mod+Shift+X"},{description:(0,a.jsx)(F.x6,{id:"VjjKVj"}),shortcut:"Mod+Shift+L"},{description:(0,a.jsx)(F.x6,{id:"95ckMP"}),shortcut:"Mod+Shift+E"},{description:(0,a.jsx)(F.x6,{id:"vTKw81"}),shortcut:"Mod+Shift+R"},{description:(0,a.jsx)(F.x6,{id:"Gc5apx"}),shortcut:[(0,a.jsx)(E,{prefix:"`",support:"code",suffix:"`"},"0"),"Mod+E"]},{description:(0,a.jsx)(F.x6,{id:"sFkOYO"}),shortcut:[(0,a.jsx)(E,{prefix:"$",support:"x^2",suffix:"$ "},"0"),"$$ "]},{description:(0,a.jsx)(F.x6,{id:"eKJQi9"}),shortcut:"Mod+Shift+H"},{description:(0,a.jsx)(F.x6,{id:"M3G9ZD"}),shortcut:["1. ","Mod+/","Mod+Shift+7"]},{description:(0,a.jsx)(F.x6,{id:"ynb7Kh"}),shortcut:["- ","Mod+.","Mod+Shift+8"]},{description:(0,a.jsx)(F.x6,{id:"rCIbrq"}),shortcut:["[] ","Mod+,","Mod+Shift+9"]},{description:(0,a.jsx)(F.x6,{id:"dOxPd4"}),shortcut:[(0,a.jsx)(E,{prefix:"^",support:"note",suffix:"^"},"0"),"Mod+Alt+F"]}],P=()=>[{description:(0,a.jsx)(F.x6,{id:"9xCxY6"}),shortcut:["←","→"]},{description:(0,a.jsx)(F.x6,{id:"6r2KAP"}),shortcut:["↑","↓"]},{description:(0,a.jsx)(F.x6,{id:"rEj/lx"}),shortcut:"Enter"},{description:(0,a.jsx)(F.x6,{id:"IkakN2"}),shortcut:"Esc"},{description:(0,a.jsx)(F.x6,{id:"dQU33K"}),shortcut:"Mod+Shift+O"},{description:(0,a.jsx)(F.x6,{id:"CgmvBu"}),shortcut:"S"},{description:(0,a.jsx)(F.x6,{id:"K0Oq/D"}),shortcut:"R"},{description:(0,a.jsx)(F.x6,{id:"q8Gtmt",components:{0:(0,a.jsx)("br",{})}}),shortcut:(0,a.jsx)(I.g,{icon:_.svs})}],N={borderColor:"gray.100",py:2,px:2},D={borderColor:"gray.700",py:2,px:2},L=e=>{let{list:t}=e,l=(0,o.dU)(N,D),m={bg:(0,o.dU)("gray.50","gray.800"),borderColor:(0,o.dU)("gray.200","gray.600"),color:(0,o.dU)("gray.800","white")};return(0,a.jsx)(i.K,{w:"100%",children:(0,a.jsx)(r.X,{variant:"simple",children:(0,a.jsx)(s.N,{children:t.map((e,t)=>{let{shortcut:o,description:i}=e;return(0,a.jsxs)(d.Tr,{children:[(0,a.jsx)(u.Td,{w:"60%",...l,children:i}),(0,a.jsx)(u.Td,{w:"40%",...l,children:Array.isArray(o)?o.map((e,t)=>(0,n.createElement)(c.u,{...m,display:"inline-block",px:2,py:1,mr:1,key:t},"string"==typeof e?(0,j.lp)(e):e)):"string"==typeof o?(0,a.jsx)(c.u,{...m,display:"inline-block",px:2,py:1,children:(0,j.lp)(o)}):(0,a.jsx)(c.u,{...m,display:"inline-block",px:2,py:1,children:o})})]},t)})})})})},W=e=>{let{isOpen:t,onClose:l}=e,n=(0,B.n)(O),i=(0,B.n)(P),r=(0,B.n)(T),s=(0,o.dU)("white","gray.900"),d=(0,o.dU)("gray.800","white"),u=(0,o.dU)("gray.100","gray.700");return(0,a.jsxs)(m.A,{returnFocusOnClose:!1,closeOnBlur:!1,placement:"top",isOpen:t,onClose:l,modifiers:[{name:"computeStyles",options:{gpuAcceleration:!1}}],children:[(0,a.jsx)(f.d,{children:(0,a.jsx)(p.az,{position:"fixed",bottom:0,right:0})}),(0,a.jsxs)(g.h,{zIndex:"menu",h:"80vh",w:"400px",flex:1,position:"relative",bgColor:s,color:d,borderColor:u,children:[(0,a.jsxs)(h.D,{border:"0 none",mb:2,position:"sticky",bgColor:s,children:[(0,a.jsxs)(b.z,{spacing:2,children:[(0,a.jsx)(I.g,{icon:z.Lhe}),(0,a.jsx)(y.D,{size:"md",children:(0,a.jsx)(F.x6,{id:"CTqTgr"})})]}),(0,a.jsx)(v.q,{})]}),(0,a.jsx)(k.e,{overflowY:"auto",children:(0,a.jsxs)(w.t,{variant:"soft-rounded",size:"sm",isFitted:!0,children:[(0,a.jsxs)(x.w,{mb:6,children:[(0,a.jsxs)(S.o,{children:[(0,a.jsx)(p.az,{mr:2,children:(0,a.jsx)(I.g,{icon:z.zLW})}),(0,a.jsx)(F.x6,{id:"vVRhxh"})]}),(0,a.jsxs)(S.o,{children:[(0,a.jsx)(p.az,{mr:2,children:(0,a.jsx)(I.g,{icon:z.qon})}),(0,a.jsx)(F.x6,{id:"UodEcE"})]})]}),(0,a.jsxs)(A.T,{children:[(0,a.jsxs)(C.K,{p:0,pb:1,mt:4,children:[(0,a.jsx)(L,{list:r}),(0,a.jsx)(j._x,{pt:4,pb:4,children:(0,a.jsx)(F.x6,{id:"Bb47jg"})}),(0,a.jsx)(L,{list:n})]}),(0,a.jsx)(C.K,{p:0,pb:1,mt:4,children:(0,a.jsx)(L,{list:i})})]})]})})]})]})}},23071:(e,t,l)=>{"use strict";l.d(t,{J:()=>a});let a="support@gamma.app"},15139:(e,t,l)=>{"use strict";l.d(t,{Wf:()=>o,c8:()=>i,g5:()=>r,uE:()=>a});let a=new(l(36832)).b,n={url:window.location.href,method:null,hashChanged:!1},o=()=>{window.addEventListener("popstate",()=>{let e=new URL(n.url).hash!==window.location.hash;n.method="pop",n.url=window.location.href,n.hashChanged=e,a.emit("changed",{...n,state:window.history.state})},!1)},i=e=>{s({...e,method:"push"})},r=e=>{s({...e,method:"replace"})},s=e=>{let{pathname:t,query:l,hash:o,method:i,emitChange:r=!0,data:s={}}=e,d=new URL(window.location.href);if(void 0!==t&&(d.pathname=t),void 0!==o&&(d.hash=o),void 0!==l){for(let[e]of[...d.searchParams.entries()])d.searchParams.delete(e);for(let[e,t]of Object.entries(l))t&&"string"==typeof t&&d.searchParams.set(e,t);d.searchParams.sort()}let u={...window.history.state,...s,as:"".concat(d.pathname),url:d.toString()},c=d.hash!==window.location.hash;"push"===i?window.history.pushState(u,"",d.toString()):window.history.replaceState(u,"",d.toString()),n.url=d.toString(),n.method=i,n.hashChanged=c,r&&a.emit("changed",{...n,state:window.history.state})}},83479:(e,t,l)=>{"use strict";l.d(t,{Wf:()=>a.Wf,c8:()=>a.c8,g5:()=>a.g5,uE:()=>a.uE});var a=l(15139)},3204:(e,t,l)=>{"use strict";l(31242),l(14041),l(15139)},42948:(e,t,l)=>{"use strict";l.d(t,{AT:()=>r,jA:()=>i,jF:()=>s,tF:()=>d,zd:()=>u});let a="2022-11-20",n="2023-11-20",o="2024-11-20",i="en",r={ar:"private_beta",bg:"public_beta",bs:"public_beta",cs:"public_beta",da:"public_beta",de:"public_beta",en:"ga",el:"public_beta",es:"ga",et:"public_beta",fa:"private_beta",fi:"public_beta",fr:"ga",he:"private_beta",hi:"public_beta",hr:"public_beta",hu:"public_beta",id:"public_beta",it:"public_beta",ja:"ga",kn:"public_beta",ko:"ga",lt:"public_beta",lv:"public_beta",nl:"public_beta",no:"public_beta",pl:"public_beta","pt-br":"ga",ro:"public_beta",ru:"public_beta",sl:"public_beta",sq:"public_beta",sr:"public_beta",sv:"public_beta",th:"public_beta",tl:"public_beta",tr:"public_beta",uk:"public_beta",ur:"private_beta",uz:"public_beta",vi:"public_beta","zh-cn":"ga","zh-tw":"ga"},s=[i,"ar","bg","bs","cs","da","de","el","es","et","fa","fi","fr","he","hi","hr","hu","id","it","ja","kn","ko","lt","lv","nl","no","pl","pt-br","ro","ru","sl","sq","sr","sv","th","tl","tr","ur","uk","uz","vi","zh-cn","zh-tw","pseudo-LOCALE"],d={default:i,PSEUDO_LOCALE_KEY:i,"de-at":"de","de-be":"de","de-li":"de","de-lu":"de","de-ch":"de","ja-jp":"ja","ko-kr":"ko","fr-be":"fr","fr-ca":"fr","fr-ch":"fr","fr-fr":"fr","fr-lu":"fr","fr-mc":"fr","pt-pt":"pt-br","zh-hans":"zh-cn","zh-sg":"zh-cn",zh:"zh-cn","zh-hant":"zh-tw","zh-hk":"zh-tw","zh-mo":"zh-tw","es-ar":"es","es-bo":"es","es-cl":"es","es-co":"es","es-cr":"es","es-do":"es","es-ec":"es","es-es":"es","es-gt":"es","es-hn":"es","es-mx":"es","es-ni":"es","es-pa":"es","es-pe":"es","es-pr":"es","es-py":"es","es-sv":"es","es-uy":"es","es-ve":"es"},u={[i]:{key:i,displayName:"English",displayNameLocalized:e=>e("English"),contextName:"English",launchDate:a},ar:{key:"ar",displayName:"العربية",displayNameLocalized:e=>e("Arabic"),contextName:"العربية",launchDate:o,rtl:!0},bg:{key:"bg",displayName:"Български",displayNameLocalized:e=>e("Bulgarian"),contextName:"Български",launchDate:o},bs:{key:"bs",displayName:"Bosanski",displayNameLocalized:e=>e("Bosnian"),contextName:"Bosanski",launchDate:o},cs:{key:"cs",displayName:"Čeština",displayNameLocalized:e=>e("Czech"),contextName:"Čeština",launchDate:o},da:{key:"da",displayName:"Dansk",displayNameLocalized:e=>e("Danish"),contextName:"Dansk",launchDate:o},de:{key:"de",displayName:"Deutsch",displayNameLocalized:e=>e("German"),contextName:"Deutsch",launchDate:n},es:{key:"es",displayName:"Espa\xf1ol",displayNameLocalized:e=>e("Spanish"),contextName:"espa\xf1ol",launchDate:a},el:{key:"el",displayName:"Ελληνικά",displayNameLocalized:e=>e("Greek"),contextName:"Ελληνικά",launchDate:o},et:{key:"et",displayName:"Eesti",displayNameLocalized:e=>e("Estonian"),contextName:"Eesti",launchDate:o},fa:{key:"fa",displayName:"فارسی",displayNameLocalized:e=>e("Farsi"),contextName:"فارسی",launchDate:o,rtl:!0},fi:{key:"fi",displayName:"Suomi",displayNameLocalized:e=>e("Finnish"),contextName:"Suomi",launchDate:o},fr:{key:"fr",displayName:"Fran\xe7ais",displayNameLocalized:e=>e("French"),contextName:"fran\xe7ais",launchDate:a},he:{key:"he",displayName:"עברית",displayNameLocalized:e=>e("Hebrew"),contextName:"עברית",launchDate:o,rtl:!0},hi:{key:"hi",displayName:"हिन्दी",displayNameLocalized:e=>e("Hindi"),contextName:"हिन्दी",launchDate:o},hr:{key:"hr",displayName:"Hrvatski",displayNameLocalized:e=>e("Croatian"),contextName:"Hrvatski",launchDate:o},hu:{key:"hu",displayName:"Magyar",displayNameLocalized:e=>e("Hungarian"),contextName:"Magyar",launchDate:o},id:{key:"id",displayName:"Bahasa Indonesia",displayNameLocalized:e=>e("Indonesian"),contextName:"Bahasa Indonesia",launchDate:n},it:{key:"it",displayName:"Italiano",displayNameLocalized:e=>e("Italian"),contextName:"Italiano",launchDate:o},ja:{key:"ja",displayName:"日本語",displayNameLocalized:e=>e("Japanese"),contextName:"日本語",launchDate:a},kn:{key:"kn",displayName:"ಕನ್ನಡ",displayNameLocalized:e=>e("Kannada"),contextName:"ಕನ್ನಡ",launchDate:o},ko:{key:"ko",displayName:"한국어",displayNameLocalized:e=>e("Korean"),contextName:"한국어",launchDate:a},lt:{key:"lt",displayName:"Lietuvių",displayNameLocalized:e=>e("Lithuanian"),contextName:"Lietuvių",launchDate:o},lv:{key:"lv",displayName:"Latviešu",displayNameLocalized:e=>e("Latvian"),contextName:"Latviešu",launchDate:o},no:{key:"no",displayName:"Norsk",displayNameLocalized:e=>e("Norwegian"),contextName:"Norsk",launchDate:o},nl:{key:"nl",displayName:"Nederlands",displayNameLocalized:e=>e("Dutch"),contextName:"Nederlands",launchDate:o},pl:{key:"pl",displayName:"Polski",displayNameLocalized:e=>e("Polish"),contextName:"Polski",launchDate:o},"pt-br":{key:"pt-br",displayName:"Portugu\xeas (Brasil)",displayNameLocalized:e=>e("Portuguese (Brazil)"),contextName:"portugu\xeas",launchDate:a},ro:{key:"ro",displayName:"Rom\xe2nă",displayNameLocalized:e=>e("Romanian"),contextName:"Rom\xe2nă",launchDate:o},ru:{key:"ru",displayName:"Русский",displayNameLocalized:e=>e("Russian"),contextName:"Русский",launchDate:n},sl:{key:"sl",displayName:"Slovenščina",displayNameLocalized:e=>e("Slovenian"),contextName:"Slovenščina",launchDate:o},sq:{key:"sq",displayName:"Shqip",displayNameLocalized:e=>e("Albanian"),contextName:"Shqip",launchDate:o},sr:{key:"sr",displayName:"Српски",displayNameLocalized:e=>e("Serbian"),contextName:"Српски",launchDate:o},sv:{key:"sv",displayName:"Svenska",displayNameLocalized:e=>e("Swedish"),contextName:"Svenska",launchDate:o},th:{key:"th",displayName:"ไทย",displayNameLocalized:e=>e("Thai"),contextName:"ไทย",launchDate:n},tl:{key:"tl",displayName:"Tagalog",displayNameLocalized:e=>e("Tagalog"),contextName:"Tagalog",launchDate:o},tr:{key:"tr",displayName:"T\xfcrk\xe7e",displayNameLocalized:e=>e("Turkish"),contextName:"T\xfcrk\xe7e",launchDate:n},uk:{key:"uk",displayName:"Українська",displayNameLocalized:e=>e("Ukrainian"),contextName:"Українська",launchDate:o},ur:{key:"ur",displayName:"اردو",displayNameLocalized:e=>e("Urdu"),contextName:"اردو",launchDate:o,rtl:!0},uz:{key:"uz",displayName:"O‘zbek",displayNameLocalized:e=>e("Uzbek"),contextName:"O‘zbek",launchDate:o},vi:{key:"vi",displayName:"Tiếng Việt",displayNameLocalized:e=>e("Vietnamese"),contextName:"Tiếng Việt",launchDate:o},"zh-cn":{key:"zh-cn",displayName:"简体中文",displayNameLocalized:e=>e("Chinese (Simplified)"),contextName:"简体中文",launchDate:a},"zh-tw":{key:"zh-tw",displayName:"繁體中文",displayNameLocalized:e=>e("Chinese (Traditional)"),contextName:"繁體中文",launchDate:a}}},7908:(e,t,l)=>{"use strict";l.d(t,{KQ:()=>s,R_:()=>r,qm:()=>u,yz:()=>d});var a=l(12327),n=l(40074),o=l.n(n),i=l(42948);let r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=/[\u202A\u202D]/.test(e),l=/[\u202B\u202E]/.test(e);if(t)return"ltr";if(l)return"rtl";let a="֑-߿יִ-﷽ﹰ-ﻼ",n=e.match(new RegExp("[".concat("A-Za-z一-鿿㐀-䶿぀-ゟ゠-ヿ가-힯").concat(a,"]")));return n?new RegExp("[".concat(a,"]")).test(n[0])?"rtl":"ltr":null},s=e=>{let t=null,l=e=>{e.isText?t=r(e.text):e.forEach(e=>{null===t&&l(e)})};return l(e),t},d=e=>"rtl"===e?["right","left"]:["left","right"],u=()=>o()(Object.values(i.zd),e=>e.displayNameLocalized(a.Ru._.bind(a.Ru))).sort((e,t)=>e.key===i.jA?-1:t.key===i.jA?1:0)},83073:(e,t,l)=>{"use strict";l.d(t,{O:()=>o,j:()=>i});var a=l(88957),n=l(68973);let o=()=>(0,a.GV)(n.H6),i=()=>(0,n.H6)((0,a.KA)().getState())},67359:(e,t,l)=>{"use strict";l.d(t,{O:()=>i});var a=l(14041),n=l(88957),o=l(68973);let i=e=>{let t=(0,n.jL)();(0,a.useEffect)(()=>{t((0,o.dB)({locale:e||null}))},[e]),(0,a.useEffect)(()=>()=>{t((0,o.dB)({locale:null}))},[])}},23832:(e,t,l)=>{"use strict";l.d(t,{n:()=>o});var a=l(52177),n=l(14041);function o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=(0,a.uB)();return(0,n.useMemo)(e,[l,e,...t])}},64130:(e,t,l)=>{"use strict";l.d(t,{C:()=>s,fW:()=>i,ix:()=>r});var a=l(42948),n=l(83073);let o=e=>{var t;return(null===(t=a.zd[e])||void 0===t?void 0:t.rtl)===!0},i=()=>o((0,n.O)()),r=()=>o((0,n.j)()),s=()=>o((0,n.j)())?"rtl":"ltr"},39286:(e,t,l)=>{"use strict";l.d(t,{H9:()=>r,Ix:()=>o,Kc:()=>i,On:()=>a,PS:()=>c,TP:()=>n,Uq:()=>d,X4:()=>m,kO:()=>u,v2:()=>s});let a="Gamma",n="gamma",o="gammas",i="Pro",r="Plus",s="Free",d="Flux",u="Google",c="OpenAI",m="Ideogram"},68973:(e,t,l)=>{"use strict";l.d(t,{D6:()=>p,H6:()=>m,dB:()=>u,n9:()=>d,vM:()=>f});var a=l(8796);l(27042);var n=l(86724),o=l(14691),i=l(42948);let r={previewLocale:null,userDisplayLocale:(0,n.o)(o.E.gammaLocale,i.jA),pseudoLocaleActive:!1},s=(0,a.Z0)({name:"I18n",initialState:r,reducers:{reset:()=>r,setDisplayLocale(e,t){e.userDisplayLocale=t.payload.locale},setPreviewLocale(e,t){e.previewLocale=t.payload.locale},setPseudoLocaleActive(e,t){e.pseudoLocaleActive=t.payload.isActive}}}),{setPseudoLocaleActive:d,setPreviewLocale:u,setDisplayLocale:c}=s.actions,m=e=>e.I18n.userDisplayLocale,f=e=>e.I18n.pseudoLocaleActive,p=s.reducer},75660:(e,t,l)=>{"use strict";l.d(t,{v:()=>s});var a=l(12327),n=l(55640),o=l(78821),i=l(67238);let r=e=>(0,o.VB)(e)?"code":"symbol",s=(e,t)=>{let l=(0,i._Y)(),o=(null==t?void 0:t.currency)||n.SjR.Usd,s=r(o),d={style:"currency",maximumFractionDigits:e.toString().includes(".")?2:0,trailingZeroDisplay:"stripIfInteger",...t,currency:o,currencyDisplay:s};return l?a.Ru.number(e,d):e.toLocaleString(navigator.language,d)}},14979:(e,t,l)=>{"use strict";l.d(t,{Bo:()=>x,Gx:()=>w,R6:()=>v,Yq:()=>k});var a=l(12327),n=l(31497),o=l(77563),i=l(77470),r=l(90694),s=l(49423),d=l(39643),u=l(59524),c=l(8808),m=l(96950),f=l(18176),p=l(14905),g=l(16753),h=l(38345),b=l(41103);let y={ar:s.A,en:d.A,fa:u.A,"pt-br":c.A,ja:m.A,"zh-cn":f.A,"zh-tw":p.A,es:g.A,fr:h.A,ko:b.A},v=()=>y[a.Ru.locale]||void 0,k=(e,t)=>e?(0,n.A)((0,o.A)(e),t,{locale:v()}):"",w=(e,t)=>e?(0,i.A)((0,o.A)(e),t?(0,o.A)(t):new Date,{locale:v()}):"",x=e=>e?(0,r.A)((0,o.A)(e),{locale:v()}):""},67238:(e,t,l)=>{"use strict";l.d(t,{H:()=>r,_Y:()=>o});var a=l(42948);let n=()=>window.navigator.language.toLowerCase(),o=()=>{let e=n(),t=a.jF.includes(e)?e:a.tF[e];return"ga"===a.AT[t]},i=e=>{if(e){let t=e.toLowerCase();if(a.jF.includes(t))return t;if(void 0!==a.tF[t])return a.tF[t]}return a.jA},r=()=>i(n())},43006:(e,t,l)=>{"use strict";l.d(t,{k:()=>r});var a=l(14041),n=l(88957),o=l(92405),i=l(39698);let r=function(){let{initializeViaQuery:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{initializeViaQuery:!1},t=(0,n.jL)(),l=(0,a.useCallback)(()=>{let e=window.Intercom;e&&(e("show"),t((0,i.YN)({isOpen:!0})))},[t]);return(0,a.useEffect)(()=>{e&&"true"===(0,o.sF)()["get-support"]&&l()},[e,l]),l}},39698:(e,t,l)=>{"use strict";l.d(t,{Ff:()=>s,YN:()=>r});var a=l(8796);let n={isOpen:!1,hmac:null},o=(0,a.Z0)({name:"Intercom",initialState:n,reducers:{reset:()=>n,setIntercomHmac(e,t){e.hmac=t.payload},setIsIntercomOpen(e,t){let{isOpen:l}=t.payload;e.isOpen=l}}}),{setIntercomHmac:i,setIsIntercomOpen:r}=o.actions,s=o.reducer},38452:(e,t,l)=>{"use strict";l.d(t,{Tx:()=>i,WC:()=>o,Eb:()=>r});let a=["GLOBAL_SEARCH","ZOOMABLE_OVERLAY","SLIDE_VIEW","comment-feed","page-setup","chat","card-notes","DESIGN_PARTNER_PANEL","NAVIGATION_CONTROLS","PRESENT_BLOCK","pages","TABLE_OF_CONTENTS","FILMSTRIP","DOC_BLUR","SITE_PREVIEW_PANE","PRESENTER_VIEW"];class n{handleEvent(e,t){if(t.defaultPrevented&&t.target instanceof HTMLElement&&t.target.classList.contains("ProseMirror"))return!1;for(let l of this.listeners[e])if(!0===l.fn(t))return console.debug("[KeyboardHandler].handleEvent - handled by:",l),!0;return!1}initialize(){window.addEventListener("keydown",this.handleKeydown),window.addEventListener("keyup",this.handleKeyup)}reset(){window.removeEventListener("keydown",this.handleKeydown),window.removeEventListener("keyup",this.handleKeyup),this.listeners.keydown=[],this.listeners.keyup=[]}on(e,t,l){let n={scope:t,fn:l};return this.listeners[e]=this.listeners[e]||[],this.listeners[e].push(n),this.listeners[e].sort((e,t)=>a.indexOf(e.scope)-a.indexOf(t.scope)),()=>{let t=this.listeners[e].indexOf(n);t>-1&&this.listeners[e].splice(t,1)}}constructor(){this.listeners={keydown:[],keyup:[]},this.handleKeydown=e=>this.handleEvent("keydown",e),this.handleKeyup=e=>this.handleEvent("keyup",e)}}let o=new n;l(14041);let i=e=>(e.ctrlKey||e.metaKey)&&"z"===e.key,r=e=>{i(e)&&e.preventDefault()}},20221:(e,t,l)=>{"use strict";l.d(t,{Rz:()=>v,hU:()=>x,pH:()=>z,pE:()=>w,kO:()=>j,CX:()=>I,vp:()=>k});var a=l(12327),n=l(30795),o=l.n(n),i=l(73893),r=l(77914),s=l(65998),d=l(39286);let u={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/bfl.a86f9951.png",height:2256,width:2561,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAHCAMAAAACh/xsAAAAHlBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC3KG9qAAAACnRSTlMBQFJgcRSXuCaFPo2lFwAAAAlwSFlzAAALEwAACxMBAJqcGAAAADBJREFUeJwlxcENwDAMA7GTJdvJ/gsHRT8kAP0B1P73dTjAVU8ZFGkGeiuVDccuS3oOugCSP0iVmQAAAABJRU5ErkJggg==",blurWidth:8,blurHeight:7},c={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/google-gemini.9684c9bb.svg",height:28,width:28,blurWidth:0,blurHeight:0},m={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/playground.27314eb1.svg",height:30,width:25,blurWidth:0,blurHeight:0},f={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/recraft.93345919.svg",height:112,width:112,blurWidth:0,blurHeight:0},p="Recraft",g={creatorLabel:()=>"Ideogram",image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/ideogram.8efa42ed.svg",height:1e3,width:1e3,blurWidth:0,blurHeight:0},flag:"ideogram",provider:"ideogram"},h={creatorLabel:()=>"Luma",image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/luma.09345616.svg",height:500,width:500,blurWidth:0,blurHeight:0},flag:"lumaPhoton",provider:"luma"},b=["flux-1-schnell","flux-1-quick","imagen-3-flash"],y=["flux-1-pro","imagen-3-pro","ideogram-v2-turbo"],v={"stable-diffusion-xl-v1-0":{label:()=>"Stable Diffusion XL",description:()=>a.Ru._({id:"mJfk30"}),creatorLabel:()=>"Stability AI",image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/stability.ef6b22cb.svg",height:213,width:256,blurWidth:0,blurHeight:0},flag:"sdxlModel",fallbackModels:o()(b,"stable-diffusion-xl-v1-0"),minProductTier:"free",provider:"baseten",bestStyle:()=>a.Ru._({id:"6M03+0"}),bestType:()=>a.Ru._({id:"1HfW/F"}),speed:3},"playground-2.5":{label:()=>"Playground 2.5",description:()=>a.Ru._({id:"9B0yX5"}),creatorLabel:()=>"Playground",image:m,flag:"playgroundModel",fallbackModels:o()(b,"playground-2.5"),minProductTier:"free",provider:"playground",bestStyle:()=>a.Ru._({id:"+hJIb3"}),bestType:()=>a.Ru._({id:"1HfW/F"}),speed:3},"playground-3":{label:()=>"Playground 3",description:()=>a.Ru._({id:"eiiFXj"}),creatorLabel:()=>"Playground",image:m,flag:"playground3",fallbackModels:o()(y,"playground-3"),minProductTier:"plus",provider:"playground",bestStyle:()=>a.Ru._({id:"6M03+0"}),bestType:()=>a.Ru._({id:"p1FnrO"}),speed:2},"flux-1-schnell":{label:()=>"Flux Fast",description:()=>a.Ru._({id:"iksSRU",values:{FLUX_PROPER_NOUN:d.Uq}}),creatorLabel:()=>"Black Forest Labs",image:u,flag:"flux1Schnell",disabledFlag:"flux1Quick",fallbackModels:o()(b,"flux-1-schnell"),provider:"baseten",bestStyle:()=>a.Ru._({id:"6M03+0"}),bestType:()=>a.Ru._({id:"1HfW/F"}),speed:4},"flux-1-quick":{label:()=>"Flux Fast 1.1",description:()=>a.Ru._({id:"hpqgA9"}),creatorLabel:()=>"Black Forest Labs",image:u,flag:"flux1Quick",fallbackModels:o()(b,"flux-1-quick"),provider:"flux",bestStyle:()=>a.Ru._({id:"6M03+0"}),bestType:()=>a.Ru._({id:"1HfW/F"}),speed:4},"flux-1-pro":{label:()=>"Flux Pro",description:()=>a.Ru._({id:"lM7MEX"}),creatorLabel:()=>"Black Forest Labs",image:u,flag:"flux1Pro",minProductTier:"plus",fallbackModels:o()(y,"flux-1-pro"),provider:"flux",bestStyle:()=>a.Ru._({id:"6M03+0"}),bestType:()=>a.Ru._({id:"UUMdE6"}),speed:2},"flux-1-ultra":{label:()=>"Flux Ultra",description:()=>a.Ru._({id:"fr7zhY"}),creatorLabel:()=>"Black Forest Labs",image:u,flag:"flux1Ultra",minProductTier:"pro",fallbackModels:o()(y,"flux-1-ultra"),provider:"flux",bestStyle:()=>a.Ru._({id:"6M03+0"}),bestType:()=>a.Ru._({id:"1HfW/F"}),speed:1},"imagen-3-flash":{label:()=>"Imagen 3 Fast",description:()=>a.Ru._({id:"Q9Ah87",values:{GOOGLE_PROPER_NOUN:d.kO}}),creatorLabel:()=>"Google",image:c,minProductTier:"free",flag:"imagenFlash",fallbackModels:o()(b,"imagen-3-flash"),provider:"google",bestStyle:()=>a.Ru._({id:"+hJIb3"}),bestType:()=>a.Ru._({id:"1HfW/F"}),speed:4},"imagen-3-pro":{label:()=>"Imagen 3",description:()=>a.Ru._({id:"WRAPSR",values:{GOOGLE_PROPER_NOUN:d.kO}}),creatorLabel:()=>"Google",image:c,minProductTier:"plus",flag:"imagen3",fallbackModels:o()(y,"imagen-3-pro"),provider:"google",bestStyle:()=>a.Ru._({id:"6M03+0"}),bestType:()=>a.Ru._({id:"1TSz1T"}),speed:2},"ideogram-v2-turbo":{...g,label:()=>"Ideogram 2 Turbo",description:()=>a.Ru._({id:"DTVmhb",values:{IDEOGRAM_PROPER_NOUN:d.X4}}),flag:"ideogram",minProductTier:"plus",fallbackModels:o()(y,"ideogram-v2-turbo"),bestStyle:()=>a.Ru._({id:"+hJIb3"}),bestType:()=>a.Ru._({id:"xeiujy"}),speed:3},"ideogram-v2":{...g,label:()=>"Ideogram 2",description:()=>a.Ru._({id:"S0LF51",values:{IDEOGRAM_PROPER_NOUN:d.X4}}),minProductTier:"pro",fallbackModels:o()(y,"ideogram-v2"),bestStyle:()=>a.Ru._({id:"6M03+0"}),bestType:()=>a.Ru._({id:"xeiujy"}),speed:2},"dall-e-3":{label:()=>"DALL\xb7E 3",description:()=>a.Ru._({id:"UNfbq8",values:{OPENAI_PROPER_NOUN:d.PS}}),creatorLabel:()=>"OpenAI",image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/openai.9e224d80.svg",height:320,width:320,blurWidth:0,blurHeight:0},minProductTier:"pro",flag:"dalle3",fallbackModels:o()(y,"dall-e-3"),provider:"azure",bestStyle:()=>a.Ru._({id:"+hJIb3"}),bestType:()=>a.Ru._({id:"1TSz1T"}),speed:1},"leonardo-phoenix":{label:()=>"Leonardo Phoenix",description:()=>a.Ru._({id:"iEAL9X"}),creatorLabel:()=>"Leonardo",image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/leonardo.71fd3bf9.png",height:180,width:180,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAdVBMVEVMaXFgWnpcLEFUKYRqa4ExXYBDNSgpIR5aUVp3boNLRGBIX1BNOytXaXULGyVcZHoIMT93a2NnYXV4VEeamJNWgJrXy7GfjXSmlHi6nlVxW3GlnJpXO1CSeoS3mnvMvKRfR1w7QUhhU5qhiTw0V2RrcHGOS2+E6qt3AAAAFHRSTlMAmnPO/vlKKG3+fIFRsx7aOLnd+C0RAK4AAAAJcEhZcwAAA+gAAAPoAbV7UmsAAABGSURBVHicBcEFAoAgAACxQ0GwC0Ww8/9PdAO0MRogk7NNc0iWddvdWVAeqR3901JLZcf77RDDME3OCyp1hfD1GpoojqOEH4N0A88EV3bcAAAAAElFTkSuQmCC",blurWidth:8,blurHeight:8},flag:"leonardoPhoenix",fallbackModels:o()(y,"leonardo-phoenix"),minProductTier:"plus",provider:"leonardo",bestStyle:()=>a.Ru._({id:"+hJIb3"}),bestType:()=>a.Ru._({id:"xeiujy"}),speed:2},"luma-photon-1":{...h,fallbackModels:o()(y,"luma-photon-1"),label:()=>"Luma Photon",description:()=>a.Ru._({id:"qmMxhc"}),flag:"lumaPhoton",minProductTier:"plus",bestStyle:()=>a.Ru._({id:"6M03+0"}),bestType:()=>a.Ru._({id:"1HfW/F"}),speed:3},"luma-photon-flash-1":{...h,fallbackModels:o()(b,"luma-photon-flash-1"),label:()=>"Luma Photon Flash",description:()=>a.Ru._({id:"eNdOBa"}),flag:"lumaPhoton",minProductTier:"free",bestStyle:()=>a.Ru._({id:"6M03+0"}),bestType:()=>a.Ru._({id:"1HfW/F"}),speed:4},"recraft-v3":{label:()=>p,description:()=>a.Ru._({id:"z+qo6V"}),creatorLabel:()=>"Recraft",image:f,flag:"recraftModel",fallbackModels:o()(y,"recraft-v3"),minProductTier:"pro",provider:"recraft",bestStyle:()=>a.Ru._({id:"+hJIb3"}),bestType:()=>a.Ru._({id:"1HfW/F"}),speed:2},"recraft-v3-svg":{label:()=>a.Ru._({id:"rftVBi",values:{RECRAFT_PROPER_NOUN:p}}),description:()=>a.Ru._({id:"SLi7QF"}),creatorLabel:()=>"Recraft",image:f,flag:"recraftSvgModel",fallbackModels:o()(y,"recraft-v3-svg"),minProductTier:"pro",provider:"recraft",bestStyle:()=>a.Ru._({id:"+hJIb3"}),bestType:()=>a.Ru._({id:"xeiujy"}),speed:2}},k=()=>Object.keys(v).map(e=>({model:e,...v[e]})).sort((e,t)=>e.label().localeCompare(t.label(),"en-US",{sensitivity:"base"})),w=e=>v[e]||v[s.of.get("aiGeneratedImagesDefaultModel")],x=async e=>{var t,l;let{themeId:a,docId:n,...o}=e,d=a?{context:r.rWX.Theme,themeId:e.themeId}:n?{context:r.rWX.Doc,docId:e.docId}:{context:e.context},u=s.of.get("aiGeneratedImagesDefaultModel"),c=null!==(l=e.model)&&void 0!==l?l:u,m="".concat(i.$.API_HOST||"https://api.gamma.app","/media/images/generate"),f=(null===(t=w(c).fallbackModels)||void 0===t?void 0:t.filter(I))||[],p=f.includes(u)?u:f[0],g=await fetch(m,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:c,...o,fallbackModel:p,...d}),credentials:"include"});if(!g.ok){let e=await g.json(),t="".concat(e.error,": ").concat(e.message);if("prohibited_input"===e.code&&e.categories)throw new C({categories:e.categories});throw new S(t,e)}return g.json()};class S extends Error{constructor(e,t){super(e,t),this.response=t}}S.prototype.name="GenerateImageError";let A={sexual:()=>a.Ru._({id:"gHG6wD"}),violence:()=>a.Ru._({id:"x40BeZ"}),prohibited:()=>a.Ru._({id:"UiRApc"})};class C extends Error{parseCategories(e){return e.sexual||e["sexual/minors"]?"sexual":e.violence||e["violence/graphic"]?"violence":"prohbited"}constructor({categories:e}){super("Cannot generate image, prohibited (reasons=".concat(JSON.stringify(Object.keys(e)),")")),this.code="prohibited_input",this.category=this.parseCategories(e),this.messageTranslated=A[this.category]()||a.Ru._({id:"aUSC+t"})}}let z=e=>{if(e&&v[e]){let t=v[e];if(t.aspectRatios)return t.aspectRatios}return["square","portrait","landscape"]},I=e=>{let t=v[e];return!(!t||t.flag&&!s.of.get(t.flag)&&e!==s.of.get("aiGeneratedImagesDefaultModel")||t.disabledFlag&&s.of.get(t.disabledFlag))},j=e=>{let t=v[e];return!t||t.freeFlag&&s.of.get(t.freeFlag)?"free":t.minProductTier||"free"}},26917:(e,t,l)=>{"use strict";l.d(t,{g:()=>m}),l(87835);var a=l(73893),n=l(65998),o=l(17539),i=l(3564),r=l(96869),s=l(30938),d=l.n(s);let u=async e=>{let t=e.split(" ")[0];try{var l;let e=await fetch("/api/icons/search?count=5&query=".concat(t),{credentials:"include"}),a=null===(l=await e.json())||void 0===l?void 0:l.data;if(!a||0===a.length)return console.warn("[fetchIcons] No icons found. Using default set"),d()(c);return console.debug("[AI fetchIcons] fetched icons",a),a}catch(e){return console.error("(caught) [fetchIcons] fetchResults:",e),d()(c)}},c=[r.X46,r.$UM,r.yy,r.DN2,r.us_,r.A4h].map(e=>{let t=(0,i.Kk)(e),[l,n]=t.icon;return{id:e.iconName,provider:"fa",styles:["light"],src:"".concat(a.$.FRONTEND_URL,"/api/icons/").concat(e.iconName,".svg?provider=fa&style=light"),html:t.html[0],width:l,height:n}}),m=async e=>{let{query:t,provider:l,options:a={},count:i=35,prefetch:r=!1}=e,s="web"===l?n.of.get("webImageProviderType"):void 0;if("fontawesome"===l)return(await u(t)).map(e=>({id:e.id,imageUrl:e.src,width:e.width,height:e.height,attributionUrl:"",thumbnailUrl:"",credit:""}));let d=f({query:t,provider:l,options:{type:s,...a},count:i});try{let e=await fetch(d,{credentials:"include"}),t=await e.json();if(!((null==t?void 0:t.length)>=0))throw Error(t);return r&&Promise.all(t.map(e=>(0,o.GV)(e.imageUrl))).then(()=>{console.debug("[fetchImageSearchResults] images downloaded in background")}).catch(e=>{console.debug("[fetchImageSearchResults] error downloading image:",e)}),t}catch(e){return console.error("(caught) [fetchImages] fetchResults:",e),[]}},f=e=>{let{query:t,count:l,provider:n,options:o={}}=e,i=new URLSearchParams,r=a.$.API_HOST||"https://api.gamma.app";return i.append("query",t),i.append("provider",n),i.append("count",String(l)),Object.entries(o).forEach(e=>{let[t,l]=e;void 0!==l&&i.append(t,String(l))}),"".concat(r).concat("/media/images/search","?").concat(i.toString())}},31018:(e,t,l)=>{"use strict";l.d(t,{Fk:()=>v,QM:()=>k,j_:()=>w});var a=l(88570),n=l(49846),o=l(86149),i=l(87544),r=l(73893);let s={},d=async e=>{let t=s[e];if(t&&t.expires&&+new Date(t.expires)-3e5>Date.now())return s[e];let l=await fetch("/api/transloadit/signature",{method:"POST",body:JSON.stringify({templateId:e})}),{signature:a,expires:n}=await l.json();return a&&n?(s[e]={signature:a,expires:n},s[e]):(console.error("Error getting Transloadit signature"),{signature:"",expires:""})};var u=l(44507),c=l(16676),m=l(17539);let f={auth:{key:r.$.TRANSLOADIT_AUTH_KEY},template_id:r.$.TRANSLOADIT_IMAGE_TEMPLATE_ID},p=["image/*",i.A.heic,i.A.heif],g=["application/vnd.openxmlformats-officedocument.presentationml.presentation"],h=[i.A.doc,i.A.docx,...g,i.A.pdf],b={all:[...h,...g,...p],importDoc:[...h],importPpt:[...g],importPdf:[i.A.pdf],doc:h,font:["font/otf","font/ttf","application/x-font-ttf","application/x-font-otf",".otf",".ttf"],image:p,icon:[".png",".ico",".gif",".svg"]},y={autoProceed:!0,restrictions:{allowedFileTypes:[],maxNumberOfFiles:1}},v={createUppyInstance:function(e,t){let{onUploadStart:l,onOriginalFileUpload:o,onUploadComplete:i,onUploadFailed:r,onProgress:s,setErrorMessage:p}=t,g=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"node",h=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,v=arguments.length>4?arguments[4]:void 0,k=arguments.length>5?arguments[5]:void 0,w=arguments.length>6?arguments[6]:void 0,x=2560,S="false";"background"===g||"themeBackground"===g?x=3840:"icon"===g?x=250:"profile"===g?(x=1024,S="true"):"workspaceLogo"===g&&(x=1024);let A=[];v=v||"image";let C=new a.Ay({...y,restrictions:{...y.restrictions,maxNumberOfFiles:h,allowedFileTypes:b[v],maxFileSize:w}});return C.use(n.Ay,{assemblyOptions:async()=>{let t=k||f.template_id,{signature:l,expires:a}=await d(t);return{params:{...f,auth:{...f.auth,expires:a},template_id:k||f.template_id},fields:{orgId:e,imageType:g,resizePx:x,cropPadding:"50%",detectAndCropFace:S},signature:l}},waitForEncoding:!0}),C.on("file-added",async e=>{let t=(null==e?void 0:e.type)&&(0,m.aI)(null==e?void 0:e.type)&&!(0,u.nr)();try{var a;(null==e?void 0:null===(a=e.type)||void 0===a?void 0:a.includes("image"))&&(null==e?void 0:e.data)instanceof File&&!t&&await (0,m.Ru)(e),l&&1===h&&l({tempUrl:URL.createObjectURL(e.data),file:e}),s&&s(0)}catch(t){console.error("[Uppy.file-added] ".concat(t.message)),C.removeFile(e.id)}}),C.on("files-added",e=>{l&&1!==h&&e.forEach(e=>{l({tempUrl:URL.createObjectURL(e.data),file:e})}),s&&s(0)}),C.on("error",e=>{let t="Error uploading to Transloadit: ".concat(e.message);p&&p(""),r&&r(t),console.error(t)}),C.on("upload-progress",(e,t)=>{s&&s(t.bytesUploaded/t.bytesTotal*100)}),C.on("transloadit:result",(e,t,l)=>{if(1===h){if(!o||"original_file"!==e||0===l.uploads.length||(0,m.aI)(l.uploads[0].mime)||(0,c.cZ)(l.uploads[0].mime,l.uploads[0].ext)||!t)return;let{url:a,meta:n,name:i}=t;p&&p(""),a?o({src:a,meta:n,name:i,uploadResultStep:"original"}):(r&&r("Error uploading to Transloadit"),console.error("Error uploading to Transloadit"))}else{if("filter_skip_optimize"===e){A=A.concat(t);return}{let e,n;if((0,m.aI)(t.mime))n=t;else{var a;e=null===(a=A.find(e=>e.name===t.name))||void 0===a?void 0:a.url,n=t}if(!n)return;let{url:o,meta:s,name:d}=n;p&&p(""),o?i&&i({src:o,meta:s,name:d,uploadResultStep:"optimized",fullResults:l.results},e):(r&&r("Error uploading to Transloadit"),console.error("Error uploading to Transloadit"))}}}),C.on("transloadit:complete",e=>{var t,l,a,n,o;let s,d,u,f;if(1!=h)return;if(0===e.uploads.length)throw console.error("[transloadit:complete] No uploads in assembly",e),Error("No uploads in assembly");if("importDoc"===v)d=e.results.convert_to_html[0];else if("importPpt"===v)d=e.results.convert_to_html[0];else{if((0,c.eT)(e.uploads[0].ext))return;(0,c.ZD)(e.uploads[0].mime)?(d=e.results.original_file[0],u=e.results.doc_thumbnail[0].url):(0,c.cZ)(e.uploads[0].mime,e.uploads[0].ext)?(d=e.results.convert_to_pdf[0],u=e.results.doc_thumbnail[0].url):(0,m.aI)(e.uploads[0].mime)?(d=(null===(t=e.results.optimized)||void 0===t?void 0:t[0])||(null===(l=e.results.filter_skip_optimize)||void 0===l?void 0:l[0]),f=null===(a=e.results.detect_and_crop_face)||void 0===a?void 0:a[0].url):(s=e.results.original_file[0].url,f=null===(n=e.results.detect_and_crop_face)||void 0===n?void 0:n[0].url,d=(null===(o=e.results.optimized)||void 0===o?void 0:o[0])||e.results.original_file[0])}let{url:g,ssl_url:b,meta:y,name:k}=d;p&&p(""),b||g?i&&i({src:b||g,meta:y,name:k,thumbnail:u,croppedFace:f,uploadResultStep:"optimized",fullResults:e.results},s):(r&&r("Error uploading to Transloadit"),console.error("Error uploading to Transloadit"))}),C}},k=async function(e,t,l){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"node",n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"image",o=arguments.length>5?arguments[5]:void 0,i=arguments.length>6?arguments[6]:void 0;if(!t)throw Error("Tried uploading an image with no orgId");let r=v.createUppyInstance(t,l,a,1,n,o,i);try{r.addFile({name:e.name,type:e.type,data:e})}catch(e){var s;null==l||null===(s=l.onUploadFailed)||void 0===s||s.call(l,e.message);return}await r.upload()},w=async function(e,t,l){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"node",i=arguments.length>4?arguments[4]:void 0;if(!t)throw Error("Tried uploading an image with no orgId");let r=v.createUppyInstance(t,l,a,"themeBackground"===a?null:1,void 0,i);r.use(o.A,{companionUrl:n.HI});let s=await r.getPlugin("Url").addFile(e);if(s instanceof Error){var d;null==l||null===(d=l.onUploadFailed)||void 0===d||d.call(l,s.message)}}},41881:(e,t,l)=>{"use strict";l.d(t,{Gn:()=>B,mF:()=>F,wf:()=>j,Re:()=>S,Qo:()=>z,RM:()=>I,rf:()=>C,a:()=>A});var a=l(8796),n=l(99742),o=l(60490),i=l(46499),r=l(73893),s=l(4977);let d=(e,t)=>({referenceType:"REFERENCE_TYPE_MASK",referenceId:0,maskImageConfig:{maskMode:e,dilation:t}}),u={MASKLESS:e=>c({...e,referenceImages:[],parameters:{}}),EDIT_MODE_INPAINT_REMOVAL:e=>c({...e,referenceImages:[d("MASK_MODE_FOREGROUND",.01)],parameters:{editMode:"EDIT_MODE_INPAINT_REMOVAL"}}),EDIT_MODE_INPAINT_INSERTION:e=>c({...e,referenceImages:[d("MASK_MODE_FOREGROUND",.01)],parameters:{editMode:"EDIT_MODE_INPAINT_INSERTION"}}),EDIT_MODE_BGSWAP:e=>c({...e,referenceImages:[d("MASK_MODE_BACKGROUND",.01)],parameters:{editMode:"EDIT_MODE_BGSWAP"}}),EDIT_MODE_OUTPAINT:e=>c({...e,referenceImages:[d("MASK_MODE_BACKGROUND",.01)],parameters:{editMode:"EDIT_MODE_OUTPAINT"}})},c=e=>{let{workspaceId:t,inputPrompt:l,inputImageSrc:a,referenceImages:n,parameters:o}=e;return{workspaceId:t,model:"imagen-3.0-capability-001",endpoint:"predict",requestBody:{parameters:{negativePrompt:"wrinkles, noise, Low quality, dirty, ugly, low res, multi face, nsfw, nude, rough texture, messy, messy background, weird hair, chinese clothes, chinese hair, traditional asia clothes, color background, photo realistic, photo, super realistic, signature, autograph, sign, text, characters, alphabet, letter",sampleCount:1,promptLanguage:"en",personGeneration:"allow_all",safetySetting:"block_only_high",...o},instances:[{prompt:"Edit the image [1] based on the following prompt: ".concat(l,"."),referenceImages:[{referenceType:"REFERENCE_TYPE_RAW",referenceId:1,referenceImage:{src:a}},...n]}]}}},m=async(e,t)=>{try{let l=await fetch("".concat(r.$.API_HOST,"/media/images/edit-prototype"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!l.ok)return{error:"Failed to edit image ".concat(e," ").concat(l.statusText)};return(await l.json()).map(e=>({src:e.url}))}catch(e){return{error:"Failed to edit image ".concat(e)}}};async function f(e,t){let l=["MASKLESS","EDIT_MODE_INPAINT_INSERTION","EDIT_MODE_BGSWAP","EDIT_MODE_OUTPAINT"].map(async l=>{let a=u[l]({workspaceId:e,inputPrompt:t.prompt,inputImageSrc:t.inputImage.src}),n=await m(l,a);if("error"in n)return{request:{key:l,requestBody:a},result:{error:n.error}};let o=n.map(e=>({...e,source:"image.ai-generated",meta:t.inputImage.meta,name:"".concat(l,"-edit"),uploadStatus:s.A.Done}));return{request:{key:l,requestBody:a},result:o}}),a=[];return await Promise.all(l.map(async e=>{let{request:l,result:n}=await e;"error"in n?console.error(n.error):n.forEach(e=>{a.push({...e,source:"image.ai-generated",meta:t.inputImage.meta,name:l.key,aiParams:l.requestBody})})})),a}let p=(0,a.Z0)({name:"editMediaRecord",initialState:null,reducers:{openMediaRecordForImage:(e,t)=>{if(e){let l=e.mediaRecord.operations.find(e=>e.result.src===t.payload.imageAttrs.src);if(l)return{...e,selectedMediaOperationId:l.id}}let l={id:t.payload.imageCreationOperationId,type:"ImageCreation",inputs:{...t.payload.imageAttrs},output:null,result:{...t.payload.imageAttrs}};return{mediaRecord:{id:t.payload.mediaRecordId,operations:[l]},selectedMediaOperationId:l.id,maybePendingEdit:null}},handleMediaRecordUpdated:(e,t)=>{e&&(e.mediaRecord=t.payload.mediaRecord)},setCurrentOperationResult:(e,t)=>{if(!e)return;let l=k(e);i.t.isSuccess(l)&&(l.value.result=t.payload.result)},setSelectedOperationId:(e,t)=>{e&&(e.selectedMediaOperationId=t.payload.operationId)},startEdit:(e,t)=>{e&&(e.maybePendingEdit=i.t.loading(t.payload.operation))},handleEditSuccess:(e,t)=>{e&&(e.selectedMediaOperationId=t.payload.newOperation.id,e.mediaRecord.operations.push(t.payload.newOperation),e.maybePendingEdit=null)},handleEditFailure:(e,t)=>{e&&(e.maybePendingEdit=i.t.failure(t.payload.error))}}});p.reducer;let g=e=>{if(!e)throw Error("No tab state found");return e},h=e=>g(e).mediaRecord,b=e=>h(e).operations,y=e=>g(e).selectedMediaOperationId,v=(e,t)=>h(e).operations.find(e=>e.id===t),k=e=>{let t=y(e),l=v(e,t);return l?i.t.success(l):i.t.failure(Error("Operation with id ".concat(t," not found")))},w=e=>{var t;return null!==(t=g(e).maybePendingEdit)&&void 0!==t?t:k(e)},x=e=>{let t=g(e);return!!t.maybePendingEdit&&i.t.isLoading(t.maybePendingEdit)},S=e=>b(e.EditMediaRecord),A=e=>y(e.EditMediaRecord),C=e=>k(e.EditMediaRecord),z=(e,t)=>v(e.EditMediaRecord,t),I=e=>w(e.EditMediaRecord),j=e=>x(e.EditMediaRecord),F={openMediaRecordForImage:e=>{let t=(0,n.Ak)(6),l=(0,n.Ak)(6);return p.actions.openMediaRecordForImage({imageAttrs:e,mediaRecordId:t,imageCreationOperationId:l})},startEdit:e=>async t=>{let l=(0,n.Ak)(),a={...e,id:l};if("PromptedAIImageEdit"===a.type){let{inputImage:e}=a.inputs,l=(0,o.gx)();if(!l){t(p.actions.handleEditFailure({error:Error("No workspace id found")}));return}t(p.actions.startEdit({operation:a}));try{let n=await f(l,{inputImage:e,prompt:a.inputs.prompt});if(0===n.length){t(p.actions.handleEditFailure({error:Error("No options returned from AI")}));return}let o={...a,output:{options:n},result:n[0]};t(p.actions.handleEditSuccess({newOperation:o}))}catch(e){t(p.actions.handleEditFailure({error:e instanceof Error?e:Error("Unknown error occurred")}))}}},selectOperation:e=>p.actions.setSelectedOperationId({operationId:e}),setCurrentOperationResult:e=>p.actions.setCurrentOperationResult({result:e})},B=p.reducer},76501:(e,t,l)=>{"use strict";l.d(t,{O:()=>es});var a=l(31085),n=l(9021),o=l(2600),i=l(76166),r=l(35436),s=l(80532),d=l(20671),u=l(49547),c=l(22218),m=l(20501),f=l(24221),p=l(95986),g=l(52177),h=l(12327),b=l(27372),y=l(50933),v=l.n(y),k=l(14041),w=l(91559),x=l(59707),S=l(62849),A=l(63341),C=l(18528),z=l(80853),I=l(40173),j=l(72821),F=l(48310),B=l(33473),R=l(61778),_=l(3040);let M={label:()=>h.Ru._({id:"DAmK+T"}),key:"All",description:()=>h.Ru._({id:"Zz/1wq"})},E=[M,{label:()=>h.Ru._({id:"10G8Kb"}),key:"Share",description:()=>h.Ru._({id:"EVNJ2h"})},{label:()=>h.Ru._({id:"SjDzTh"}),key:"ShareCommercially",description:()=>h.Ru._({id:"DHhpJP"})}],T=M.key,O=e=>{var t;return null===(t=E.find(t=>t.key===e))||void 0===t?void 0:t.label()},P=e=>{let{value:t=T,onChange:l}=e;return(0,a.jsxs)(A.W,{children:[(0,a.jsx)(C.I,{w:"100%",as:z.$,boxShadow:"sm",size:"sm",variant:"plain",rightIcon:(0,a.jsx)(f.g,{icon:_.Jt$}),textAlign:"left",children:O(t)}),(0,a.jsx)(I.Z,{children:(0,a.jsx)(j.c,{zIndex:"tooltip",w:"350px",children:(0,a.jsx)(F.i,{type:"radio",w:"100%",defaultValue:M.key,value:t,onChange:e=>l(e),children:E.map(e=>{let{key:t,label:l,description:n}=e;return(0,a.jsxs)(B.k,{value:t,children:[l(),(0,a.jsx)(R.E,{fontSize:"sm",color:"gray.400",children:n()})]},t)})})})})]})};var N=l(73893),D=l(26917),L=l(88303),W=l(17539);let U=e=>(0,k.useCallback)(t=>{fetch("".concat(N.$.API_HOST||"","/media/images/track"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,id:t.id})})},[e]),G=e=>{let{provider:t,enablePagination:l,resultsPerPage:a}=e,[n,o]=(0,k.useState)(""),[i,r]=(0,k.useState)([]),[s,d]=(0,k.useState)(!1),[u,c]=(0,k.useState)(!1),[m,f]=(0,k.useState)(1),[p,g]=(0,k.useState)("All"),h=(0,k.useRef)(p),b=l&&i.length>0&&m<6,y=(0,k.useCallback)(async(e,l)=>{d(!0),c(!1);try{let n={license:h.current,page:l,gammaFeature:"mediaDrawer"};"bing"===t&&(n.minWidth=L.s.minWidth,n.maxWidth=L.s.maxWidth);let o=await (0,D.g)({query:e,count:a,provider:t,options:n});if(d(!1),!((null==o?void 0:o.length)>=0))throw Error("No images found");let i=o.filter(e=>(0,W.zk)(e.imageUrl));r(e=>e.concat(i))}catch(e){c(!0),d(!1),console.error("(caught) [ImageSearchGrid] fetchResults:",e)}},[t,a]),v=(0,k.useCallback)(e=>{r([]),f(1),o(e),y(e,1)},[y]),w=(0,k.useCallback)(()=>{y(n,m+1),f(m+1)},[y,n,m]),x=(0,k.useCallback)(()=>{o(""),r([]),f(1)},[]),S=(0,k.useCallback)(e=>{g(e),h.current=e,x(),v(n)},[x,v,n]);return{search:v,isLoading:s,loadMore:w,canLoadMore:b,hasError:u,imageResults:i,resetResults:x,searchQuery:n,license:p,updateLicense:S}};var H=l(25420),V=l(90290),q=l(69648),K=l(15672),J=l(76003),$=l(62230),Q=l(73758),Y=l.n(Q),X=l(33513),Z=l(952),ee=l(18651),et=l(70405),el=l(35789),ea=l(3706);let en=(0,k.memo)(e=>{let{image:t,isSelected:l,onImageClick:n,resizeThumbnail:o}=e,i=o?(0,W.Ub)(t.thumbnailUrl,W.p7):t.thumbnailUrl;return(0,a.jsxs)(z.$,{borderRadius:"base",overflow:"hidden",display:"block",variant:"ghost",width:"100%",opacity:1,textAlign:"left",pos:"relative",p:0,minH:"auto",h:"auto",_hover:{shadow:"outline"},_active:{shadow:"outline"},transition:"box-shadow .2s ease",cursor:"pointer",onClick:()=>n(t),sx:{_focusVisible:{".attribution-container":{opacity:1}},_hover:{".attribution-container":{opacity:1}}},"data-testid":"image-search-grid-item",children:[(0,a.jsx)(ee._,{w:"100%",src:i,fallback:(0,a.jsx)($.E,{height:"120px",borderRadius:"base"})}),(0,a.jsx)(et.z,{in:l,children:(0,a.jsx)(s.az,{pointerEvents:"none",color:"white",pos:"absolute",inset:0,bg:"rgba(0,0,0,.5)",borderRadius:"base",children:(0,a.jsx)(el.o,{h:"100%",w:"100%",children:(0,a.jsx)(f.g,{icon:m.e68})})})}),!t.thumbnailUrl&&(0,a.jsx)(J.E,{width:"100%",children:(0,a.jsx)($.E,{height:"80px",borderRadius:"base"})}),(0,a.jsxs)(s.az,{left:0,right:0,bottom:0,p:2,pos:"absolute",color:"white",fontSize:"xs",textOverflow:"ellipsis",overflow:"hidden",bg:"linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 100%)",borderBottomRadius:"base",className:"attribution-container",opacity:0,transitionProperty:"common",transitionDuration:"normal",children:[t.attributionUrl&&t.credit&&(0,a.jsx)(p.Tz,{label:t.credit,placement:"left",children:(0,a.jsx)(ea.N,{mr:1,target:"_blank",rel:"noopener noreferrer",href:t.attributionUrl,tabIndex:-1,children:(0,a.jsx)(f.g,{transform:"shrink-4",icon:m.AaJ})})}),t.credit]})]})});en.displayName="ImageSearchGridItem";let eo=e=>{let{searchQuery:t,currentImageUrl:l,updateAttributes:n,provider:o,imageResults:i,isLoading:r,canLoadMore:d,loadMore:u,hasError:c,resultsPerPage:m,resizeThumbnails:f}=e,p=U(o),h=(0,k.useCallback)(e=>{p(e),n((0,Z.TF)(e,t,o))},[o,t,p,n]),b=i.map(e=>{let t=e.imageUrl.split("?")[0],n=l&&l.split("?")[0];return(0,a.jsx)(en,{provider:o,image:e,isSelected:t===n,onImageClick:h,resizeThumbnail:f},e.id)});return(0,a.jsxs)(H.s,{direction:"column",align:"stretch",children:[r&&0===i.length&&(0,a.jsx)(ei,{resultsPerPage:m}),i.length>0&&(0,a.jsx)(X.A,{columnsCount:3,gutter:"0.5rem",children:b}),d&&(0,a.jsx)(z.$,{variant:"plain",onClick:u,mt:4,isLoading:r,children:(0,a.jsx)(g.x6,{id:"yQ2kGp"})}),0===i.length&&!r&&(0,a.jsx)(s.az,{width:"100%",textAlign:"center",padding:"10px",children:(0,a.jsx)(R.E,{style:{color:"gray"},children:(0,a.jsx)(g.x6,{id:"SihI8q",values:{searchQuery:t}})})}),c&&(0,a.jsxs)(V.F,{status:"error",children:[(0,a.jsx)(q._,{}),(0,a.jsx)(g.x6,{id:"Fkbzp8"})]})]})},ei=e=>{let{resultsPerPage:t}=e;return(0,a.jsx)(K.r,{columns:3,spacing:2,children:Y()(t).map((e,t)=>(0,a.jsx)(J.E,{children:(0,a.jsx)($.E,{height:"120px",borderRadius:"base"})},t))})},er=(0,b.P)(n.K),es=e=>{let{currentImageUrl:t,updateAttributes:l,defaultQuery:n,randomQueries:b,provider:y,enablePagination:A=!0,enableSearch:C=!0,enableLicenseFilter:z=!1,resultsPerPage:I=18,resizeThumbnails:j=!1}=e,[F,B]=(0,k.useState)(""),{isInOfflineMode:R}=(0,w.u)(),{search:_,isLoading:M,loadMore:E,canLoadMore:T,hasError:O,imageResults:N,resetResults:D,searchQuery:L,license:W,updateLicense:U}=G({provider:y,enablePagination:A,resultsPerPage:I});(0,S.Vg)(()=>{if(!R){if(n){B(n),_(n);return}B(""),b?_(v()(b)||""):D()}},[n,R,b,D,_],[y]);let H=(0,k.useCallback)(()=>{let e=v()(b);e&&_(e)},[b,_]),V=(0,S.lW)(_,1e3);return(0,a.jsxs)(o.T,{spacing:4,align:"stretch",translate:"no",children:[(0,a.jsx)(p.Tz,{placement:"top",label:(0,a.jsx)(g.x6,{id:"wj1Zq8"}),isDisabled:C,children:(0,a.jsxs)(i.M,{size:"md",children:[(0,a.jsx)(r.W,{pointerEvents:"none",children:(0,a.jsx)(s.az,{color:"gray.400",children:(0,a.jsx)(f.g,{icon:m.MjD})})}),(0,a.jsx)(d.p,{isDisabled:!C,placeholder:h.Ru._({id:"6YBjmV"}),value:F,onChange:e=>{B(e.target.value),V(e.target.value)},"data-testid":"image-search-input"}),b&&(0,a.jsx)(r.t,{children:(0,a.jsx)(p.Tz,{placement:"top",label:(0,a.jsx)(g.x6,{id:"OVjfHO"}),children:(0,a.jsx)(er,{icon:(0,a.jsx)(f.g,{icon:m.xNJ}),"aria-label":"Surprise me",variant:"ghost",onClick:H,size:"sm",whileTap:{y:"-5px"},onMouseDown:x.Fw})})})]})}),z&&(0,a.jsxs)(u.MJ,{children:[(0,a.jsx)(c.l,{fontSize:"sm",fontWeight:"semibold",children:(0,a.jsx)(g.x6,{id:"6TSHCF"})}),(0,a.jsx)(P,{value:W,onChange:U})]}),L&&(0,a.jsx)(eo,{updateAttributes:l,currentImageUrl:t,searchQuery:L,provider:y,imageResults:N,isLoading:M,canLoadMore:T,loadMore:E,hasError:O,resultsPerPage:I,resizeThumbnails:j})]})}},66712:(e,t,l)=>{"use strict";l.d(t,{VG:()=>j,Yq:()=>I,Sf:()=>A});var a=l(31085),n=l(2600),o=l(2219),i=l(62313),r=l(20671),s=l(80853),d=l(90290),u=l(69648),c=l(52177),m=l(12327),f=l(14041),p=l(88957),g=l(61690),h=l(17539),b=l(77214);let y={thumbnail:void 0,embed:void 0,meta:void 0,sourceUrl:void 0},v=async e=>{var t,l,a,n,o,i;let r=await fetch("https://cdn.iframe.ly/api/iframely/?url=".concat(encodeURIComponent(e),"&key=").concat("a68bac8b6624d46b6d0ba46e5b3f8971","&iframe=1&omit_script=1")),s=await r.json();if(console.debug("[Iframely]",s),s.error)return Promise.reject(s);let{html:d,links:u,meta:c}=s,{icon:m,player:f,reader:p,app:g,thumbnail:h}=u,b=f||p||g,y=b?b.filter(e=>"text/html"===e.type&&e.href)[0]||b[0]:null,v=c&&!c.xframe&&(!c.csp||!c.csp.includes("frame-ancestors"));return{sourceUrl:(null==c?void 0:c.canonical)||e,embed:y?{url:y.href,html:d,height:null===(t=y.media)||void 0===t?void 0:t.height,width:(null===(l=y.media)||void 0===l?void 0:l.width)||(null===(a=y.media)||void 0===a?void 0:a["max-width"]),aspectRatio:null===(n=y.media)||void 0===n?void 0:n["aspect-ratio"]}:v?{url:e}:void 0,meta:{...c||{},icon:m&&m[0]?m[0].href:void 0},thumbnail:h&&h[0]?{src:h[0].href,height:null===(o=h[0].media)||void 0===o?void 0:o.height,width:null===(i=h[0].media)||void 0===i?void 0:i.width}:void 0}};var k=l(31018),w=l(90886),x=l(22481),S=l(19099);let A=e=>{try{var t,l;let a=new DOMParser().parseFromString(e,"text/html");return(null===(t=a.querySelector("iframe"))||void 0===t?void 0:t.src)||(null===(l=a.querySelector("blockquote"))||void 0===l?void 0:l.cite)||!1}catch(e){return!1}},C=e=>{let t=e.match(/^https?:\/\/www\.tiktok\.com/),l=e.match(/^https?:\/\/(www\.|staging\.)?gamma.app/);return t||l},z=async e=>{var t,l,a,n,o;let i,r;try{if(C(e)){let t=e.split("?")[0];i=await v(t)}else i=await v(e)}catch(t){if(403===t.status||404===t.status||415===t.status){for(let{key:t,urlRegex:l,canEmbedPrivate:a,defaultDisplayStyle:n}of x.NR)if(l&&e.match(l)&&a)return{...y,source:t,proxy:!1,url:e,meta:{title:m.Ru._({id:"SuoEIZ"})},sourceUrl:e,displayStyle:n||"inline"}}throw Error("Code: ".concat(t.status,". Message: ").concat(t.error))}if(!i)throw Error("No link metadata found");for(let{key:e,urlRegex:t}of x.NR)if(t&&(null===(n=i.sourceUrl)||void 0===n?void 0:n.match(t))){r=e;break}if(r){let e=x.Dc[r];return{...y,...i,source:r,proxy:!1,url:(null===(o=i.embed)||void 0===o?void 0:o.url)||i.sourceUrl,displayStyle:e.defaultDisplayStyle}}return(null===(t=i.meta)||void 0===t?void 0:t.medium)=="audio"||(null===(l=i.meta)||void 0===l?void 0:l.medium)==="video"?{...y,...i,source:w.G.key}:(null===(a=i.embed)||void 0===a?void 0:a.url)?{...y,...i,source:S.J.key,proxy:!1,url:i.embed.url}:{...y,...i,source:S.J.key,proxy:!0,url:e}},I=async(e,t)=>await z(e).then(e=>(t(e),e)).then(e=>F(e,t)),j=e=>{let{currentUrl:t="",updateAttributes:l,handleSubmit:p,handleDataSubmit:g,placeholder:y,noHeader:v}=e,[k,w]=(0,f.useState)(t||""),[x,S]=(0,f.useState)(),C=k!==t;(0,f.useEffect)(()=>{t&&w(t)},[t]),(0,f.useEffect)(()=>{S(void 0)},[k]);let z=(0,f.useCallback)(e=>{if(0===e.indexOf("data:")){if(g){try{(0,h.Xz)(e)}catch(e){S(m.Ru._({id:"YqH0TR"}));return}return g(e)}return void S(m.Ru._({id:"YqH0TR"}))}let t=A(e);if(t&&(e=t),!(0,b.Se)(e)&&(e="https://"+e,!(0,b.AY)(e))){S(m.Ru._({id:"YqH0TR"}));return}return p?p(e):l?I(e,l).catch(e=>{console.error("Error fetching URL",e),S(m.Ru._({id:"dZyJFB"}))}):void console.error("No submit handler provided")},[g,p,l]),j=(0,f.useCallback)(()=>{z(k.trim())},[z,k]),F=(0,f.useCallback)(e=>{t||z(e.clipboardData.getData("text/plain").trim())},[t,z]);return(0,a.jsxs)(n.T,{align:"flex-start",spacing:4,w:"100%",children:[!v&&(0,a.jsx)(o.D,{size:"md",children:(0,a.jsx)(c.x6,{id:"D89ve+"})}),(0,a.jsxs)(i.z,{align:"flex-start",spacing:2,w:"100%",children:[(0,a.jsx)(r.p,{placeholder:y,onKeyDown:e=>{"Enter"===e.key&&j()},onPaste:F,value:k,onChange:e=>w(e.target.value),flex:1,"data-testid":"url-input"}),(0,a.jsx)(s.$,{onClick:j,isDisabled:!C,children:(0,a.jsx)(c.x6,{id:"4pSxwB"})})]}),x&&(0,a.jsxs)(d.F,{status:"error",children:[(0,a.jsx)(u._,{}),x]})]})},F=async(e,t)=>{let l=(0,p.KA)().getState(),a=(0,g.aQ)(l);if(!a){console.error("[uploadIframelyThumbnail] No orgId specified, bailing");return}let n={...e.thumbnail},o=n.src;if(o&&void 0!==n)try{await (0,k.j_)(o,a,{onUploadComplete:e=>(n&&(n.src=e.src,n.width=e.meta.width,n.height=e.meta.height,t({thumbnail:n})),Promise.resolve()),onOriginalFileUpload:e=>(n&&(n.src=e.src,n.width=e.meta.width,n.height=e.meta.height,t({thumbnail:n})),Promise.resolve()),onUploadFailed:e=>(console.error("[iframely] Thumbnail upload error: ",e),Promise.reject())},"iframelyThumbnail")}catch(e){console.error("[iframely] Thumbnail upload error: ",e)}}},20053:(e,t,l)=>{"use strict";l.d(t,{Z:()=>g});var a=l(31085),n=l(12327),o=l(14041),i=l(90290),r=l(69648),s=l(2600),d=l(25420),u=l(12917),c=l(24221),m=l(60023);l(24077),l(85158),l(68988);let f=(0,l(78776).A)(e=>{let{uppyInstance:t,dropHereText:l=n.Ru._({id:"mgPDos",values:{0:"%{browse}"}}),tipText:o,customHeight:f,errorMessage:p,...g}=e;return(0,a.jsxs)(s.T,{align:"stretch",spacing:4,pos:"relative",...g,children:[(0,a.jsx)(d.s,{pos:"absolute",inset:0,justify:"center",align:"center",zIndex:1,pointerEvents:"none",mt:-14,color:"gray.600",children:(0,a.jsx)(c.g,{icon:u.vMo,size:"3x"})}),(0,a.jsx)(m.OX,{width:"100%",height:f||"100%",note:o||void 0,uppy:t,locale:{strings:{dropHereOr:l,browse:n.Ru._({id:"wZ9s+A"})}}}),p&&(0,a.jsxs)(i.F,{status:"error",children:[(0,a.jsx)(r._,{}),p]})]})});var p=l(31018);let g=e=>{let{orgId:t,uploadType:l,editType:i,onUploadStart:r,onUploadSuccess:s,onUploadFailed:d,dropHereText:u=n.Ru._({id:"mgPDos",values:{0:"%{browse}"}}),customHeight:c,customFontSize:m,maxFilesAllowed:g=1,templateId:h,sx:b,tipText:y}=e,[v,k]=(0,o.useState)(""),w=(0,o.useMemo)(()=>p.Fk.createUppyInstance(t,{onUploadStart:r,onOriginalFileUpload:s,onUploadComplete:function(){for(var e=arguments.length,t=Array(e),l=0;l{"use strict";l.d(t,{Dc:()=>n.Dc,Dr:()=>n.Dr,GQ:()=>n.GQ,Il:()=>n.Il,Jp:()=>n.Jp,MN:()=>n.MN,N$:()=>n.N$,O5:()=>n.O5,OO:()=>n.OO,Ow:()=>n.Ow,Oz:()=>n.Oz,Pl:()=>n.Pl,QM:()=>a.QM,RA:()=>n.RA,Rn:()=>n.Rn,TV:()=>n.TV,UX:()=>n.UX,Up:()=>n.Up,V2:()=>n.V2,Ve:()=>n.Ve,Z_:()=>n.Z_,Zd:()=>n.Zd,ae:()=>n.ae,ap:()=>n.ap,fG:()=>n.fG,fX:()=>n.fX,fb:()=>n.fb,hb:()=>n.hb,j_:()=>a.j_,mx:()=>n.mx,qD:()=>n.qD,r9:()=>n.r9,sI:()=>n.sI,sS:()=>n.sS,st:()=>n.st,uF:()=>n.uF,w:()=>n.w,xT:()=>n.xT,yj:()=>n.yj});var a=l(31018);l(76501),l(20053);var n=l(22481)},70338:(e,t,l)=>{"use strict";l.d(t,{L:()=>o,U:()=>i});var a=l(3040),n=l(12327);let o="image.ai-generated",i={key:o,checkDisabled:()=>!1,label:()=>n.Ru._({id:"O+LXs1"}),icon:a._$C,description:()=>n.Ru._({id:"yXA4hx"}),keywords:["ai","image","illustration","graphics","generate"],resizeToFit:!0}},88303:(e,t,l)=>{"use strict";l.d(t,{s:()=>a});let a={minWidth:1800,maxWidth:5e3,count:10}},90886:(e,t,l)=>{"use strict";l.d(t,{G:()=>o});var a=l(12917),n=l(12327);let o={label:()=>n.Ru._({id:"0+gRao"}),description:()=>n.Ru._({id:"w31i/H"}),key:"video.custom",icon:a.qtl,keywords:["video","audio","podcast","embed"],iframeOptions:{allowPopups:!0},preferHtml:!0}},21098:(e,t,l)=>{"use strict";l.d(t,{p:()=>x});var a=l(31085),n=l(32202),o=l(2600),i=l(2219),r=l(61778),s=l(18651),d=l(80853),u=l(20671),c=l(63633),m=l(62313),f=l(52177),p=l(12327),g=l(20053),h=l(4977),b=l(88957),y=l(94007),v=l(61690),k=l(17539),w=l(66712);let x=e=>{let{updateAttributes:t,currentAttributes:l}=e,{sourceUrl:x,meta:S,thumbnail:A}=l,C=(0,b.GV)(v.aQ),z=(0,n.d)(),I=async()=>{x&&await (0,w.Yq)(x,t).catch(e=>{console.error("[EMBED METADATA] Error restoring preview defaults",e),z({title:p.Ru._({id:"cgB+pO",values:{0:e.error}}),status:"error",isClosable:!0,position:"top"})})};return(0,a.jsxs)(o.T,{pt:4,align:"stretch",spacing:4,children:[(0,a.jsxs)(o.T,{align:"stretch",children:[(0,a.jsx)(i.D,{size:"md",children:(0,a.jsx)(f.x6,{id:"qbzc6p"})}),(0,a.jsx)(r.E,{fontSize:"sm",color:"gray.600",children:(0,a.jsx)(f.x6,{id:"D9R1mI"})})]}),(0,a.jsxs)(o.T,{align:"stretch",p:4,borderRadius:"lg",border:"1px solid var(--chakra-colors-blue-500)",bg:"gray.100",spacing:4,children:[(null==A?void 0:A.showPlaceholder)?(0,a.jsx)(y.Pf,{hasUploadError:(null==A?void 0:A.uploadStatus)===h.A.Error,isUploading:(null==A?void 0:A.uploadStatus)===h.A.Uploading,height:"200px",borderRadius:"md"}):A?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s._,{src:A.src||A.tempUrl||"",alt:(null==S?void 0:S.title)||"",ignoreFallback:!0,borderRadius:"md"}),(0,a.jsx)(d.$,{isDisabled:A.uploadStatus===h.A.Uploading,onClick:()=>{t({thumbnail:void 0})},children:(0,a.jsx)(f.x6,{id:"YFcW0s"})})]}):C&&(0,a.jsx)(g.Z,{onUploadStart:e=>{let{file:l,tempUrl:a}=e;l.type&&(0,k.aI)(l.type)?t({thumbnail:{uploadStatus:h.A.Uploading,showPlaceholder:!0,tempUrl:null}}):t({thumbnail:{tempUrl:a,uploadStatus:h.A.Uploading,showPlaceholder:!1}})},onUploadSuccess:e=>{let{src:l}=e;t({thumbnail:{src:l}})},onUploadFailed:e=>{console.error("[EMBED METADATA] Error uploading thumbnail image",e),t({thumbnail:{uploadStatus:h.A.Error,showPlaceholder:!0,tempUrl:null}})},orgId:C||"",uploadType:"image",editType:"icon",dropHereText:p.Ru._({id:"yxTfZB",values:{0:"%{browse}"}}),customHeight:"200px",customFontSize:"sm"}),(0,a.jsxs)(o.T,{mt:2,align:"stretch",children:[(0,a.jsx)(r.E,{children:(0,a.jsx)(f.x6,{id:"MHrjPM"})}),(0,a.jsx)(u.p,{bg:"white",value:(null==S?void 0:S.title)||"",placeholder:p.Ru._({id:"bTzMt5"}),onChange:e=>{t({meta:{...S,title:e.target.value}})},"data-testid":"title-input"})]}),(0,a.jsxs)(o.T,{align:"stretch",children:[(0,a.jsx)(r.E,{children:(0,a.jsx)(f.x6,{id:"Nu4oKW"})}),(0,a.jsx)(c.T,{bg:"white",rows:4,value:(null==S?void 0:S.description)||"",placeholder:p.Ru._({id:"2VBqT4"}),onChange:e=>{t({meta:{...S,description:e.target.value}})}})]}),(0,a.jsxs)(o.T,{align:"stretch",children:[(0,a.jsx)(r.E,{children:(0,a.jsx)(f.x6,{id:"On0aF2"})}),(0,a.jsxs)(m.z,{children:[(null==S?void 0:S.icon)&&(0,a.jsx)(s._,{src:S.icon,h:"1.5em",borderRadius:"sm"}),(0,a.jsx)(u.p,{bg:"white",value:(null==S?void 0:S.site)||"",placeholder:p.Ru._({id:"SmWcKR"}),onChange:e=>{t({meta:{...l.meta,site:e.target.value}})}})]})]})]}),(0,a.jsx)(d.$,{onClick:I,children:(0,a.jsx)(f.x6,{id:"Z00hdC"})})]})}},24263:(e,t,l)=>{"use strict";l.d(t,{P:()=>o});var a=l(20501),n=l(12327);let o={key:"image.giphy",label:()=>n.Ru._({id:"E435oC",values:{GIPHY_PROPER_NOUN:"GIPHY"}}),description:()=>n.Ru._({id:"AbFJB5"}),icon:a.MEP,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/giphy.2d92c9c6.svg",height:2500,width:2500,blurWidth:0,blurHeight:0},keywords:["gif","animation","animated","giphy"],resizeToFit:!0}},25817:(e,t,l)=>{"use strict";l.d(t,{Z:()=>o});var a=l(12917),n=l(12327);let o={key:"image.icon",label:()=>n.Ru._({id:"mcmuCe"}),icon:a.cCs,keywords:["icon","symbol","picture"]}},90937:(e,t,l)=>{"use strict";l.d(t,{j:()=>s});var a=l(70338),n=l(24263),o=l(74146),i=l(47117),r=l(2767);let s={bing:"image.bing",giphy:"image.giphy",google:"image.google",web:"image.web",unsplash:"image.unsplash",lexica:"image.lexica",aiGenerated:"image.ai-generated",fontawesome:"image.icon",pictographic:"image.pictographic"};i.a,r.R,a.U,o.x,n.P},22481:(e,t,l)=>{"use strict";l.d(t,{Up:()=>a.U,MN:()=>i,hb:()=>r,TV:()=>d,qD:()=>u,mx:()=>c,GQ:()=>m.G,uF:()=>p,Zd:()=>v,Pl:()=>k.P,fG:()=>w,RA:()=>x,yj:()=>S,UX:()=>A,Z_:()=>C.Z,Oz:()=>z,Ve:()=>I,OO:()=>j,fX:()=>F,NR:()=>$,Dc:()=>Q,sI:()=>B,Dr:()=>R,Il:()=>_,xT:()=>M.x,sS:()=>T,fb:()=>O,st:()=>P,Ow:()=>N,w:()=>L,V2:()=>W,ap:()=>U,ae:()=>G.a,O5:()=>H,Rn:()=>V.R,Jp:()=>q.J,r9:()=>K,N$:()=>J});var a=l(70338),n=l(12917),o=l(12327);let i={label:()=>"Airtable",key:"embed.airtable",description:()=>o.Ru._({id:"KlL5LU"}),icon:n.Qte,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/airtable.e403549a.svg",height:64,width:64,blurWidth:0,blurHeight:0},urlRegex:/^https?:\/\/airtable.com/,categories:["app","form"],defaultDisplayStyle:"inline",inlineInteractive:!0,iframeOptions:{allowPopups:!0},rewriteEmbedUrl:e=>{try{if(e.includes("/embed/"))return e;let t=new URL(e);return t.pathname="/embed".concat(t.pathname),t.toString()}catch(t){return e}},keywords:["airtable","database","spreadsheet","table"]},r={label:()=>"Amplitude",key:"embed.amplitude",keywords:["amplitude","analytics"],description:()=>o.Ru._({id:"wa1wV8"}),icon:n.q9c,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/amplitude.5828f141.svg",height:64,width:64,blurWidth:0,blurHeight:0},urlRegex:/^https?:\/\/analytics.amplitude.com/};var s=l(95370);let d={key:"image.bing",label:()=>o.Ru._({id:"2V6hMo"}),icon:s.uu9,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/bing.0f94cfbe.svg",height:1024,width:678,blurWidth:0,blurHeight:0},keywords:["image","photo","bing","pic"]},u={label:()=>"Calendly",key:"embed.calendly",description:()=>o.Ru._({id:"grPhlY"}),icon:n.okg,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/calendly.d1a57857.svg",height:150,width:150,blurWidth:0,blurHeight:0},urlRegex:/^https?:\/\/calendly.com/,defaultDisplayStyle:"inline",inlineInteractive:!0,categories:["form"],iframeOptions:{allowPopups:!0},keywords:["calendly","meeting","schedule","appointment"]},c={label:()=>o.Ru._({id:"bk8Zu0"}),key:"image.custom",description:()=>o.Ru._({id:"RPwTMJ"}),icon:n.Cyq,keywords:["image","upload"],resizeToFit:!0};var m=l(90886),f=l(25369);let p={label:()=>"Figma",key:"embed.figma",icon:s.slN,keywords:["design","prototype","wireframe","figjam","whiteboard"],description:()=>o.Ru._({id:"riUMyL"}),image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/figma.14e7d0c1.svg",height:2500,width:1667,blurWidth:0,blurHeight:0},urlRegex:/^https?:\/\/www.figma.com/,canEmbedPrivate:!0,forcePreviewOnMobile:!0,rewriteEmbedUrl:e=>{if(e.includes("embed.figma.com"))return e;let t=e.match(/figma\.com\/(file|proto|design|board)\/([^/?]+)\/([^/?]+)/);if(!t)return e;let[,l,a,n]=t;try{return"https://embed.figma.com/".concat(l,"/").concat(a,"/").concat(n,"?embed-host=share")}catch(t){return console.error("[FigmaProvider] Error rewriting Figma URL: ".concat(t)),f.l7("figmaEmbedData",{type:l,designId:a,title:n,url:e}),f.Cp(t),e}}};var g=l(39286),h=l(4022),b=l(77214),y=l(92405);let v={label:()=>"Gamma embed",key:"embed.gamma",icon:n.c9S,keywords:["embed"],description:()=>o.Ru._({id:"XLlwPZ",values:{GAMMA_ARTIFACT_PROPER_NOUN:g.TP}}),image:h.A,urlRegex:/^https?:\/\/(www\.|staging\.)?gamma.app/,canEmbedPrivate:!0,forcePreviewOnMobile:!0,rewriteEmbedUrl:e=>{if((0,y.fS)(e))return e;let t=(0,y.TY)(e),l=(0,b.t$)(e)||"gamma.app";return"https://".concat(l,"/embed/").concat(t)}};var k=l(24263);let w={label:()=>"Google Drive",key:"embed.gdrive",description:()=>o.Ru._({id:"1q3pN1",values:{SHEETS_PROPER_NOUN:"Sheets",DOCS_PROPER_NOUN:"Docs",SLIDES_PROPER_NOUN:"Slides",GAMMA_ARTIFACT_PROPER_NOUN:g.TP}}),icon:s.xG9,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/google-drive.2d314cf9.svg",height:78,width:87,blurWidth:0,blurHeight:0},urlRegex:/^https?:\/\/docs.google.com\//,canEmbedPrivate:!0,rewriteEmbedUrl:e=>{if(!e.includes("/presentation/"))return new URL(e.replace("/preview","/edit")).toString();{let t=new URL(e.replace("/edit","/preview"));return t.searchParams.set("rm","minimal"),t.toString()}},keywords:["docs","sheet","slide","gdrive","document"]},x={label:()=>"Google Form",key:"embed.google.form",description:()=>o.Ru._({id:"sgbNf4"}),icon:s.xG9,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/google-form.c5494f4d.svg",height:66,width:48,blurWidth:0,blurHeight:0},urlRegex:/^https?:\/\/docs.google.com\/forms/,canEmbedPrivate:!0,keywords:["google form","form","survey","questionnaire"],defaultDisplayStyle:"inline",inlineInteractive:!0,categories:["form"],iframeOptions:{allowPopups:!0}},S={key:"image.google",label:()=>o.Ru._({id:"h2JWN5"}),icon:s.FjH,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/google-image.5d5a5835.svg",height:24,width:24,blurWidth:0,blurHeight:0},keywords:["image","photo"]},A={key:"color.gradient",label:()=>o.Ru._({id:"/S8bMP"}),description:()=>o.Ru._({id:"/XRwS6"}),icon:n.S7o,keywords:["gradient","color","mesh"]};var C=l(25817);let z={label:()=>"Instagram",key:"embed.instagram",icon:s.QV6,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/instagram.d0a61bd7.svg",height:132,width:132,blurWidth:0,blurHeight:0},urlRegex:/^https?:\/\/www.instagram.com/,defaultDisplayStyle:"inline",iframeOptions:{allowPopups:!0},inlineInteractive:!0,preferHtml:!0,keywords:["instagram","insta","social"],minWidth:"328px"},I={label:()=>"Jotform",key:"embed.jotform",description:()=>o.Ru._({id:"7yLOnm"}),icon:n.n2$,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/jotform.0a55e4a9.svg",height:334,width:304,blurWidth:0,blurHeight:0},urlRegex:/^https?:\/\/form\.jotform\.com/,defaultDisplayStyle:"inline",inlineInteractive:!0,categories:["form"],iframeOptions:{allowPopups:!0},keywords:["jotform","form","survey","questionnaire"]},j={key:"image.lexica",featureFlag:"lexicaImageSearch",label:()=>o.Ru._({id:"cSVX+F"}),description:()=>o.Ru._({id:"RdyK6U"}),image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/lexica.8699ff3f.png",height:48,width:48,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAAHlBMVEVMaXH///+/v78xMTG2trYNDQ0SEhKwsLC6urqnp6cTTeQWAAAACnRSTlMAAd82rxZZ466vHPM4JQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAChJREFUeJxjYGBgZmYAAUYGTnYog4MJymDBYCCk2FlZwQxmNjY2VgYADLgAbROHxbEAAAAASUVORK5CYII=",blurWidth:8,blurHeight:8},keywords:["ai","lexica","stable diffusion","generated","photo","photography","image"]},F={key:"video.loom",label:()=>o.Ru._({id:"yrPgHm"}),description:()=>o.Ru._({id:"NMTPSf"}),icon:n.n2W,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/loom.a033778e.svg",height:190,width:190,blurWidth:0,blurHeight:0},urlRegex:/^https:\/\/www.loom.com/,rewriteEmbedUrl:e=>{if(!e.includes("/embed/"))return e;let t=new URL(e);return t.searchParams.set("hideEmbedTopBar","true"),t.toString()},keywords:["video","recording","loom","screen"]},B={key:"embed.microsoft.office",label:()=>"Office 365",description:()=>o.Ru._({id:"cbRq5v",values:{MICROSOFT_PROPER_NOUN:"Microsoft",WORD_PROPER_NOUN:"Word",POWERPOINT_PROPER_NOUN:"PowerPoint",EXCEL_PROPER_NOUN:"Excel",ONENOTE_PROPER_NOUN:"OneNote"}}),icon:s.uu9,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/office-365.868363a8.svg",height:48,width:48,blurWidth:0,blurHeight:0},urlRegex:/^https?:\/\/.*\.sharepoint\.com\//,canEmbedPrivate:!0,iframeOptions:{allowPopups:!0},rewriteEmbedUrl:e=>{let t=new URL(e.replace("/:p:/r","").replace("/doc2.aspx","/Doc.aspx"));return t.searchParams.set("action","embedview"),t.searchParams.delete("mobileredirect"),t.toString()},keywords:["word","excel","powerpoint","office","microsoft","msoffice"]},R={label:()=>o.Ru._({id:"yA1Sb+",values:{MIRO_PROPER_NOUN:"Miro"}}),key:"embed.miro",icon:n.Kuo,description:()=>o.Ru._({id:"Px3dYF"}),image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/miro.78878247.svg",height:2500,width:2500,blurWidth:0,blurHeight:0},urlRegex:/^https?:\/\/miro.com/,canEmbedPrivate:!0,forcePreviewOnMobile:!0,iframeOptions:{allowPopups:!0},keywords:["whiteboard","workshop","brainstorm","miro"],rewriteEmbedUrl:e=>(e.includes("/embed/")||e.includes("/live-embed/")||(e=e.replace("/board/","/embed/")),e.includes("embedAutoplay=")||(e+=(e.includes("?")?"&":"?")+"embedAutoplay=true&autoplay=yep"),e)},_={label:()=>o.Ru._({id:"1r0gtu"}),key:"embed.pdf",description:()=>o.Ru._({id:"2SUV3x"}),icon:n.O_q,urlRegex:/\.pdf$/,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/PDF_icon.2d280cf2.svg",height:512,width:512,blurWidth:0,blurHeight:0},featureFlag:"uploadPDF",iframeOptions:{noSandbox:!0},downloadable:!0,keywords:["pdf","doc","upload","file"]};var M=l(74146),E=l(3040);let T={key:"embed.microsoft.powerbi",label:()=>"PowerBI",image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/powerbi.94baf198.svg",height:630,width:630,blurWidth:0,blurHeight:0},icon:E.hem,urlRegex:/^https?:\/\/app\.powerbi\.com\//,canEmbedPrivate:!0,iframeOptions:{allowPopups:!0},keywords:["microsoft","powerbi"]},O={label:()=>o.Ru._({id:"toutGW"}),key:"image.qrCode",icon:l(20501).Yop,keywords:["qr","qrcode"],resizeToFit:!0},P={label:()=>"Spotify",key:"video.spotify",keywords:["spotify","music","podcast","playlist","song","album"],description:()=>o.Ru._({id:"lrKTd0"}),icon:s.QEP,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/spotify.2dd06f33.svg",height:1333,width:1333,blurWidth:0,blurHeight:0},urlRegex:/^https?:\/\/open.spotify.com/,preferHtml:!0},N={label:()=>"Tally Form",key:"embed.tally",description:()=>o.Ru._({id:"Qzo1BZ"}),icon:n.n2$,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/tally.dd047104.png",height:512,width:512,blurDataURL:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAMAAADz0U65AAAANlBMVEVMaXE0E101El/WGcw0EV71GOI0E1ouBVgwEVs1EmAzEl40El9uFIbjG9v/Hu+cF6U3E1//HPTo62sPAAAAEnRSTlMAXX1kJiNdBtn+7KX26aH8oEjnHZjJAAAACXBIWXMAAAsTAAALEwEAmpwYAAAANUlEQVR4nC3GQRKAIAzF0CjF9isK3v+yDB3eJsE3LJLBI0kDsFvqP8Cp9n4V8IiyCteB56QJO9EBVMm1x1cAAAAASUVORK5CYII=",blurWidth:8,blurHeight:8},urlRegex:/^https?:\/\/tally.so/,defaultDisplayStyle:"inline",inlineInteractive:!0,categories:["form"],iframeOptions:{allowPopups:!0}},D=/\/video\/(\d+)/,L={label:()=>"TikTok",key:"video.tiktok",icon:s.AIX,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/tiktok.cbd7f7ff.svg",height:256,width:256,blurWidth:0,blurHeight:0},urlRegex:/^https?:\/\/www.tiktok.com/,defaultDisplayStyle:"inline",iframeOptions:{allowPopups:!0},preferHtml:!0,rewriteEmbedUrl(e){var t;let l=null===(t=e.match(D))||void 0===t?void 0:t[1];return l?"https://www.tiktok.com/embed/v2/".concat(l):e},keywords:["tiktok","video","social"],minWidth:"325px",maxWidth:"325px"},W={key:"embed.twitter",label:()=>"Tweet",icon:s.HQ1,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/twitter.c7499c85.svg",height:1110,width:1110,blurWidth:0,blurHeight:0},urlRegex:/^https?:\/\/(www\.)?twitter\.com/,keywords:["twitter","tweet"],preferHtml:!0,defaultDisplayStyle:"inline",inlineInteractive:!0},U={label:()=>"Typeform",key:"embed.typeform",description:()=>o.Ru._({id:"yjYR46"}),icon:E.n2$,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/typeform.6d709d2e.svg",height:800,width:800,blurWidth:0,blurHeight:0},urlRegex:/^https?:\/\/([a-z0-9]*\.)?typeform\.com/,defaultDisplayStyle:"inline",inlineInteractive:!0,categories:["form"],iframeOptions:{allowPopups:!0},keywords:["typeform","form","survey","questionnaire"]};var G=l(47117);let H={key:"video.vimeo",label:()=>o.Ru._({id:"M1Uyl1"}),icon:s.vYD,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/vimeo.4de20653.svg",height:48,width:48,blurWidth:0,blurHeight:0},urlRegex:/^https?:\/\/(player\.)?vimeo\.com/,keywords:["vimeo","video"]};var V=l(2767),q=l(19099);let K={label:()=>"Wistia",key:"video.wistia",icon:n.n2W,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/wistia.613af213.svg",height:1899,width:2500,blurWidth:0,blurHeight:0},urlRegex:/^https?:\/\/fast.wistia.net/,keywords:["wistia","video"]},J={key:"video.youtube",label:()=>o.Ru._({id:"7J5KkU"}),icon:s.B4m,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/youtube.b0610934.svg",height:461,width:461,blurWidth:0,blurHeight:0},urlRegex:/^https?:\/\/www\.youtube\.com/,keywords:["youtube","video"]},$=[d,k.P,S,V.R,j,G.a,J,F,p,x,w,q.J,c,O,a.U,B,T,W,H,m.G,_,R,i,r,K,P,L,z,A,C.Z,u,U,I,N,v,M.x],Q=Object.fromEntries(Object.values($).flat().map(e=>[e.key,e]))},74146:(e,t,l)=>{"use strict";l.d(t,{x:()=>n});var a=l(12327);let n={key:"image.pictographic",featureFlag:"pictographicImageSearch",label:()=>a.Ru._({id:"ualVui"}),description:()=>a.Ru._({id:"pnIyl1"}),image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/pictographic.1e90e3a6.svg",height:759,width:692,blurWidth:0,blurHeight:0},keywords:["pictographic","illustrations","photo","image"]}},47117:(e,t,l)=>{"use strict";l.d(t,{a:()=>o});var a=l(95370),n=l(12327);let o={key:"image.unsplash",label:()=>n.Ru._({id:"olwQVc",values:{UNSPLASH_PROPER_NOUN:"Unsplash"}}),description:()=>n.Ru._({id:"SDSvdl"}),icon:a.o5,image:{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/unsplash.1957709b.svg",height:24,width:24,blurWidth:0,blurHeight:0},keywords:["stock","photo","photography","image","unsplash"],resizeToFit:!0}},2767:(e,t,l)=>{"use strict";l.d(t,{R:()=>o});var a=l(12917),n=l(12327);let o={key:"image.web",featureFlag:"webImageSearch",label:()=>n.Ru._({id:"coorYU"}),icon:a.$UM,keywords:["image","photo","pic"],description:()=>n.Ru._({id:"NMbF1d"}),resizeToFit:!0}},19099:(e,t,l)=>{"use strict";l.d(t,{J:()=>o});var a=l(12917),n=l(12327);let o={label:()=>n.Ru._({id:"/hLjBB"}),description:()=>n.Ru._({id:"wRlboO"}),key:"embed.custom",icon:a.c9S,keywords:["webpage","website","app","embed","iframe"]}},18784:(e,t,l)=>{"use strict";l.d(t,{X:()=>a});let a="square"},4977:(e,t,l)=>{"use strict";l.d(t,{A:()=>a});var a=function(e){return e[e.Done=0]="Done",e[e.Uploading=1]="Uploading",e[e.Error=2]="Error",e[e.Queued=3]="Queued",e}({})},952:(e,t,l)=>{"use strict";l.d(t,{KD:()=>i,P6:()=>r,TF:()=>s,ve:()=>o});var a=l(90937),n=l(18784);let o=e=>{var t,l,a,n,o,i;return(null===(t=e.meta)||void 0===t?void 0:t.description)||(null===(l=e.meta)||void 0===l?void 0:l.alt_description)||(null===(a=e.meta)||void 0===a?void 0:a.title)||(null===(n=e.meta)||void 0===n?void 0:n.snippet)||(null===(i=e.meta)||void 0===i?void 0:null===(o=i.tags)||void 0===o?void 0:o.join(", "))||e.query},i=e=>e.height>e.width?"portrait":e.height{if(e.meta&&e.meta.width&&e.meta.height)return i(e.meta);if(e.aiParams){let t=e.aiParams;if(t.aspectRatio)return t.aspectRatio;if(t.width&&t.height)return i({width:t.width,height:t.height})}return n.X},s=(e,t,l)=>{let n={src:e.imageUrl,tempUrl:e.thumbnailUrl,meta:{height:e.height,width:e.width,description:e.description,alt_description:e.altDescription,title:e.title,snippet:e.snippet},query:t,source:a.j[l]};return"aiGenerated"===l&&(n.aiParams={prompt:e.aiPrompt,height:e.height,width:e.width,model:e.aiModel,stylePreset:e.aiStylePreset}),n}},90754:(e,t,l)=>{"use strict";l.d(t,{E:()=>r});var a=l(33023),n=l(14041),o=l(32133),i=l(73524);let r=e=>{let{id:t,...l}=e,{isOpen:r,onOpen:s,onClose:d}=(0,a.j)(l),u=(0,o.wA)();return(0,n.useEffect)(()=>{t&&u((0,i.WI)({id:t,isOpen:r}))},[r,u,t]),(0,n.useEffect)(()=>()=>{t&&u((0,i.WI)({id:t,isOpen:!1}))},[u,t]),{isOpen:r,onOpen:s,onClose:d}}},73524:(e,t,l)=>{"use strict";l.d(t,{Ff:()=>s,WI:()=>r});var a=l(8796);let n={openModals:{}},o=(0,a.Z0)({name:"ModalState",initialState:n,reducers:{reset:()=>n,setModalOpen(e,t){let{id:l,isOpen:a}=t.payload;e.openModals[l]=a}}}),{reset:i,setModalOpen:r}=o.actions,s=o.reducer},93834:(e,t,l)=>{"use strict";l.d(t,{Ok:()=>h});var a=l(31085),n=l(35687),o=l(61778),i=l(85146),r=l(20501),s=l(24221),d=l(52177),u=l(12327);l(65998),l(32849);var c=l(77914),m=l(39286),f=l(20221),p=l(78821);let g=e=>{let{productKey:t}=e,l=Object.entries(f.Rz).filter(e=>{let[l]=e;return(0,f.kO)(l)===t});return(0,a.jsxs)(n.B,{spacing:"0",children:[(0,a.jsx)(o.E,{color:"gray.400",children:(0,a.jsx)(d.x6,{id:"/AD408"})}),(0,a.jsx)(i.B8,{children:l.map(e=>{let[t,l]=e;return(0,f.CX)(t)?(0,a.jsx)(i.ck,{children:l.label()},t):null})})]})},h=()=>({free:{name:m.v2,description:u.Ru._({id:"V2wKPH"}),buttonVariant:"plain",featureHeading:u.Ru._({id:"66mVP3"}),features:[{label:u.Ru._({id:"BTeHnk"}),icon:(0,a.jsx)(s.g,{icon:r._$C,fixedWidth:!0})},{label:(0,p.kf)("free").pricingModalLabel,infoTip:(0,a.jsx)(g,{productKey:"free"})},{label:u.Ru._({id:"uCXqkM",values:{MAX_CARDS_FREE:10}})}],includesHeading:u.Ru._({id:"yRx7sr"}),includes:[{label:(0,a.jsx)(d.x6,{id:"UMxKSW",values:{0:2e4.toLocaleString()}})},{label:u.Ru._({id:"0k1jtM",values:{GAMMA_ARTIFACT_PROPER_NOUN_PLURAL:m.Ix}})},{label:u.Ru._({id:"YcKH7w"})},{label:u.Ru._({id:"vrN3H/"}),isBeta:!0}]},plus:{name:m.H9,description:u.Ru._({id:"qytu/9"}),buttonVariant:"outline",titleColor:"trueblue.600",descriptionColor:"trueblue.700",featureHeading:u.Ru._({id:"66mVP3"}),features:[{label:(0,a.jsx)(d.x6,{id:"60SITe"})},{label:(0,p.kf)("plus").pricingModalLabel,infoTip:(0,a.jsx)(g,{productKey:"plus"})},{label:u.Ru._({id:"alnKae",values:{GAMMA_PROPER_NOUN:m.On}})},{label:(0,a.jsx)(d.x6,{id:"0tfXJh",values:{MAX_CARDS_PLUS:20}})}],includesHeading:u.Ru._({id:"jtT5YU",values:{FREE_PROPER_NOUN:m.v2}}),includes:[{label:(0,a.jsx)(d.x6,{id:"UMxKSW",values:{0:5e4.toLocaleString()}}),infoTip:u.Ru._({id:"CsSTca"})},{label:u.Ru._({id:"k62X/2"})},{label:u.Ru._({id:"zeffR0"})}],dontChurnMessage:u.Ru._({id:"N4ycY7"})},pro:{name:m.Kc,description:u.Ru._({id:"ThODgx"}),titleColor:"orchid.600",descriptionColor:"orchid.700",buttonVariant:"solid",borderColor:"var(--chakra-colors-gradient-blue-to-orange)",featureHeading:u.Ru._({id:"66mVP3"}),features:[{label:(0,a.jsx)(d.x6,{id:"60SITe"})},{label:(0,p.kf)("pro").pricingModalLabel,infoTip:(0,a.jsx)(g,{productKey:"pro"})},{label:(0,a.jsx)(d.x6,{id:"WIpbhz"}),infoTip:(0,a.jsx)(d.x6,{id:"ofH3kV",values:{GAMMA_ARTIFACT_PROPER_NOUN:m.TP}}),flag:"editDocAI"},{label:(0,a.jsx)(d.x6,{id:"37jLpL",values:{MAX_CARDS_PRO:50}})}],includesHeading:u.Ru._({id:"FY8xWK",values:{PLUS_PROPER_NOUN:m.H9}}),includes:[{label:(0,a.jsx)(d.x6,{id:"UMxKSW",values:{0:1e5.toLocaleString()}}),infoTip:u.Ru._({id:"CsSTca"})},{label:u.Ru._({id:"eJJLu0"}),infoTip:u.Ru._({id:"72pgCR",values:{GAMMA_PROPER_NOUN:m.On}})},{label:u.Ru._({id:"sjfiEU"})},{label:u.Ru._({id:"E3KfxC"})},{label:u.Ru._({id:"U0iwUz"})}],dontChurnMessage:u.Ru._({id:"I3/YZS"})}});c.SjR.Usd,c.Vd7.Month,c.SjR.Usd,c.Vd7.Year,c.SjR.Usd,c.Vd7.Month,c.SjR.Usd,c.Vd7.Year},68984:(e,t,l)=>{"use strict";l.d(t,{I:()=>o});var a=l(14041);let n=a.createContext({openUpsellModal:()=>{},product:null,subscription:void 0,proYearlyProductPrice:void 0}),o=()=>(0,a.useContext)(n)},10628:(e,t,l)=>{"use strict";l.d(t,{I:()=>a.I});var a=l(68984)},32849:(e,t,l)=>{"use strict";l.d(t,{ez:()=>r,nk:()=>d,tN:()=>u,vT:()=>s}),l(73893);var a=l(65998),n=l(60490),o=l(30358),i=l(78821);let r=(e,t)=>{let{currentWorkspace:l}=(0,n.ur)(),o=t||l,i=(0,a.u)("hasProAccess"),r=(0,n.Iy)(e,o);return!!o&&(i||r)},s=(e,t)=>{let l=(0,o.HW)(),i=n.lO.createForUser(l);if(t||(t=(0,o.vp)()),!t)return!1;let r=i.can(e,t);return a.of.get("hasProAccess")||r},d=e=>{let t=(0,a.u)("hasProAccess"),l=(0,n.Iy)("hide_gamma_badge",e);return e?!!l||t:void 0},u=e=>!!(0,i.A4)(e)},68572:(e,t,l)=>{"use strict";l.d(t,{nk:()=>W.nk,ez:()=>W.ez});var a=l(31085),n=l(18658),o=l(2600),i=l(43342),r=l(2219),s=l(61778),d=l(80532),u=l(80853),c=l(12917),m=l(24221),f=l(52177),p=l(14041);l(71197),l(65998);var g=l(78141),h=l(2657),b=l.n(h),y=l(73893),v=l(83073),k=l(44507);let w="".concat("01919ef7-fdd5-72aa-8b3e-9a438906692f").concat("production"===y.$.APPLICATION_ENVIRONMENT?"":"-test"),x="https://cdn.cookielaw.org/consent/".concat(w,"/OtAutoBlock.js"),S="https://cdn.cookielaw.org/consent/".concat(w,"/otSDKStub.js");var A=l(62849),C=l(30503);let z=()=>{let e=!(0,k.rA)()&&!(0,C.NF)();return(0,A.En)()&&e?(0,a.jsx)("div",{dangerouslySetInnerHTML:{__html:'\x3c!-- Google Tag Manager (noscript) --\x3e\n\n\x3c!-- End Google Tag Manager (noscript) --\x3e'}}):null},I=()=>{let e=!(0,k.rA)()&&!(0,C.NF)();return(0,A.En)()&&e?(0,a.jsxs)(b(),{children:[(0,a.jsx)("script",{dangerouslySetInnerHTML:{__html:"\nwindow.dataLayer = window.dataLayer || [];\nfunction gtag(){dataLayer.push(arguments);}\ngtag('js', new Date());\n\ngtag('config', 'AW-11368900852');\n"}}),(0,a.jsx)("script",{async:!0,src:"https://www.googletagmanager.com/gtag/js?id=AW-11368900852"}),(0,a.jsx)("script",{dangerouslySetInnerHTML:{__html:"\n(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':\nnew Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],\nj=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=\n'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);\n})(window,document,'script','dataLayer','GTM-TGJXRPT');\n"}})]}):null};var j=l(39286);l(10628);var F=l(78821);l(56233),l(10458),l(30358),l(77914);var B=l(60490);l(15576),new(l(36832)).b,l(55640),l(23832),l(60204);var R=l(93834),_=l(60524),M=l(27372);let E=(0,_.B)("div",{baseStyle:{w:"full",h:"full",rounded:"full",pos:"absolute",top:"0",right:"0",bottom:"0",left:"0"}});(0,M.P)(E);var T=l(35687),O=l(62230);l(95986),l(34747),l(33854);var P=l(75660);let N=e=>{let{displayAsTwoLines:t}=e;return(0,a.jsxs)(T.B,{spacing:2,h:"80px",children:[(0,a.jsx)(d.az,{minH:"12",children:(0,a.jsxs)(T.B,{align:t?"flex-start":"flex-end",direction:t?"column":"row",children:[(0,a.jsx)(O.E,{height:"3em",width:"4.5em"}),(0,a.jsxs)(T.B,{direction:"row",children:[(0,a.jsx)(O.E,{height:".75em",width:"3em"}),(0,a.jsx)(O.E,{height:".75em",width:"3em"})]})]})}),(0,a.jsx)(O.E,{height:"1.5em",width:"10em"})]})},D=(0,p.memo)(e=>{let{isFree:t,selectedBillingCycleKey:l,productPrice:n,displayAsTwoLines:o}=e,i=(0,p.useMemo)(()=>(null==n?void 0:n.frequencyUnit)==="year"?(0,F.y7)(n):null,[n]);return(0,a.jsx)(s.E,{textAlign:o?"left":void 0,color:"gray.700",fontSize:"sm",children:t?(0,a.jsx)(f.x6,{id:"r0pThp"}):"monthly"===l?(0,a.jsx)(f.x6,{id:"aIkeAd"}):(null==i?void 0:i.discountedPrice)?(0,a.jsx)(f.x6,{id:"dl2uS6",values:{0:i.price,1:i.discountedPrice},components:{0:(0,a.jsx)(s.E,{as:"span",textDecoration:"line-through",mr:1,color:"gray.400"})}}):(0,a.jsx)(f.x6,{id:"hRcVGy",values:{0:null==i?void 0:i.price}})})});D.displayName="BillingCycleDescription",(0,p.memo)(e=>{let{isFree:t,productPrice:l,selectedBillingCycleKey:n,currencyOverride:o}=e,{isUserLoading:i}=(0,B.ur)(),r=100>(0,F.GP)(null==l?void 0:l.currency)||(0,F.VB)(null==l?void 0:l.currency);return(0,A.En)()&&!i&&(t||l)?(0,a.jsxs)(d.az,{children:[(0,a.jsx)(d.az,{minH:"12",children:(0,a.jsx)(T.B,{align:r?"flex-start":"center",direction:r?"column":"row",children:(0,a.jsx)(f.x6,{id:"dPKZZo",components:{0:(0,a.jsx)(s.E,{fontSize:"2.5rem",fontWeight:"semibold",lineHeight:"1",color:"gray.800",fontFamily:"p22-mackinac-pro"}),1:(0,a.jsx)(L,{isFree:t,productPrice:l,currencyOverride:o}),2:(0,a.jsx)(s.E,{lineHeight:r?1:void 0,fontSize:"sm",pb:r?"1":void 0,fontFamily:"p22-mackinac-pro"})}})})}),(0,a.jsx)(D,{isFree:t,selectedBillingCycleKey:n,productPrice:l,displayAsTwoLines:r})]}):(0,a.jsx)(N,{displayAsTwoLines:r})}).displayName="PriceAndBillingCycle";let L=(0,p.memo)(e=>{let{isFree:t,productPrice:l,currencyOverride:n}=e,{discountedPrice:o,price:i}=(0,F.vC)(l)||{};return t?(0,a.jsx)(a.Fragment,{children:(0,P.v)(0,{currency:n})}):o?(0,a.jsxs)(T.B,{direction:"row",alignItems:"center",children:[(0,a.jsx)(s.E,{color:"gray.400",fontSize:"2rem",textDecoration:"line-through",children:i}),(0,a.jsx)(s.E,{children:o})]}):(0,a.jsx)(a.Fragment,{children:i})});L.displayName="PricePerSeatPerMonth",l(72239),l(14691),function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]}(e=>{let{isVerifying:t=!1,product:l,onClick:p}=e,g=l?(0,R.Ok)()[l].name:"";return(0,a.jsx)(n.c,{children:t?(0,a.jsxs)(o.T,{py:12,spacing:4,children:[(0,a.jsx)(i.y,{size:"lg"}),(0,a.jsx)(r.D,{fontFamily:"p22-mackinac-pro",letterSpacing:"tight",size:"lg",fontWeight:"semibold",children:(0,a.jsx)(f.x6,{id:"kzd5yt"})}),(0,a.jsx)(s.E,{children:(0,a.jsx)(f.x6,{id:"Nwo9pM"})})]}):(0,a.jsxs)(o.T,{py:8,spacing:10,children:[(0,a.jsx)(d.az,{color:"green.500",children:(0,a.jsx)(m.g,{icon:c.QRE,size:"4x"})}),(0,a.jsx)(r.D,{fontFamily:"p22-mackinac-pro",letterSpacing:"tight",size:"lg",fontWeight:"semibold",children:(0,a.jsx)(f.x6,{id:"7Xmwpp"})}),(0,a.jsx)(u.$,{size:"lg",variant:"solid",onClick:p,children:(0,a.jsx)(f.x6,{id:"SGsdhu",values:{GAMMA_PROPER_NOUN:j.On,productName:g}})})]})})},!1);var W=l(32849)},78821:(e,t,l)=>{"use strict";l.d(t,{A4:()=>y,GP:()=>s,VB:()=>d,gD:()=>b,kf:()=>v,vC:()=>c,y7:()=>p});var a=l(98092),n=l(12327),o=l(55640),i=l(75660);let r=[o.SjR.Jpy,o.SjR.Krw,o.SjR.Vnd],s=e=>e&&r.includes(e)?1:100,d=e=>e===o.SjR.Twd,u=e=>100>s(e)?"standard":"compact",c=function(e){var t,l;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!e||!e.price||!e.frequencyInterval||!e.frequencyUnit)return{price:null,discountedPrice:null};let{currency:n,frequencyInterval:o,frequencyUnit:i,price:r}=e,s=null!==(l=null===(t=e.discount)||void 0===t?void 0:t.price)&&void 0!==l?l:null;return{price:m({frequencyUnit:i,price:r,currency:n,frequencyInterval:o,seatCount:a}),discountedPrice:s?m({frequencyUnit:i,price:s,currency:n,frequencyInterval:o,seatCount:a}):null}},m=e=>{let{frequencyUnit:t,price:l,currency:a,frequencyInterval:n,seatCount:r}=e,d=u(a),c=l*r/s(a)/(t===o.Vd7.Year?12:1)/n;return(0,i.v)(c,{currency:a,notation:d})},f=e=>{let{frequencyUnit:t,price:l,currency:a,frequencyInterval:n,seatCount:r}=e,d=u(a),c=l*r/s(a)/n*(t===o.Vd7.Month?12:1);return(0,i.v)(c,{currency:a,notation:d})},p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!e||!e.price||!e.frequencyInterval||!e.frequencyUnit)return{price:null,discountedPrice:null};let{currency:l,frequencyInterval:a,frequencyUnit:n,price:o,discount:i}=e,r=(null==i?void 0:i.price)||null;return{price:f({frequencyUnit:n,price:o,currency:l,frequencyInterval:a,seatCount:t}),discountedPrice:r?f({frequencyUnit:n,price:r,currency:l,frequencyInterval:a,seatCount:t}):null}},g=e=>{var t;return!!(null==e?void 0:null===(t=e.products)||void 0===t?void 0:t.some(e=>"pro"===e))},h=e=>{var t;return!!(null==e?void 0:null===(t=e.products)||void 0===t?void 0:t.some(e=>"plus"===e))},b=e=>a.ProductFeatureMap.plus.includes(e)?"plus":a.ProductFeatureMap.pro.includes(e)?"pro":null,y=e=>g(e)?"pro":h(e)?"plus":null,v=e=>{switch(e){case"free":return{header:n.Ru._({id:"fUbwwm"}),pricingModalLabel:n.Ru._({id:"Y09HZs"})};case"plus":return{header:n.Ru._({id:"gkDjM6"}),pricingModalLabel:n.Ru._({id:"DbNDpy"})};case"pro":return{header:n.Ru._({id:"VJyHF/"}),pricingModalLabel:n.Ru._({id:"FzkyXT"})}}}},62911:(e,t,l)=>{"use strict";l.d(t,{r:()=>f});var a=l(31085),n=l(56824),o=l(35687),i=l(80532),r=l(61778),s=l(12917),d=l(24221),u=l(52177),c=l(14041);let m={padding:{sm:4,md:4,lg:6},fontSize:{sm:"sm",md:"md",lg:"lg"},iconSize:{sm:"lg",md:"2x",lg:"3x"},labelFontSize:{sm:"xs",md:"sm",lg:"md"},spacing:{sm:1,md:2,lg:3}},f=(0,c.memo)(e=>{let{description:t,heading:l,isConnected:c=!0,size:f="lg",...p}=e,g=(0,n.dU)("gray.50","whiteAlpha.100");if(c)return null;let{spacing:h,padding:b,iconSize:y,fontSize:v,labelFontSize:k}=m;return(0,a.jsxs)(o.B,{spacing:h[f],p:b[f],borderRadius:"lg",bg:g,textAlign:"center",alignItems:"center",...p,children:[(0,a.jsx)(i.az,{opacity:.5,children:(0,a.jsx)(d.g,{icon:s.seF,size:y[f]})}),(0,a.jsx)(r.E,{fontWeight:"600",fontSize:v[f],mt:2,children:l||(0,a.jsx)(u.x6,{id:"ysdDIA"})}),(0,a.jsx)(r.E,{color:"gray.500",fontSize:k[f],children:t})]})});f.displayName="OfflineInfoBox"},78776:(e,t,l)=>{"use strict";l.d(t,{A:()=>o});var a=l(31085);l(14041);var n=l(91559);let o=e=>t=>{let{isInOfflineMode:l}=(0,n.u)();return l?null:(0,a.jsx)(e,{...t})}},5720:(e,t,l)=>{"use strict";l.d(t,{Dj:()=>b,MN:()=>p,yy:()=>h});var a=l(8796),n=l(41054);let o=(0,a.Z0)({name:"OfflineManager",initialState:{offlineModeEnabled:!1,ydocs:{},docAssets:{},graphqlDocs:{},user:null,userLastSynced:null},reducers:{loadOfflineManagerState:(e,t)=>t.payload,enableOfflineMode:(e,t)=>{if(e.offlineModeEnabled)return e;let{user:l,lastSynced:a}=t.payload;return{...e,offlineModeEnabled:!0,user:l,userLastSynced:a}},disableOfflineMode:e=>e.offlineModeEnabled?{...e,user:null,userLastSynced:null,offlineModeEnabled:!1}:e,setYdocSynced:(e,t)=>{let{docId:l,lastSynced:a}=t.payload;e.ydocs[l]={docId:l,lastSynced:a}},setGraphqlSynced:(e,t)=>{let{docIds:l,lastSynced:a}=t.payload;l.forEach(t=>{e.graphqlDocs[t]={docId:t,lastSynced:a}})},setAssetsSynced:(e,t)=>{let{docId:l,lastSynced:a}=t.payload;e.docAssets[l]={docId:l,lastSynced:a}},removeYDocSyncedDocs:(e,t)=>{let{docIds:l}=t.payload;l.forEach(t=>{delete e.ydocs[t]})},setOfflineUser:(e,t)=>{let{user:l,lastSynced:a}=t.payload;e.user=l,e.userLastSynced=a},apolloCacheDisabled:e=>{for(let t in e.graphqlDocs)delete e.graphqlDocs[t]},serwistDisabled:e=>{for(let t in e.docAssets)delete e.docAssets[t]}}}),{loadOfflineManagerState:i,setYdocSynced:r,setGraphqlSynced:s,setAssetsSynced:d,setOfflineUser:u,removeYDocSyncedDocs:c,enableOfflineMode:m,disableOfflineMode:f,apolloCacheDisabled:p,serwistDisabled:g}=o.actions,h=e=>e.OfflineManager.offlineModeEnabled;(0,n.Mz)(e=>e.OfflineManager.graphqlDocs,e=>e.OfflineManager.docAssets,e=>e.OfflineManager.ydocs,(e,t,l)=>Object.values(e).filter(e=>{let{docId:a}=e;return!!l[a]&&!!t[a]}).map(e=>{let{docId:t}=e;return t}));let b=o.reducer},95564:(e,t,l)=>{"use strict";l(27132),l(88957),l(5720)},56233:(e,t,l)=>{"use strict";l.d(t,{jb:()=>a}),(0,l(69087).g)();let a=e=>{window.optimizely=window.optimizely||[],window.optimizely.push({type:"event",eventName:"sign_up_complete",properties:e})}},12790:(e,t,l)=>{"use strict";l.d(t,{cq:()=>o});var a=l(14041);let n=(0,a.createContext)(void 0),o=()=>(0,a.useContext)(n)},47538:(e,t,l)=>{"use strict";l.d(t,{ld:()=>g,El:()=>f,iZ:()=>m,lp:()=>p});var a=l(8796);let n={left:{component:null,isOpen:!1,width:340,disableTransition:!1},right:{component:null,isOpen:!1,width:400,disableTransition:!1}},o=(0,a.Z0)({name:"Panels",initialState:n,reducers:{initializePanel(e,t){let{component:l}=t.payload;e[l.panelPosition].component=l},openPanel(e,t){let{component:l,disableTransition:a}=t.payload,n=l.panelPosition;e[n].component=l,e[n].isOpen=!0,e[n].disableTransition=!!a},closePanel(e,t){e[t.payload.position].isOpen=!1},setPanelWidth(e,t){e[t.payload.position].width=t.payload.width},resetPanels:()=>n}}),{closePanel:i,openPanel:r,setPanelWidth:s,resetPanels:d,initializePanel:u}=o.actions,c=e=>t=>!!t.Panels[e].isOpen,m=e=>t=>{var l,a;let n=t.Panels.left,o=t.Panels.right,i=(null===(l=n.component)||void 0===l?void 0:l.panelName)===e&&n.isOpen,r=(null===(a=o.component)||void 0===a?void 0:a.panelName)===e&&o.isOpen;return i||r},f=e=>t=>{let l=t.Panels[e.panelPosition].component;return c(e.panelPosition)(t)&&l===e},p=e=>t=>c(e)(t)?t.Panels[e].width:0,g=o.reducer},69087:(e,t,l)=>{"use strict";l.d(t,{g:()=>b});var a=l(3478),n=l(69011),o=l.n(n),i=l(73893),r=l(44507),s=l(30503),d=l(72239);let u=e=>c(e),c=e=>{if(!e)return null;let t={},l=e.split("?");if(l.length>1)for(let e of l[1].split("&")){let[l,a]=e.split("=");if(l.startsWith("utm_")){let e=l.replace("utm_","");"campaign"===e?t.name=decodeURIComponent(a):t[e]=decodeURIComponent(a)}}return 0===Object.keys(t).length?null:t},m=()=>{var e,t,l,a;if(!i.$.IS_CLIENT_SIDE)return{};let n=r.OI.getBrowser(),o=r.OI.getDevice(),s=r.OI.getOS(),d={timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,userAgent:navigator.userAgent,locale:navigator.language,browser:{name:n.name,version:n.version}};return n&&(d.browser={name:n.name,version:n.version}),o&&o.type&&("device"in d||(d.device={}),(e=d.device).type||(e.type=o.type),(t=d.device).model||(t.model=o.model)),s&&("os"in d||(d.os={}),(l=d.os).name||(l.name=s.name),(a=d.os).version||(a.version=s.version)),d},f="gammaUserMetadata",p=o()(()=>m()),g=()=>!(0,r.rA)()&&!(0,s.NF)();class h{async doFetch(){if(!this.enabled)return Promise.reject("User metadata fetching not enabled");let e=a.A.get("lastReferrer"),t=a.A.get("firstPageSeen"),l=u(t),n=await fetch("https://".concat(i.$.EVENT_TRACKING_ENDPOINT,"/user-context"),{body:JSON.stringify({context:{timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,userAgent:navigator.userAgent,locale:navigator.language,lastReferrer:e,firstPageSeen:t,campaign:l}}),headers:{"Content-Type":"text/plain"},method:"POST"});return n.ok?await n.json():(console.error("[UserMetadataStore] Failed to fetch user metadata",n.statusText),Promise.reject())}get(){let e=d.x.getItem(f);if(!e)return p();try{return JSON.parse(e)||p()}catch(e){}return p()}fetch(){return this.promise||(this.promise=this.doFetch(),this.promise.then(e=>{e&&d.x.setItem(f,JSON.stringify(e))}).catch(()=>{})),this.promise}constructor(){this.enabled=g(),this.promise=null}}let b=o()(()=>new h)},8305:(e,t,l)=>{"use strict";l.d(t,{w:()=>eP});var a=l(14041),n=l(47538),o=l(88957),i=l(61690),r=l(36661),s=l(31085),d=l(25420),u=l(43342),c=l(20501),m=l(24221),f=l(95986),p=l(27372),g=l(12567),h=l(32133),b=l(78784),y=l(65998),v=l(38452);let k=a.forwardRef((e,t)=>{let{children:l,...a}=e;return(0,s.jsx)(d.s,{ref:t,width:"100%",...a,children:l})});k.displayName="Panel";var w=l(17303),x=l(65084),S=l(1771),A=l(36830),C=l(38684),z=l(43909),I=l(14e3),j=l(44507),F=l(62849),B=l(56824),R=l(18201),_=l(94259),M=l(22495),E=l(52177),T=l(12327),O=l(7059),P=l(77566),N=l(2219);let D=e=>{let{children:t}=e,l=(0,j.Xb)();return(0,s.jsx)(N.D,{fontSize:l?"2xl":"3xl",fontWeight:l?"bold":800,letterSpacing:l?"tight":-1,noOfLines:1,children:t})};var L=l(10458),W=l(59707),U=l(80853),G=l(9021),H=l(63552),V=l(78354);(0,H.R)((e,t)=>{let{children:l,icon:a,onClick:n,rightIcon:o,variant:i,...r}=e,d=(0,V.h5)(["xs","sm"]),u=(0,B.dU)("blackAlpha.100","whiteAlpha.100");return(0,s.jsx)(U.$,{ref:t,variant:i,fontWeight:"normal",size:d,leftIcon:a,onClick:n,rightIcon:o,..."solid"!==i?{variant:"ghost",colorScheme:"gray",_hover:{bg:u}}:{},...r,children:l})});let q=(0,H.R)((e,t)=>{let{icon:l,variant:a,...n}=e,o=(0,B.dU)("blackAlpha.100","whiteAlpha.100");return(0,s.jsx)(G.K,{ref:t,variant:a,fontWeight:"normal",size:"sm",icon:l,..."solid"!==a?{variant:"ghost",colorScheme:"gray",_hover:{bg:o}}:{},...n})});var K=l(12784),J=l.n(K),$=l(33242),Q=l(13236),Y=l(19534);let X=(e,t)=>{let l={},a=(0,Q.xe)(t,Y.jg);if(!a)return[];for(let{node:t,pos:n}of a)l[t.attrs.id]=[e+n,e+n+t.nodeSize];return Object.values(l)},Z=(e,t,l)=>{let{to:a,from:n}=l;return e===n&&t===a||e(0,Q.xe)(e,Y.jg).map(e=>e.node.attrs.id),et=(e,t,l)=>{let a=l.start(),n=a+l.node().nodeSize,o=X(a+1,t),i=Z(a,n,e),r=o.find(t=>{let[l,a]=t;return Z(l,a,e)});return i?r?"child":"self":"none"},el=e=>{let{editorMode:t,resolved:l,node:a,selection:n}=e,r=(0,o.GV)(i.$i);if(!l)return"none";if(t===I.w.DOC_VIEW)return et(n,a,l);if(t===I.w.SLIDE_VIEW&&r){let e=ee(a);return r===a.attrs.id?"self":e.includes(r)?"child":"none"}return"none"},ea=e=>{let[t,l]=(0,a.useState)(),[n,o]=(0,a.useState)(null),[i,r]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{if(!e)return;let t=e=>{let{editor:t}=e;l(t.getJSON())},a=e=>{let{editor:t,transaction:l}=e;o(t.state.selection),r((null==l?void 0:l.getMeta($.H))==="toc")};t({editor:e}),a({editor:e});let n=J()(t,200,{leading:!0,maxWait:500}),i=J()(a,200,{leading:!0});return e.on("update",n),e.on("selectionUpdate",i),()=>{e.off("update",n),e.off("selectionUpdate",i)}},[e]),{content:t,selection:n,isSelectionOriginTOC:i}};var en=l(80532),eo=l(77646),ei=l(99873),er=l(37590);l(73893);var es=l(15072),ed=l(63152),eu=l(38678),ec=l(60490),em=l(24537),ef=l(92405),ep=l(51416),eg=l(27559),eh=l(63373),eb=l(83858),ey=l(46210),ev=l(12790),ek=l(61778),ew=l(3040);let ex=(0,a.memo)(e=>{let{showDragHandles:t,overlap:l,onSelectClick:a,title:n,hasChildren:o,isExpanded:i,setIsExpanded:r,showDropBorder:d,previewRef:u,editorMode:f,editor:p,docId:g,cardId:h,getPos:b,onMouseEnter:y,onMouseLeave:v,isHovering:k,isTocPanelOpen:w}=e,x="child"===l,S="self"===l,{colorMode:A}=(0,B.G6)(),C="dark"===A;return(0,s.jsxs)(U.$,{ref:u,onMouseEnter:y,onMouseLeave:v,className:"toc-item",w:"100%",_hover:{...S?{}:{bg:C?"indigo.700":"indigo.50"}},p:1.5,pl:t?5:1.5,height:"auto",textAlign:"left",cursor:"pointer",borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",role:"group",onClick:e=>{a(),e.preventDefault(),e.stopPropagation()},variant:"ghost",fontWeight:"500",colorScheme:S?"trueblue":"inherit","data-testid":"toc-item-button",...d?{outline:"2px solid",outlineColor:C?"trueblue.800":"trueblue.100"}:{},children:[t&&(0,s.jsx)(en.az,{opacity:"0",display:"flex",mr:"0",alignItems:"center",color:"gray.400",borderRadius:"md",_groupHover:{opacity:1,cursor:"grab"},_hover:{bg:C?"whiteAlpha.100":"gray.100",color:"gray.800"},transitionProperty:"common",transitionDuration:"normal",pos:"absolute",top:0,bottom:0,left:0,pl:2,pr:1.5,children:(0,s.jsx)(m.g,{icon:ew.IMq,size:"sm"})}),o?(0,s.jsx)(G.K,{icon:(0,s.jsx)(m.g,{icon:c.Jt$}),size:"xs",variant:"ghost","aria-label":"collapse",isRound:!0,"data-testid":"toc-item-expand",transform:i?"rotate(0deg)":"rotate(-90deg)",onClick:e=>{e.preventDefault(),e.stopPropagation(),r(!i)},opacity:o?1:0,pointerEvents:o?"auto":"none",bg:x&&!i?C?"trueblue.800":"trueblue.50":void 0,_hover:{bg:x?C?"trueblue.700":"trueblue.100":C?"whiteAlpha.100":"blackAlpha.100"},_active:{bg:x?C?"trueblue.700":"trueblue.100":C?"whiteAlpha.100":"blackAlpha.100"}}):(0,s.jsx)(G.K,{icon:(0,s.jsx)(m.g,{icon:ew.GEE}),size:"xs",variant:"ghost","aria-label":"Collapse",isRound:!0,onClick:e=>{e.preventDefault(),e.stopPropagation()},transform:S?"scale(.6)":"scale(.4)",pointerEvents:o?"auto":"none",colorScheme:S?"trueblue":"gray"}),(0,s.jsx)(ek.E,{ml:1,whiteSpace:"normal",noOfLines:1,wordBreak:"break-all","data-testid":"toc-item-title",children:n||(0,s.jsx)(E.x6,{id:"wja8aL"})}),(0,s.jsx)(R.h,{})]})}),eS=(0,a.memo)(a.forwardRef((e,t)=>{let{userCanEdit:l,isRoot:n,expandBox:o,overlap:i,onSelectClick:r,title:d,hasChildren:u,isExpanded:c,setIsExpanded:m,children:p,showDropBorder:g,previewRef:h,editorMode:b,editor:v,isSelectionOriginTOC:k,docId:w,cardId:S,getPos:A,screenshotUrl:C,scrollOffsetFromTop:z,isTocPanelOpen:I,...F}=e,R="self"===i,_=(0,x.O2)("toc"),M=(0,y.u)("screenshotsEnabled"),[E,T]=(0,a.useState)(null),[O,P]=(0,a.useState)(null),{styles:N,update:D,attributes:L}=(0,eb.E)(E,O,{placement:"right-start",strategy:"fixed"});(0,a.useEffect)(()=>{!R||!E||k||(0,j.Xb)()||_.scrollElementIntoView({element:E,offsetFromTop:z})},[_,R,k,E,z]);let W=(0,ev.cq)();(0,a.useEffect)(()=>{if(D&&W)return W.on("resize",()=>{D()})},[W,D]);let[U,G]=(0,a.useState)(!1),H=(0,a.useCallback)(()=>{D&&D(),G(!0)},[G,D]),V=(0,a.useCallback)(()=>G(!1),[G]),{colorMode:q}=(0,B.G6)();return(0,s.jsxs)(en.az,{ml:n?2:4,flex:1,position:"relative",borderRadius:"md",bg:"transparent",ref:(0,ep.S)(t,T),...F,children:[(0,s.jsx)(ex,{showDragHandles:!(0,j.Xb)()&&l,overlap:i,onSelectClick:r,title:d,hasChildren:u,isExpanded:c,setIsExpanded:m,showDropBorder:g,previewRef:h,editorMode:b,editor:v,docId:w,cardId:S,getPos:A,onMouseEnter:H,onMouseLeave:V,isHovering:U,isTocPanelOpen:I}),(0,s.jsx)(f.tL,{className:"ss-preview",src:M?C:ey.A.src,fallbackSrc:ey.A.src,shouldShow:!(0,j.Xb)()&&!!C&&U,ref:P,style:N.popper,...L.popper,ml:5,isDark:"dark"===q}),(0,s.jsx)(eg.S,{in:c,children:(0,s.jsx)(eh.N,{children:p})}),o]})})),eA=(e,t)=>{let l=(0,Q.xe)(e.state.doc,e=>{var l;return(0,eo.jg)(e)&&e.attrs.id===(null===(l=t.attrs)||void 0===l?void 0:l.id)});return l&&l[0]?e.state.doc.resolve(l[0].pos+1):null},eC=(0,a.memo)(e=>{let{position:t,size:l}=e;return(0,s.jsx)(en.az,{width:"100%",bg:"transparent",position:"absolute",zIndex:2,height:"".concat(l,"px"),..."top"===t?{top:"-".concat(l,"px")}:{bottom:"-".concat(l,"px")}})});eC.displayName="ExpandBox";let ez=e=>{let{isRoot:t,node:l,editorMode:n,content:o,editor:r,docId:d,selection:u,isSelectionOriginTOC:c,hasChildren:m,isFirst:f,isLast:p,children:g,onClose:b,scrollOffsetFromTop:y,isTocPanelOpen:v}=e,k=(0,L.st)(),w=(0,h.d4)(em.Jo),x=(0,h.wA)(),S=(0,ec.Iy)("edit",w),A=(0,h.d4)(em.RK)&&S,C=(0,a.useRef)(),[z,F]=(0,a.useState)(m&&t),[B,R]=(0,a.useState)("none"),_=l.attrs.id,{title:M}=(0,es.d)({node:l,cardId:_,editor:r}),E=eA(r,o),T=el({editorMode:n,resolved:E,selection:u,node:l}),O=!!E,P=(0,a.useCallback)(()=>{if(!O)return;null==k||k.track(L.VV.TOC_CARD_CLICKED,{mode:n,toc_pinned:v}),n===I.w.SLIDE_VIEW&&(0,ed.up)({tocClick:!0}),x((0,i.mF)({attached:!1}));let{cardId:e}=(0,ef.$9)();(0,j.Xb)()&&b&&setTimeout(b,300),(0,eu.o)({cardId:_,method:e===_?"replace":"push"})},[O,k,n,v,x,b,_]),[{isDragging:N},D,W]=(0,ei.i)({type:"card",canDrag:()=>!(0,j.Xb)()&&A,item:()=>({id:l.attrs.id,node:l}),collect:e=>({isDragging:e.isDragging()})},[A]),[{isOver:U,isOverCurrent:G,draggingItem:H},V]=(0,er.H)(()=>({accept:"card",canDrop:()=>!(0,j.Xb)()&&A,hover(e,t){var l;if(!C.current||e.id===_)return;let a=null===(l=C.current)||void 0===l?void 0:l.getBoundingClientRect(),n=(a.bottom-a.top)/2,o=z&&m?0:20,i=[n-o/2,n+o/2],r=t.getClientOffset().y-a.top;if(r>i[0]&&r<=i[1]){R("inside");return}if(r>i[1]){R("below");return}if(r(0,eo.jg)(e)&&e.attrs.id===_),a=(0,Q.xe)(r.state.doc,t=>(0,eo.jg)(t)&&t.attrs.id===e.id);l&&a&&(r.commands.rearrangeCards({from:a[0].pos,to:l[0].pos,position:B}),null==k||k.track(L.VV.TOC_CARD_DRAGGED,{mode:n,toc_pinned:v}),R("none"))},collect:e=>({isOver:e.isOver(),draggingItem:e.getItem(),isOverCurrent:e.isOver({shallow:!0})})}),[B,R,m,z,A,k,n,v]);(0,a.useEffect)(()=>{U||"none"===B||R("none")},[U,B]),D(V(C));let q=!1,K=!1,J=!1,$=!1;H&&f&&t&&(q=!0),(U&&m&&z||H&&p&&t)&&(K=!0),G&&("below"===B?$=!0:"above"===B&&(J=!0));let Y=(0,a.useMemo)(()=>{let e=[];return q&&e.push((0,s.jsx)(eC,{position:"top",size:10},"expand-top-20")),J&&e.push((0,s.jsx)(eC,{position:"top",size:4},"expand-top-4")),K&&e.push((0,s.jsx)(eC,{position:"bottom",size:10},"expand-bottom-20")),$&&e.push((0,s.jsx)(eC,{position:"bottom",size:4},"expand-bottom-4")),e},[K,$,q,J]),X=G&&"above"===B,Z=G&&"inside"===B,ee=G&&"below"===B,et="".concat(X?"toc-box__above":""," ").concat(ee?"toc-box__below":""),ea=(null==E?void 0:E.pos)?E.pos-1:null,ep=(0,a.useRef)(ea);(0,a.useEffect)(()=>{ep.current=ea},[ea]);let eg=(0,a.useCallback)(()=>ep.current,[ep]);return(0,s.jsxs)(en.az,{className:"toc-box ".concat(et),children:[X&&(0,s.jsx)(en.az,{height:"2px",mb:"2px",bgColor:"trueblue.100",ml:t?2:4}),(0,s.jsx)(eS,{userCanEdit:A,className:"toc-box--inner",overlap:H?"none":T,isRoot:t,onSelectClick:P,hasChildren:m,title:M,ref:C,previewRef:W,expandBox:Y,isExpanded:z,setIsExpanded:F,showDropBorder:Z,editorMode:n,cardId:_,editor:r,isSelectionOriginTOC:c,docId:d,getPos:eg,scrollOffsetFromTop:y,isTocPanelOpen:v,children:z&&g}),ee&&(0,s.jsx)(en.az,{height:"2px",mt:"2px",bgColor:"trueblue.100",ml:t?2:4})]})},eI=e=>{if(!e.content)return[];let t=e.content.filter(e=>"card"===e.type);if(t.length>0)return t;let l=[];return e.content.forEach(e=>{if("cardLayoutItem"===e.type&&e.content){let t=e.content.filter(e=>"card"===e.type);l=[...l,...t]}}),l},ej=(e,t)=>{let l=(0,Q.xe)(e,e=>{var l;return(0,eo.jg)(e)&&(null===(l=e.attrs)||void 0===l?void 0:l.id)===t});return l&&0!==l.length?l[0]:null},eF=e=>{let{isRoot:t,node:l,editorMode:a,editor:i,docId:r,cards:d,selection:u,isSelectionOriginTOC:c,onClose:m,scrollOffsetFromTop:f}=e,p=(0,o.GV)((0,n.El)(eT));return(0,s.jsx)(en.az,{flex:1,py:t?3:0,...t?{"data-testid":"toc-cards"}:{},children:d.map(function(e,n){let o=eI(e),{id:g}=e.attrs,h=ej(l,g);if(!h)return null;let{node:b}=h;return(0,s.jsx)(ez,{editorMode:a,isRoot:t,node:b,selection:u,isSelectionOriginTOC:c,editor:i,docId:r,content:e,hasChildren:o.length>0,isFirst:0===n,isLast:n===d.length-1,onClose:m,scrollOffsetFromTop:f,isTocPanelOpen:p,children:o&&(0,s.jsx)(eF,{editorMode:a,node:b,isRoot:!1,editor:i,docId:r,cards:o,selection:u,isSelectionOriginTOC:c,onClose:m,scrollOffsetFromTop:f})},g)})})},eB=e=>{let{handleClose:t,handleOpen:l,isOpen:n=!0,rootElement:o,hasRoomToOpen:u=!1,hasOpened:p=!0}=e,{editor:g,docId:b}=(0,r.m)(),y=(0,h.d4)(i.wC),{colorMode:v}=(0,B.G6)(),k=(0,L.st)(),{content:w,selection:x,isSelectionOriginTOC:S}=ea(g),A=null==w?void 0:w.content,C=A&&p,z=!n&&l&&u&&!(0,j.Xb)(),I=!!n&&!(0,j.Xb)(),F=(0,a.useCallback)(e=>{e.stopPropagation(),null==k||k.track(L.VV.TOC_PINNED_OPEN,{mode:y}),null==l||l()},[k,y,l]);return(0,s.jsxs)(d.s,{w:"100%",h:n?"100%":void 0,direction:"column",className:"highlight-mask","data-table-of-contents":!0,children:[(0,s.jsxs)(d.s,{p:2,pb:0,children:[C&&(0,s.jsx)(d.s,{p:3,position:"relative",children:(0,s.jsx)(D,{children:(0,s.jsx)(E.x6,{id:"SVyf2o"})})}),(0,s.jsx)(R.h,{}),z?(0,s.jsx)(f.Tz,{label:(0,s.jsx)(E.x6,{id:"MJf5IL"}),shortcut:"Mod+\\",children:(0,s.jsx)(q,{variant:"ghost","aria-label":T.Ru._({id:"MJf5IL"}),"data-testid":"expand-toc",icon:(0,s.jsx)(m.g,{icon:c.vQu}),onClick:F,onMouseDown:W.Fw})}):I?(0,s.jsx)(f.Tz,{label:(0,s.jsx)(E.x6,{id:"AugKWa"}),shortcut:"Mod+\\",children:(0,s.jsx)(q,{variant:"ghost","aria-label":T.Ru._({id:"AugKWa"}),icon:(0,s.jsx)(m.g,{icon:c.rMD}),onClick:e=>{e.stopPropagation(),t()},onMouseDown:W.Fw})}):null,(0,j.Xb)()&&(0,s.jsx)(_.J,{onClick:e=>{e.stopPropagation(),t()}})]}),(0,s.jsxs)(d.s,{className:"toc-root",mr:1,mb:1,pr:1,overflowY:"auto",flex:1,direction:"column",position:"relative",sx:{".toc-box > .toc-box--inner":{pb:"2px",pt:"4px"},".toc-box__below > .toc-box--inner":{pb:"0px"},".toc-box__below + .toc-box > .toc-box--inner":{pt:"2px"},".toc-box__above > .toc-box--inner":{pt:"0px"},"&::-webkit-scrollbar":{opacity:1,width:"5px"},"&::-webkit-scrollbar-track":{opacity:0,width:"5px"},"&::-webkit-scrollbar-thumb":{background:"dark"===v?"whiteAlpha.500":"blackAlpha.400",borderRadius:"full"}},children:[!C&&(0,s.jsx)(M.r,{p:6,skeletonHeight:"2rem",mt:3,w:"100%",noOfLines:8}),C&&o&&(0,s.jsx)(O.Q,{backend:P.t2,options:{rootElement:o},children:A&&g&&x&&A[0].content&&(0,s.jsx)(eF,{node:g.state.doc,editorMode:y,isRoot:!0,editor:g,docId:b,cards:A[0].content,selection:x,isSelectionOriginTOC:S,onClose:t,scrollOffsetFromTop:n?100:200})})]})]})},eR=(0,p.P)(d.s),e_={type:"spring",duration:.3,bounce:0},eM=".".concat("toc-root"),eE={open:{x:0},hidden:{x:-316}},eT=e=>{let{closePanel:t,openPanel:l,isDragging:n,isOpen:p,hasRoomToOpen:B}=e,R=(0,o.GV)(w.C),{editor:_}=(0,r.m)(),M=(0,x.O2)("toc"),E=(0,A.N)(_),[T,O]=(0,a.useState)(null),P=(0,o.GV)(i.wC)===I.w.SLIDE_VIEW,N=(0,h.d4)(i.SJ),D=(0,S.Mw)(N),L=(0,h.d4)(i.rv),W=(0,C.fS)(N,L),U=(0,z.mm)(N),G=(0,o.GV)((0,b.pn)(null==_?void 0:_.gammaDocId)),{isHovering:H,...V}=(0,F.ou)({disabled:p,enterDelay:30,leaveDelay:30});(0,a.useEffect)(()=>{M.setScrollSelector(eM)},[M]);let[q,K]=(0,a.useState)(!1),[J,$]=(0,a.useState)(!1);(0,a.useEffect)(()=>{$(e=>e||q||p)},[q,p]);let Q=!(0,y.u)("filmstrip")||(0,j.Xb)();(0,a.useEffect)(()=>v.WC.on("keydown","TABLE_OF_CONTENTS",e=>!!(0,g.Ay)("Mod+\\")(e)&&!!Q&&(p?t():l(),!0)),[p,l,t,Q]);let Y=p&&!G;return(0,s.jsxs)(k,{ref:(0,a.useCallback)(e=>O(e),[]),width:"100%",direction:"column",sx:{".toc-item .ss-preview":n?{display:"none"}:{}},tabIndex:-1,onKeyDown:E,justify:"center",...V,children:[Y&&(0,s.jsx)(d.s,{inset:"0",...(0,C.FD)(W,D),position:"absolute"}),Q&&(0,s.jsx)(d.s,{h:{base:24,xl:"70vh"},w:10,color:D?"gray.200":"gray.800",justify:"center",align:"flex-start",direction:"column",position:"absolute",p:2,className:"toc-hover-target","data-testid":"toc-hover-target",opacity:P||R?0:1,transitionProperty:"opacity",transitionDuration:"normal",children:(0,s.jsx)(eR,{borderRadius:"xl",sx:(0,z.wL)(U,N,(0,j.Xb)()),direction:"column",align:"center",justify:"center",variants:eE,"data-guider-highlight":"table-of-contents-opener",variant:G?"open":p||H?"hidden":"open",transition:e_,w:10,h:20,children:G?(0,s.jsx)(u.y,{size:"sm"}):(0,s.jsx)(m.g,{icon:c.o97})})}),Q&&(0,s.jsxs)(eR,{position:p?"relative":"absolute",w:p?void 0:"".concat(300,"px"),h:p?"100%":"fit-content",color:D?"gray.200":"gray.800",variants:eE,initial:"hidden",animate:G?"hidden":p||H?"open":"hidden",onAnimationComplete:e=>{K("open"===e)},transition:e_,pointerEvents:p||q?"auto":"none",maxH:p?void 0:"80vh",layout:"position",layoutDependency:!p,children:[!p&&(0,s.jsx)(d.s,{position:"absolute",inset:-4,right:-8}),(0,s.jsx)(d.s,{inset:p?-1:0,right:0,left:2,borderRadius:p?"none":"lg",sx:(0,z.wL)(U,N,(0,j.Xb)()),shadow:"xl",position:"absolute"}),(0,s.jsx)(f.L8,{isDark:D,children:(0,s.jsx)(eB,{hasOpened:J,handleClose:t,handleOpen:l,rootElement:T,isOpen:Y,hasRoomToOpen:B})})]})]})};eT.panelPosition="left",eT.panelName="table-of-contents",eT.canCollapse=!0;let eO={},eP=()=>{let e=void 0;return{...e?eO[e]:{},docSize:-1}}},63152:(e,t,l)=>{"use strict";l.d(t,{ki:()=>b,up:()=>h,XX:()=>v});var a=l(14041),n=l(14e3),o=l(8305),i=l(53053),r=l.n(i),s=l(73893);let d=new(r())({sampleRate:10,transmission:"base",batchSizeTrigger:50,batchTimeTrigger:2e3,maxConcurrentBatches:3,pendingWorkCapacity:1e4,maxResponseQueueSize:1e3,timeout:3e4,disabled:!s.$.HONEYCOMB_DATASET||!s.$.HONEYCOMB_API_KEY,writeKey:s.$.HONEYCOMB_API_KEY,dataset:s.$.HONEYCOMB_DATASET});d.add({userAgent:window.navigator.userAgent,version:s.$.GIT_SHA});let u=e=>{let{data:t}=e;if(!window.navigator.onLine)return;let l=d.newEvent();l.add(t),l.send()},c=e=>u({data:{...e,type:"performance",event:"slide-to-slide"}}),m=null,f=!1,p=!1,g=null,h=function(){let{tocClick:e,following:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{tocClick:!1,following:!1};m=performance.now(),f=!!e,p=!!t},b=e=>{let{cardId:t}=e;g=t},y=(e,t)=>{if(f)return"toc";if("presentCurrent"===e){if("presentNext"===t)return"next";if("presentPrev"===t)return"prev"}return"presentParent"===e&&"presentCurrent"===t?"child":"presentCurrent"===e&&"presentParent"===t?"parent":"unknown"},v=(e,t,l,i)=>{(0,a.useEffect)(()=>{e&&t===g&&requestAnimationFrame(function(){let e=(0,o.w)();if(e.editorMode!==n.w.SLIDE_VIEW||null===m)return;let t=performance.now()-m,a=y(l,i);c({...e,duration:t,isFollowing:p,presentVariant:l,prevPresentVariant:i,direction:a})})},[e,t,l,i])}},29719:(e,t,l)=>{"use strict";l.d(t,{$E:()=>o}),l(31085);var a=l(14041);let n=a.createContext({inPreviewContext:!1}),o=()=>(0,a.useContext)(n)},17303:(e,t,l)=>{"use strict";l.d(t,{C:()=>c,le:()=>m,og:()=>u,uw:()=>d});var a=l(8796),n=l(44507);let o={previewSize:null},i=(0,a.Z0)({name:"Preview",initialState:o,reducers:{reset:()=>o,setPreviewSize(e,t){let{previewSize:l}=t.payload;e.previewSize=l}}}),{setPreviewSize:r,reset:s}=i.actions,d=e=>"mobile"===e.Preview.previewSize||(0,n.Xb)(),u=e=>e.Preview.previewSize,c=e=>null!==e.Preview.previewSize,m=i.reducer},88957:(e,t,l)=>{"use strict";l.d(t,{KA:()=>tE,BT:()=>tM,jL:()=>tT,GV:()=>tO,CU:()=>tP});var a=l(8796);l(46343);var n=l(69011),o=l.n(n),i=l(32133),r=l(41054),s=l(74109),d=l(99548),u=l(14452);let c={currentInput:d.OK,contentTokenLength:0,inputs:[],isGeneratingOutline:!1,numOutlineBullets:d.rh,themeHistory:[]},m=(e,t)=>{e.currentInput=t,e.contentTokenLength=(0,s.WW)(t.content),""!==t.content&&(e.numOutlineBullets=j({AIGenerator:e}))},f=(0,a.Z0)({name:"AIGenerator",initialState:c,reducers:{reset:()=>c,patchGeneratorInput(e,t){let{settings:l,...a}=t.payload,n=l?{...e.currentInput.settings,...l}:e.currentInput.settings;e.currentInput={...e.currentInput,...a,settings:n},e.contentTokenLength=(0,s.WW)(e.currentInput.content);let o=e.inputs.findIndex(t=>t.id===e.currentInput.id);o>-1&&e.inputs.splice(o,1,{...e.currentInput})},prevVersion(e){let t=F({AIGenerator:e}),l=t.findIndex(e=>e.isCurrent);0!==l&&m(e,t[l-1].data)},nextVersion(e){let t=F({AIGenerator:e}),l=t.findIndex(e=>e.isCurrent);l!==t.length-1&&m(e,t[l+1].data)},loadVersionByNum:(e,t)=>{let l=F({AIGenerator:e}).find(e=>e.num===t.payload.num);l&&m(e,l.data)},loadDocGeneration:(e,t)=>{let{draftInput:l,docGenerateInputs:a}=t.payload;l?(m(e,l),e.inputs=[...a,l]):(m(e,a[a.length-1]),e.inputs=[...a]),e.generationType=t.payload.generationType},handleBackFromGeneratorPage:e=>{let t=e.currentInput.prompt;e.contentTokenLength=0,delete e.importedFile,e.currentInput={...c.currentInput},e.currentInput.prompt=t,e.inputs=[]},resetPrompt:e=>{e.currentInput.prompt=""},setImportedFile:(e,t)=>{e.importedFile=t.payload},setIsGeneratingOutline:(e,t)=>{e.isGeneratingOutline=t.payload},setNumOutlineBullets:(e,t)=>{e.numOutlineBullets=t.payload},setThemeHistory:(e,t)=>{e.themeHistory=[...t.payload].slice(0,d.oA)},incrementNumOutlineBullets:e=>{let t=e.numOutlineBullets>=d.BO&&e.numOutlineBullets%d.pn==0?d.pn:1;e.numOutlineBullets+=t},decrementNumOutlineBullets:e=>{let t=e.numOutlineBullets>=d.BO+d.pn&&e.numOutlineBullets%d.pn==0?d.pn:1;e.numOutlineBullets=Math.max(1,e.numOutlineBullets-t)}}}),{reset:p,setImportedFile:g,resetPrompt:h,loadDocGeneration:b,patchGeneratorInput:y,handleBackFromGeneratorPage:v,nextVersion:k,prevVersion:w,loadVersionByNum:x,setIsGeneratingOutline:S,setNumOutlineBullets:A,incrementNumOutlineBullets:C,decrementNumOutlineBullets:z,setThemeHistory:I}=f.actions,j=e=>{let{settings:{editorMode:t,numCards:l},content:a}=e.AIGenerator.currentInput;return"structured"===t?(0,u.rd)(a):null!=l?l:d.rh},F=e=>{let{inputs:t,currentInput:l}=e.AIGenerator;return t.map((e,t)=>({id:e.id,num:t+1,status:e.status,isDraft:"draft"===e.status,isCurrent:l.id===e.id,data:e}))};(0,r.Mz)(e=>F(e).map(e=>{let{data:t,...l}=e;return l}),e=>e.find(e=>e.isCurrent));let B=f.reducer;var R=l(57673);let _={status:"importing",interactionId:"",error:null,docGeneration:null,settings:null,slides:[],themeId:null},M=(0,a.Z0)({name:"ImportPPT",initialState:_,reducers:{resetImportState:()=>_,loadDocGeneration(e,t){let{docGeneration:l}=t.payload;if(!l.draftInput)throw Error("Cannot load DocGeneration for ImportPPT with no draftInput");let{filename:a,htmlUrl:n,fileUrl:o,numSlides:i,slidesUrl:r}=l.draftInput.settings;e.docGeneration=l,e.settings={filename:a,htmlUrl:n,fileUrl:o,numSlides:i,slidesUrl:r};let s=[],d=Math.min(i,50);for(let e=0;e{if(!e.slides[l]){console.error("[ImportPptSlice] updateSlideState: slide ".concat(l," does not exist"));return}e.slides[l].thumbnail=t,e.slides[l].status="generating"})},importPptUpdateDocGenerateInputSettings(e,t){var l;let{settings:a}=t.payload;if(!(null===(l=e.docGeneration)||void 0===l?void 0:l.draftInput)){console.error("[ImportPptSlice] importPptUpdateDocGenerateInputSettings: draftInput does not exist");return}e.docGeneration.draftInput.settings=a,e.settings=a},importSlideError(e,t){let{index:l,error:a}=t.payload;if(!e.slides[l]){console.error("[ImportPptSlice] updateSlideState: slide ".concat(l," does not exist"));return}Object.assign(e.slides[l],{status:"error",useOriginalImage:!0,error:a})},updateSlideState(e,t){let{index:l,...a}=t.payload;if(!e.slides[l]){console.error("[ImportPptSlice] updateSlideState: slide ".concat(l," does not exist"));return}Object.assign(e.slides[l],a)},importPptStreamError(e,t){e.slides.forEach(e=>{"done"!==e.status&&(e.status="error",e.useOriginalImage=!0)}),e.status="error",e.error=t.payload.error},importPptStreamDone(e){e.slides.forEach(e=>{"done"!==e.status&&(e.status="error",e.useOriginalImage=!0)}),e.status="done",e.error=null},setPptPreviewThemeId(e,t){e.themeId=t.payload.themeId},updateImportPptInteractionId(e,t){e.interactionId=t.payload.interactionId}}}),{resetImportState:E,updateImportPptInteractionId:T,updateSlideState:O,loadDocGeneration:P,onPptxParsed:N,setPptPreviewThemeId:D,importPptStreamDone:L,importPptStreamError:W,importSlideError:U,importPptUpdateDocGenerateInputSettings:G}=M.actions,H=M.reducer;(0,r.Mz)(e=>e.ImportPPT.slides,e=>e.ImportPPT.status,e=>e.ImportPPT.settings,e=>{var t,l;return null!==(l=null===(t=e.ImportPPT.settings)||void 0===t?void 0:t.numSlides)&&void 0!==l?l:0},e=>e.ImportPPT.slides.filter(e=>"done"===e.status).length,(e,t,l,a,n)=>{let o=e.every(e=>"done"===e.status),i=e.some(e=>"error"===e.status);return{status:"error"===t||"done"===t&&i?"error":o&&null!==l?"done":"importing",totalSlides:a,numImportedSlides:n}});var V=l(78784),q=l(45214),K=l(94445),J=l(22844),$=l(31757),Q=l(54925);let Y=(0,a.Z0)({name:"TemplatesInspiration",initialState:{templateCategories:[],inspirationCategories:[]},reducers:{setTemplateCategories:(e,t)=>{e.templateCategories=t.payload.templateCategories},setInspirationCategories:(e,t)=>{e.inspirationCategories=t.payload.inspirationCategories}}}),{setTemplateCategories:X,setInspirationCategories:Z}=Y.actions,ee=Y.reducer;var et=l(33264),el=l(61690);class ea{anchor(e){return this.validateCardId(e)&&(this.state.anchorId=e),this}select(e){return!this.validateCardId(e)||this.state.selectedCardIds.includes(e)||this.state.selectedCardIds.push(e),this}deselect(e){if(!this.validateCardId(e))return this;if(this.state.selectedCardIds.includes(e)){let t=this.state.selectedCardIds.indexOf(e);this.state.selectedCardIds.splice(t,1)}return this}clear(){return this.state.selectedCardIds=[],this}selectFromAnchor(e){if(!this.validateCardId(e)||!this.state.anchorId||!this.validateCardId(this.state.anchorId))return this;let t=this.state.allCardIds.indexOf(this.state.anchorId),l=this.state.allCardIds.indexOf(e),a=Math.min(t,l),n=Math.max(t,l);for(let e of this.state.allCardIds.slice(a,n+1))this.select(e);return this}validateCardId(e){return!!e&&this.state.allCardIds.includes(e)}constructor(e){this.state=e}}let en=e=>new ea(e),eo=e=>{let{direction:t,orderedIds:l,startingId:a,anchorId:n}=e;if(!a||!n)return!1;let o=l.indexOf(a),i=l.indexOf(n);return -1!==o&&-1!==i&&o!==i&&("up"===t?o>i:o{var l;if(0===e.length||0===t.length)return null;let a=new Set(t),n=e.filter(e=>a.has(e));return null!==(l=n[n.length-1])&&void 0!==l?l:null},er=(e,t)=>{var l;if(0===e.length||0===t.length)return null;let a=new Set(t);return null!==(l=e.filter(e=>a.has(e))[0])&&void 0!==l?l:null},es=(e,t,l)=>{let a=e.length;if(0===a||!t)return null;let n=e.indexOf(t);return -1===n?null:"up"===l?e[n-1]||e[0]:e[n+1]||e[a-1]},ed=e=>{let{anchorId:t,orderedIds:l,selectedIds:a}=e;if(!t)return null;let n=l.indexOf(t);if(-1===n)return null;let o=ei(l,a),i=o?l.indexOf(o):-1;return(i>n?o:er(l,a))||t},eu=(0,a.Z0)({name:"Filmstrip",initialState:{allCardIds:[],selectedCardIds:[],anchorId:null,lastSelection:{selectedCardIds:[],anchorId:null},isFilmstripOpen:!1,resizedFilmstripPreviewWidth:null},extraReducers:e=>{e.addCase(el.t0,(e,t)=>{let{payload:{cardIdMap:l}}=t;if(e.allCardIds=Object.keys(l.tree),e.lastSelection={selectedCardIds:e.selectedCardIds,anchorId:e.anchorId},e.selectedCardIds=e.selectedCardIds.filter(t=>e.allCardIds.includes(t)),e.anchorId&&!e.allCardIds.includes(e.anchorId)){for(let t of(e.anchorId=null,e.allCardIds))if(e.selectedCardIds.includes(t)){e.anchorId=t;break}}})},reducers:{resetSelection:e=>{0!==e.selectedCardIds.length&&(e.selectedCardIds=[]),null!==e.anchorId&&(e.anchorId=null)},filmstripItemClick:(e,t)=>{let{payload:{id:l}}=t;en(e).clear().select(l).anchor(l)},filmstripItemShiftClick:(e,t)=>{let{payload:{id:l,currentFocusedCard:a}}=t;if(e.selectedCardIds.includes(l)){en(e).deselect(l);return}e.anchorId||(e.anchorId=a),en(e).selectFromAnchor(l)},filmstripItemCmdClick:(e,t)=>{let{payload:{id:l}}=t;e.selectedCardIds.includes(l)?en(e).deselect(l):en(e).select(l)},filmstripContextMenuOpen:(e,t)=>{let{payload:{id:l}}=t;e.selectedCardIds.includes(l)||en(e).clear().select(l).anchor(l)},filmstripItemArrowKey:(e,t)=>{let{direction:l,withShift:a,currentFocusedCard:n}=t.payload,{allCardIds:o,anchorId:i,selectedCardIds:r}=e,s=null!=i?i:n;if(a){let e=ed({anchorId:i,orderedIds:o,selectedIds:r});s=null!=e?e:n}let d=es(o,s,l);d&&(a?eo({direction:l,orderedIds:o,startingId:s,anchorId:i})?s&&en(e).deselect(s):en(e).select(d):en(e).clear().anchor(d).select(d))},selectAddedFilmstripItems:(e,t)=>{let{beforeCardId:l,cardCount:a}=t.payload,n=e.allCardIds.indexOf(l);if(-1===n)return;let o=e.allCardIds[n+1];if(!o)return;en(e).clear().anchor(o);let i=e.allCardIds[n+a];i&&en(e).selectFromAnchor(i)},deleteFilmstripItems:e=>{let{allCardIds:t,selectedCardIds:l}=e,a=new Set(l),n=null;for(let e=t.length-1;e>=0;e--){let l=t[e];if(a.has(l)){if(e===t.length-1)for(let l=e-1;l>=0;l--){let e=t[l];if(!a.has(e)){n=e;break}}else n=t[e+1];break}}null===n?en(e).clear():en(e).clear().select(n)},onDragStartSetSelectedCards:(e,t)=>{let{selectedCardIdsToDrag:l}=t.payload;for(let t of(en(e).clear().anchor(l[0]),l))en(e).select(t)},selectAll:(e,t)=>{var l;let{allCardIds:a,anchorId:n}=e,{currentFocusedCard:o}=t.payload,i=null!==(l=null!=n?n:o)&&void 0!==l?l:a[0];for(let t of(en(e).clear().anchor(i),a))en(e).select(t)},restoreFromUndoOrRedo:(e,t)=>{let{selectedCardIds:l,anchorId:a}=t.payload;e.lastSelection={selectedCardIds:e.selectedCardIds,anchorId:e.anchorId},e.selectedCardIds=l,e.anchorId=a},setFilmstripIsOpen(e,t){e.isFilmstripOpen=t.payload.isOpen},setFilmstripPreviewWidth(e,t){e.resizedFilmstripPreviewWidth=t.payload.width}}}),{resetSelection:ec,filmstripItemClick:em,filmstripItemShiftClick:ef,filmstripItemCmdClick:ep,filmstripContextMenuOpen:eg,deleteFilmstripItems:eh,filmstripItemArrowKey:eb,onDragStartSetSelectedCards:ey,selectAll:ev,restoreFromUndoOrRedo:ek,selectAddedFilmstripItems:ew,setFilmstripIsOpen:ex,setFilmstripPreviewWidth:eS}=eu.actions,eA=eu.reducer;var eC=l(68973),ez=l(39698),eI=l(41881),ej=l(73524),eF=l(5720),eB=l(47538),eR=l(17303),e_=l(23013),eM=l(35147),eE=l(80304),eT=l(12327);l(82438);var eO=l(89654),eP=l(1771);l(28997);var eN=l(34185),eD=l(27569),eL=l(26813);let eW=()=>({fileStatus:"initial",inputFile:null,theme:(0,eN.N)(),thumbnails:[],themeSuggestions:null,themeLogoImgStatus:"idle",interactionId:(0,eO.$)(),uploadingFileId:null}),eU=(0,a.Z0)({name:"ThemeImporter",initialState:eW(),reducers:{resetThemeImporterState:e=>{Object.assign(e,eW())},startUploadingPpt(e,t){e.fileStatus="uploading",e.uploadingFileId=t.payload.fileId},finishUploadingPpt(e,t){e.inputFile=t.payload.inputFile,e.fileStatus="parsing"},finishParsingPpt(e,t){var l,a,n,o,i,r,s,d;e.fileStatus="review",e.uploadingFileId=null;let{themeSuggestions:u,thumbnails:c}=t.payload;e.thumbnails=c,e.themeSuggestions=t.payload.themeSuggestions;let m={...e.theme,name:eT.Ru._({id:"Pg208a",values:{0:null===(l=e.inputFile)||void 0===l?void 0:l.filename}}),headingFont:u.headingFont.suggested,headingFontWeight:u.headingFontWeight,bodyFont:u.bodyFont.suggested,bodyFontWeight:u.bodyFontWeight,config:{...null===(a=e.theme)||void 0===a?void 0:a.config,primaryColor:{color:(null===(n=u.accentColors)||void 0===n?void 0:n[0])||eP.Zs,type:"solid"},headingColor:{color:(null===(o=u.headingColors)||void 0===o?void 0:o[0])||eP.Hs,type:"solid"},bodyColor:{color:(null===(i=u.bodyColors)||void 0===i?void 0:i[0])||eP.nI,type:"solid"},cardColor:{color:(null===(r=u.cardColors)||void 0===r?void 0:r[0])||eP.iN,type:"solid"},disableReadabilityAdjustment:!1,background:{type:eL.h.COLOR,color:{name:null===(s=u.backgroundColors)||void 0===s?void 0:s[0],hex:null===(d=u.backgroundColors)||void 0===d?void 0:d[0]}},...u.logos.length>0?{logoImage:{src:u.logos[0].url,meta:{width:u.logos[0].width,height:u.logos[0].height}}}:{},...u.accentColors.length>1?{secondaryColors:u.accentColors.slice(1).map(e=>({color:e,type:"solid"}))}:{}},fonts:(0,eD.Hs)({fontsMap:t.payload.fontsMap,headingFontId:u.headingFont.suggested,bodyFontId:u.bodyFont.suggested})};e.theme=m},updateThemeName(e,t){e.theme.name=t.payload.name},updateCardColor(e,t){e.theme.config.cardColor=t.payload.color},updateDocBackgroundColor(e,t){e.theme.config.background={type:eL.h.COLOR,color:{hex:(0,eP.Ik)(t.payload.color)}}},updatePrimaryColor(e,t){e.theme.config.primaryColor=t.payload.color},updateHeadingFont(e,t){let{font:l,fontsMap:a}=t.payload;e.theme.headingFont=l,e.theme.fonts=(0,eD.Hs)({fontsMap:a,headingFontId:l,bodyFontId:e.theme.bodyFont})},updateBodyFont(e,t){let{fontsMap:l,font:a}=t.payload;e.theme.bodyFont=a,e.theme.fonts=(0,eD.Hs)({fontsMap:l,bodyFontId:a,headingFontId:e.theme.headingFont})},updateHeadingFontWeight(e,t){e.theme.headingFontWeight=t.payload.weight},updateBodyFontWeight(e,t){e.theme.bodyFontWeight=t.payload.weight},updateBodyColor(e,t){e.theme.config.bodyColor=t.payload.color},updateHeadingColor(e,t){e.theme.config.headingColor=t.payload.color},handleLogoImageUploadStart(e){e.themeLogoImgStatus="loading"},handleLogoImageUploadSuccess(e,t){var l;e.theme&&(e.themeLogoImgStatus="idle",e.theme.logoUrl=(null===(l=t.payload.logoImage)||void 0===l?void 0:l.src)||void 0,e.theme.config.logoImage=t.payload.logoImage)},handleSelectLogoSuggestion(e,t){e.theme&&(e.theme.logoUrl=t.payload.logo.url,e.theme.config.logoImage={src:t.payload.logo.url,meta:{width:t.payload.logo.width,height:t.payload.logo.height}})},handleLogoImageUploadError(e){e.themeLogoImgStatus="error"},handleRemoveLogoImage(e){e.theme&&(e.theme.logoUrl=void 0,e.theme.config.logoImage=void 0)}}}),{resetThemeImporterState:eG,finishUploadingPpt:eH,startUploadingPpt:eV,finishParsingPpt:eq,updateThemeName:eK,updateCardColor:eJ,updateDocBackgroundColor:e$,updatePrimaryColor:eQ,updateHeadingFont:eY,updateBodyFont:eX,updateHeadingFontWeight:eZ,updateBodyFontWeight:e0,updateBodyColor:e1,updateHeadingColor:e2,handleLogoImageUploadStart:e6,handleLogoImageUploadSuccess:e4,handleLogoImageUploadError:e5,handleRemoveLogoImage:e3,handleSelectLogoSuggestion:e8}=eU.actions,e7=eU.reducer;var e9=l(95709),te=l(85452),tt=l(94984),tl=l(12253),ta=l(27042),tn=l(33639);let to={interactions:{}},ti=(0,a.Z0)({name:"DesignPartnerAnalytics",initialState:to,reducers:{reset:()=>to,startDesignPartnerInteraction(e,t){let l=t.payload.provider,{editorContext:a,...n}=t.payload.taskContext;if(e.interactions[n.interactionId]){console.warn("[DesignPartnerAnalytics] Interaction already exists",n.interactionId);return}e.interactions[n.interactionId]={...n,provider:l,cardId:a.card.cardId}},storeClassification(e,t){let{taskContext:l,classification:a}=t.payload,n=e.interactions[l.interactionId];if(!n){console.warn("[DesignPartnerAnalytics.trackClassification] No interaction exists",l.interactionId);return}n.classification=a},storeInputContent(e,t){let{taskContext:l,inputContent:a}=t.payload,n=e.interactions[l.interactionId];if(!n){console.warn("[DesignPartnerAnalytics.trackInputContent] No interaction exists",l.interactionId);return}n.inputContent=a},storeResponseMessage(e,t){let{taskContext:l,outputContent:a,outputMessage:n}=t.payload,o=e.interactions[l.interactionId];if(!o){console.warn("[DesignPartnerAnalytics.trackResponseMessage] No interaction exists",l.interactionId);return}o.outputMessage=n,o.outputContent=a}}}),{startDesignPartnerInteraction:tr,storeClassification:ts,storeInputContent:td,storeResponseMessage:tu}=ti.actions,tc=ti.reducer;var tm=l(99742);let tf={status:"idle",messages:[],queuedTasks:[]},tp=(0,a.Z0)({name:"DesignPartner",initialState:tf,reducers:{reset:()=>tf,setStatus(e,t){e.status=t.payload},addMessage(e,t){let{message:l}=t.payload,a=[...e.messages,l];e.messages=a},enqueueTask(e,t){let{task:l}=t.payload,a=[...e.queuedTasks,{task:l,id:(0,tm.Ak)()}];e.queuedTasks=a},removeQueuedTask(e,t){let{id:l}=t.payload,a=e.queuedTasks.filter(e=>e.id!==l);e.queuedTasks=a}}}),{addMessage:tg,enqueueTask:th,removeQueuedTask:tb,reset:ty,setStatus:tv}=tp.actions,tk=tp.reducer,tw={isDragging:!1,allCardIdsWhileDragging:[],selectedCardIdsWhileDragging:[],leaderCardId:null,dragStartIndices:{}},tx=(0,a.Z0)({name:"FilmstripDragAndDrop",initialState:tw,reducers:{startDragging:(e,t)=>{let{cardIds:l,selectedCardIds:a,leaderCardId:n}=t.payload;e.isDragging=!0,e.allCardIdsWhileDragging=l,e.leaderCardId=n,e.dragStartIndices=l.reduce((e,t,l)=>(e[t]=l+1,e),{});let o=l.filter(e=>a.includes(e));e.selectedCardIdsWhileDragging=o},onReorder:(e,t)=>{let{reorderedCardIds:l}=t.payload,{leaderCardId:a,selectedCardIdsWhileDragging:n,allCardIdsWhileDragging:o}=e,i=e=>e===a,r=o.findIndex(i),s=l.findIndex(i);if(-1===s||-1===r){console.error("[dragAndDropReducer] could not find leader card");return}let d=Math.max(o.findIndex(e=>e===n[0])+(s-r),0),u=l.filter(e=>!n.includes(e));e.allCardIdsWhileDragging=[...u.slice(0,d),...n,...u.slice(d)]},onDropReset:()=>tw}}),{startDragging:tS,onDropReset:tA,onReorder:tC}=tx.actions,tz=tx.reducer;var tI=l(24537);let tj=(0,a.Z0)({name:"Home",initialState:{isHomeSidebarVisible:!1},reducers:{setIsHomeSidebarVisible:(e,t)=>{e.isHomeSidebarVisible=t.payload.isSidebarVisible}}}),{setIsHomeSidebarVisible:tF}=tj.actions,tB=tj.reducer,tR={AIGenerator:B,AIStream:V.Fs,AIVariations:q.lN,Cards:J.EB,CardNotes:K.Ff,Credits:Q.l7,DesignPartner:tk,ImageEditor:tl.Ff,I18n:eC.D6,TipTap:el.Ff,Panels:eB.ld,CardMenus:te.VJ,SearchModal:e_.Ff,Intercom:ez.Ff,Zendesk:tn.Ff,ModalState:ej.Ff,DesignPartnerAnalytics:tc,Filmstrip:eA,FilmstripDragAndDrop:tz,FeatureFlags:et.Ff,User:ta.Kz,Site:eM._J,Preview:eR.le,ThemePicker:R.OM,Home:tB,EditBackgroundDrawer:tt.ol,MediaDrawer:e9.gA,EditMediaRecord:eI.Gn,ImportPPT:H,Connection:$.VZ,ThemeImporter:e7,ThemeEditing:eE.cS,OfflineManager:eF.Dj,TemplatesInspiration:ee},t_={DocEditor:tI.Ff,...tR},tM=()=>{let e=tE().dispatch;e((0,J.cL)()),e((0,tI.cL)()),e((0,el.cL)())},tE=o()(()=>(0,a.U1)({reducer:t_,middleware:e=>e({serializableCheck:!1})})),tT=()=>(0,i.wA)(),tO=i.d4,tP=()=>(0,i.Pj)()},65084:(e,t,l)=>{"use strict";let a;l.d(t,{H1:()=>c,cH:()=>f,O2:()=>m});var n=l(4013),o=l(44507),i=l(98371);let r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:10,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20;return async l=>{if(l())return Promise.resolve(!0);let a=0;return new Promise((n,o)=>{!function i(){if(l()){n(!0);return}if(a>e){o(!1);return}a++,setTimeout(i,t)}()})}},s=window.Cypress?10:400,d=new n.c;l.e(9484).then(l.t.bind(l,9484,23)).then(e=>{a=e.default,d.resolve(a)});let u=new Map,c=e=>(u.get(e)||u.set(e,new p(e)),u.get(e)),m=e=>c(e),f=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!e||!e.offsetWidth&&!e.offsetHeight)return;let l=e.getBoundingClientRect(),a=(0,i.mJ)(),n=l.top>=-5&&l.top<=a,o=l.bottom>=-5&&l.bottom-5<=a,r=l.top<=0&&l.bottom>=a,s=n&&o||r?{px:l.height,portion:"full"}:o?{px:l.bottom,portion:"abovePartial"}:n?{px:a-l.top,portion:"belowPartial"}:l.bottom<0?{px:l.bottom,portion:"above"}:{px:a-l.top,portion:"below"},d=s.px>=Math.min(t,l.height),u=l.left>=0&&l.right<=(window.innerWidth||document.documentElement.clientWidth);return{...s,rect:l,bottomInView:o,topInView:n,yAxisInView:d,xAxisInView:u,inView:d&&u}};class p{getSweetScroll(){return new a({before:()=>{this.inProgress=!0},complete:()=>{this.inProgress=!1}},this.scroller||document.body)}async setScrollSelector(e){this.scrollSelector=e,a||await d.promise,this.sweetScroll=this.getSweetScroll()}get scroller(){return document.querySelector(this.scrollSelector)}get scrollerForEvents(){return"body"===this.scrollSelector?window:this.scroller}get scrollerForMeasurement(){return"body"===this.scrollSelector?document.documentElement:this.scroller}isAtTop(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.scrollerForMeasurement.scrollTop<=e}isAtBottom(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=this.scrollerForMeasurement;return!!t&&t.scrollHeight-t.scrollTop-t.offsetHeight{let n=()=>{this.scroller&&("smooth"===l&&this.sweetScroll?this.sweetScroll.toTop(t,{duration:s}):"body"===this.scrollSelector?window.scroll({top:t}):this.scroller.scroll({top:t}))};a?n():setTimeout(n),setTimeout(e)})}async scrollToBottom(e){var t,l;let{behavior:a=(0,o.Xb)()?"auto":"smooth",sync:n=!1}=e;return this.scrollTo({top:null!==(l=null===(t=this.scrollerForMeasurement)||void 0===t?void 0:t.scrollHeight)&&void 0!==l?l:0,behavior:a,sync:n})}constructor(e){this.inProgress=!1,this.scrollSelector="body",this.sweetScroll=void 0,this.scrollElementIntoView=async e=>{let{element:t,delay:l=0,attempts:a=3,offsetFromTop:n=100}=e;if(!t)return!1;let o=async e=>{let l=t.closest(this.scrollSelector);if(!l)return;let a=(0,i.sR)(t,this.scrollSelector);if(e=e||f(t),null!==n||!e)return this.scrollTo({top:a-(null!=n?n:100)});let o=Math.min(250,.2*(0,i.mJ)()),r="full"===e.portion&&e.rect.top(0,i.mJ)()-o;if(r||"abovePartial"===e.portion||"above"===e.portion)return console.debug("[scrollElementIntoView] Nudge DOWN from above - nudge:",o),this.scrollTo({top:a-o});if(s||"belowPartial"===e.portion||"below"===e.portion){let n=t.getBoundingClientRect().height-e.px,i=l.scrollTop+n+o;return console.debug("[scrollElementIntoView] Nudge UP from below - nudge:",o),this.scrollTo({top:Math.min(i,a-o)})}},s=()=>!!f(t),d=f(t);if(d)return console.debug("[scrollElementIntoView] Element already in view. Scrolling to center it.",t),o(d),!0;l&&await new Promise(e=>setTimeout(e,l));let u=+new Date,c=()=>{let e=o()||Promise.resolve();return r(32,25)(s).then(()=>!0,()=>e.then(()=>!1))},m=a,p=!1;for(;m>0;)if(m--,p=await c()){let e=+new Date-u;console.debug("[scrollElementIntoView] Element in view after ".concat(a-m," attempts - ").concat(e,"ms"));break}if(!p){let e=+new Date-u;console.debug("[scrollElementIntoView] Element did not appear after ".concat(a," attempts - ").concat(e,"ms"),t)}return p},this.type=e,d.then(()=>{this.sweetScroll=this.getSweetScroll()})}}},23013:(e,t,l)=>{"use strict";l.d(t,{Ff:()=>d,MQ:()=>r,q8:()=>i,xo:()=>s});var a=l(8796);let n={isOpen:!1,initialQuery:""},o=(0,a.Z0)({name:"SearchModal",initialState:n,reducers:{reset:()=>n,setIsGlobalSearchOpen(e,t){let{isOpen:l,initialQuery:a}=t.payload;e.isOpen=l,e.initialQuery=a||""}}}),{setIsGlobalSearchOpen:i}=o.actions,r=e=>e.SearchModal.isOpen,s=e=>e.SearchModal.initialQuery,d=o.reducer},7441:(e,t,l)=>{"use strict";l.d(t,{z:()=>g});var a=l(84507),n=l(73893),o=l(57999),i=l(8305),r=l(69087),s=l(4013),d=l(44507),u=l(30503);let c=e=>e.replace(/[A-Z]/g,e=>"_".concat(e.toLowerCase())),m=()=>!(0,d.rA)()&&!(0,u.NF)(),f=(0,r.g)();class p{setEnabled(e){this.enabled=e}init(){this.initialized||(o.l.on("online",()=>{this.enabled=!0}),o.l.on("offline",()=>{this.enabled=!1}),a.N.load({writeKey:"",cdnSettings:{integrations:{"Segment.io":{apiHost:n.$.EVENT_TRACKING_ENDPOINT}}}}).then(e=>{let[t]=e;return this.sdk=t,t},e=>{console.error("Segment load error:",e)}).then(()=>{this.initialized=!0,this.processQueue(),this.loadSdkPromise.resolve(this.sdk)}))}trackDocEvent(e,t){if(!this.initialized){console.error("Cannot track doc event before initialization");return}let l=(0,i.w)(),a={};for(let[e,t]of Object.entries(l))a[c(e)]=t;this.track(e,{...a,...t})}track(e,t,l,a){var n;if(!1!==this.enabled){if(!this.initialized){this.initialQueue.push({method:"track",args:[e,t,l,a]});return}return null===(n=this.sdk)||void 0===n?void 0:n.track(e,t,l,a)}}identify(e,t){var l;let a={context:f.get()};if(!1!==this.enabled){if(!this.initialized){this.initialQueue.push({method:"identify",args:[e,t,a]});return}null===(l=this.sdk)||void 0===l||l.identify(e,t,a)}}page(e,t,l){var a;if(!1!==this.enabled){if(!this.initialized){this.initialQueue.push({method:"page",args:[e,t,l]});return}null===(a=this.sdk)||void 0===a||a.page(e,t,l)}}setAnonymousId(e){var t;if(!1!==this.enabled){if(!this.initialized){this.initialQueue.push({method:"setAnonymousId",args:[e]});return}null===(t=this.sdk)||void 0===t||t.setAnonymousId(e)}}processQueue(){for(;this.initialQueue.length>0;){let e=this.initialQueue.shift();this.enabled&&this[e.method].apply(this,e.args)}}constructor(){this.loadSdkPromise=new s.c,this.initialized=!1,this.sdk=null,this.initialQueue=[],this.enabled=m()}}let g=new p},50923:(e,t,l)=>{"use strict";l.d(t,{JQ:()=>r,st:()=>i}),l(31085);var a=l(14041);l(56233),l(60490);var n=l(62849);l(7441);let o=(0,a.createContext)(void 0),i=()=>(0,a.useContext)(o),r=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],l=i();(0,n.Vg)(()=>{l&&e(l)},[l,e,...t],[l,...t])}},10458:(e,t,l)=>{"use strict";l.d(t,{JQ:()=>n.JQ,VV:()=>a.VV,ng:()=>a.ng,oU:()=>a.oU,st:()=>n.st,zS:()=>o.z});var a=l(55090),n=l(50923),o=l(7441)},55090:(e,t,l)=>{"use strict";l.d(t,{VV:()=>n,ng:()=>a,oU:()=>o});var a=function(e){return e.DATA_SYNC_ERROR="dataSyncError",e.DATA_SYNC_RECOVER="dataSyncRecover",e.EDITOR_SLOW_LOAD="editorSlowLoad",e.DUPLICATE_CARD_IDS="duplicateCardIds",e.EDITOR_CORE_ERROR="editorCoreError",e.NO_CURRENT_SNAPSHOT="noCurrentSnapshot",e.NOT_TRUSTED_EVENTS_DETECTED="unknownError001",e}({}),n=function(e){return e.ABUSE_LINK_INTERCEPT_SHOWN="abuse.linkIntercept.shown",e.ABUSE_LINK_INTERCEPT_CONTINUE="abuse.linkIntercept.continue",e.ABUSE_LINK_INTERCEPT_CANCEL="abuse.linkIntercept.cancel",e.AI_REQUEST_SENT="ai.request.sent",e.AI_REQUEST_ERROR="ai.request.error",e.AI_REQUEST_RETRY="ai.request.retry",e.AI_REQUEST_COMPLETE="ai.request.complete",e.AI_REQUEST_RESPONSE="ai.request.response",e.AI_REQUEST_ABORT="ai.request.abort",e.AI_REQUEST_STREAM_START="ai.request.streamStart",e.AI_SUGGESTION_APPLY="ai.suggestion.apply",e.AI_SUGGESTION_FEEDBACK="ai.suggestion.feedback.submit",e.AI_CARD_VARIATION_KEPT="ai.card.variation.kept",e.AI_CARD_TRANSLATION_KEPT="ai.card.translation.kept",e.AI_CARD_FEEDBACK="ai.card.feedback",e.AI_CARD_RATING="ai.card.rating",e.AI_CREDITS_DEDUCTED="ai.credits.deduct",e.AI_CREDITS_USED="ai.credits.use",e.CARD_VIEWED="card.view",e.CARD_CREATED="card.create",e.CARD_STYLES_UPDATED="card.styles.update",e.CARD_STYLES_RESET="card.styles.reset",e.DOC_ATTRIBUTES_UPDATED="doc.attrs.update",e.CARD_COLLAPSED="card.collapse",e.CARD_EXPANDED="card.expand",e.CARD_EXPORTED="card.export",e.CARD_LAYOUT_UPDATED="card.layout.update",e.CARDS_REORDERED="cards.reordered",e.COLOR_PICKER_OPENED="colorPicker.open",e.COLOR_PICKER_SET_COLOR="colorPicker.setColor",e.COLOR_PICKER_RESET="colorPicker.reset",e.DOC_VIEWED="doc.view",e.DOC_CREATED="doc.create",e.DOC_PRINTED="doc.print",e.DOC_COLLABORATOR_INVITED="doc.collaborator.invited",e.DOC_ZOOMED="doc.zoom",e.DOC_THEME_UPDATED="doc.theme.update",e.DOC_SHARELINK_COPIED="doc.shareLink.copied",e.DOC_IMPORTED="doc.imported",e.DOC_IMPORT_FAILED="doc.import.failed",e.EXAMPLE_VIEWED="example.view",e.EXAMPLE_DUPLICATED="example.duplicate",e.MADE_WITH_GAMMA_CLICKED="madeWithGamma.click",e.EXAMPLE_SIGNUP_CLICKED="example.signup.click",e.HOME_TAB_VIEWED="homeTab.view",e.NODE_INSERTED="node.insert",e.PRESENT_MODE_NAVIGATED="present.navigate",e.PRESENT_MODE_ENTERED="present.enter",e.PRESENT_MODE_EXITED="present.exit",e.PROMPT_VERSION_PICKER="prompt.versionPicker",e.LOGIN="auth.login",e.SIGNUP="auth.signup",e.CHECKOUT_STARTED="monetization.products.pro.click",e.PURCHASE_COMPLETE="monetization.products.pro.purchase",e.CANCEL_SUBSCRIPTION_CLICK="monetization.cancelSubscription.click",e.CHURNKEY_FAILED_PAYMENT_WALL_SHOWN="monetization.churnkey.failedPaymentWall.shown",e.CHURNKEY_FAILED_PAYMENT_WALL_CLOSED="monetization.churnkey.failedPaymentWall.closed",e.CHURNKEY_CANCEL_SUBSCRIPTION_COMPLETE="monetization.churnkey.cancelSubscription.complete",e.CHURNKEY_HANDLE_SUPPORT_CLICK="monetization.churnkey.handleSupport.click",e.CHURNKEY_PAYMENT_METHOD_UPDATED="monetization.churnkey.paymentMethod.updated",e.GAMMA_PRO_BILLING_CYCLE_CLICK="monetization.products.pro.billingCycle.click",e.GAMMA_PRO_UPSELL_PRODUCTS_VIEWED="monetization.products.view",e.GAMMA_PRO_UPSELL_CALLOUT_AI_CREDITS="monetization.products.pro.upsell.aiCredits",e.GAMMA_UPSELL_CALLOUT_AI_CREDITS_CHAT="monetization.products.pro.upsell.aiCredits.chat",e.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GENERATE_CARD="monetization.products.pro.upsell.aiCredits.generateCard",e.GAMMA_UPSELL_CALLOUT_AI_CREDITS_TRANSLATE_CARD="monetization.products.pro.upsell.aiCredits.translateCard",e.GAMMA_UPSELL_CALLOUT_AI_CREDITS_IMAGES="monetization.products.pro.upsell.aiCredits.images",e.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GUIDED="monetization.products.pro.upsell.aiCredits.guided",e.GAMMA_UPSELL_CALLOUT_AI_CREDITS_ADVANCED="monetization.products.pro.upsell.aiCredits.advancedMode",e.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GENERATE_V2="monetization.products.pro.upsell.aiCredits.generatev2",e.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GENERATE_CARD_NOTES="monetization.products.pro.upsell.aiCredits.generateCardNotes",e.GAMMA_UPSELL_CALLOUT_AI_CREDITS_PPT_IMPORT_V2="monetization.products.pro.upsell.aiCredits.pptImportV2",e.GAMMA_UPSELL_CALLOUT_AI_CREDITS_DASHBOARD_CREDITS_COUNT="monetization.products.pro.upsell.aiCredits.dashboardCreditsCount",e.GAMMA_UPSELL_CALLOUT_AI_GENERATE_LONGER="monetization.products.pro.upsell.aiGenerateLonger",e.GAMMA_UPSELL_CALLOUT_AI_GENERATE_MORE_TOKENS="monetization.products.pro.upsell.aiGenerateMoreTokens",e.GAMMA_UPSELL_CALLOUT_AI_IMAGE_MODELS="monetization.products.pro.upsell.aiImageModels",e.GAMMA_PRO_UPSELL_CALLOUT_WORKSPACE_SETTINGS="monetization.products.pro.upsell.workspaceSettings",e.GAMMA_PRO_UPSELL_CALLOUT_AI_MODEL_ADVANCED_MODE="monetization.products.pro.upsell.aiModelAdvancedMode",e.GAMMA_PRO_UPSELL_EXPORT_SETTINGS_REMOVE_WATERMARK="monetization.products.pro.upsell.exportSettingsRemoveWatermark",e.GAMMA_PRO_UPSELL_SITE_REMOVE_WATERMARK="monetization.products.pro.upsell.siteRemoveWatermark",e.GAMMA_PRO_UPSELL_SITE_ADD_CUSTOM_DOMAIN="monetization.products.pro.upsell.siteAddCustomDomain",e.GAMMA_PRO_UPSELL_PAGE_SETUP_REMOVE_WATERMARK="monetization.products.pro.upsell.pageSetupRemoveWatermark",e.GAMMA_PRO_UPSELL_SHARE_SETTINGS_REMOVE_WATERMARK="monetization.products.pro.upsell.shareSettingsRemoveWatermark",e.GAMMA_PRO_UPSELL_CALLOUT_CHANGE_HISTORY="monetization.products.pro.upsell.changeHistory",e.GAMMA_PRO_UPSELL_CALLOUT_SIDEBAR="monetization.products.pro.upsell.sidebar",e.GAMMA_PRO_UPSELL_CALLOUT_CUSTOM_FONTS="monetization.products.pro.upsell.customFonts",e.GAMMA_PRO_UPSELL_CALLOUT_EDIT_DOC_AI="monetization.products.pro.upsell.editDocAI",e.GAMMA_PRO_UPSELL_SUBSCRIPTION_EXPIRED_BUTTERBAR="monetization.products.pro.upsell.subscriptionExpiredButterbar",e.GAMMA_PRO_UPSELL_SUBSCRIPTION_INDIVIDUAL_ANALYTICS="monetization.products.pro.upsell.individualAnalytics",e.GAMMA_PRO_UPSELL_DOMAINS="monetization.products.pro.upsell.domains",e.GAMMA_PRO_UPSELL_REMOVE_BACKGROUND="monetization.products.pro.upsell.removeBackground",e.GAMMA_PRO_UPSELL_WORKSPACE_SETTINGS="monetization.products.pro.upsell.workspaceSettings",e.DOC_ANALYTICS_VIEWED="docAnalytics.view",e.THEME_CREATED="theme.create",e.THEME_DUPLICATED="theme.duplicate",e.THEME_UPDATED="theme.update",e.THEME_IMPORTED="theme.import",e.THEME_IMPORT_FAILED="theme.import.failed",e.THEME_RATED="theme.rated",e.THEME_FEEDBACK="theme.feedback",e.IN_APP_TEMPLATE_THEME_CLICKED="inAppTemplate.theme.click",e.IN_APP_TEMPLATE_CREATE_THEME_CLICKED="inAppTemplate.createTheme.click",e.PDF_EXPORTED="pdf.export",e.PNG_EXPORTED="png.export",e.PPTX_EXPORTED="pptx.export",e.GSLIDES_EXPORTED="gslides.export",e.LINKEDIN_POST="linkedin.post",e.TEMPLATE_SEARCH="template.search",e.DOC_EDITOR_TOUR_STARTED="docEditorTour.start",e.DOC_EDITOR_TOUR_CLOSE_CLICKED="docEditorTour.close.click",e.DOC_EDITOR_TOUR_COMPLETED="docEditorTour.completed",e.CREATE_FIRST_DOC_EXP_BUCKETED="createFirstDocExp.bucket",e.AI_DOC_RATED="ai.doc.rated",e.AI_DOC_FEEDBACK_SUBMITTED="ai.doc.feedback.submitted",e.AI_DOC_SHOWCASE_ALLOWED="ai.doc.showcase.allowed",e.AI_IMAGE_RATED="ai.image.rated",e.AI_IMAGE_FEEDBACK_SUBMITTED="ai.image.feedback.submitted",e.AI_IMPORT_SLIDE_RATED="ai.import-slide.rated",e.AI_IMPORT_SLIDE_FEEDBACK="ai.import-slide.feedback",e.AI_DOC_CREATION_GENERATION_TYPE_CLICKED="ai.doc.creation.generationType.clicked",e.AI_DOC_CREATION_OUTLINE_GENERATED="ai.doc.creation.outline.generated",e.AI_DOC_CREATION_OUTLINE_APPROVED="ai.doc.creation.outline.approved",e.AI_DOC_CREATION_THEME_CLICKED="ai.doc.creation.theme.clicked",e.TOC_PINNED_OPEN="toc.pinOpen",e.TOC_CARD_CLICKED="toc.card.click",e.TOC_CARD_DRAGGED="toc.card.drag",e.TOC_CARD_MENU_OPENED="toc.card.menu.open",e.FILMSTRIP_TOGGLE_VIEW="filmstrip.toggle.view",e.DOC_COPIED_TO_SITE="site.doc.copiedToSite",e.DOC_MOVED_TO_SITE="site.doc.movedToSite",e.SITE_DOMAIN_PURCHASED="site.domain.purchased",e.SITE_DOMAIN_ADDED="site.domain.added",e.EXPERIMENT_BUCKETED="experiment.bucketed",e.EXPERIMENT_BUCKETED_OPTIMIZELY_EDGE="experiment.bucketed.optly.edge",e.SKIPPED_THEME_RANDOM_THEME_PICKED="experiment.skipTheme.randomTheme.picked",e.USER_INFO_JOB_FUNCTION_SUBMITTED="userInfo.jobFunction.submitted",e.USER_INFO_GOALS_SUBMITTED="userInfo.goals.submitted",e.USER_INFO_REFERRER_SUBMITTED="userInfo.referrer.submitted",e.USER_INFO_EMAIL_OPTIN_SUBMITTED="userInfo.emailOptIn.submitted",e.ONBOARDING_WELCOME_TOUR_STARTED="onboarding.welcomeTour.started",e.ONBOARDING_WELCOME_TOUR_STEP_VIEWED="onboarding.welcomeTour.step.viewed",e.ONBOARDING_WELCOME_TOUR_STEP_COMPLETED="onboarding.welcomeTour.step.completed",e.ONBOARDING_WELCOME_TOUR_COMPLETED="onboarding.welcomeTour.completed",e.ONBOARDING_CHECKLIST_WIDGET_OPENED="onboarding.checklistWidget.opened",e.ONBOARDING_CHECKLIST_WIDGET_ITEM_VIEWED="onboarding.checklistWidget.item.viewed",e.ONBOARDING_CHECKLIST_WIDGET_ITEM_COMPLETED="onboarding.checklistWidget.item.completed",e.ONBOARDING_CHECKLIST_WIDGET_ITEM_LEARN_MORE_CLICKED="onboarding.checklistWidget.item.learnMore.clicked",e.ONBOARDING_CHECKLIST_WIDGET_COMPLETED="onboarding.checklistWidget.completed",e.ONBOARDING_CHECKLIST_WIDGET_CLOSED="onboarding.checklistWidget.closed",e.ONBOARDING_CHECKLIST_WIDGET_COMPLETION_MODAL_VIEWED="onboarding.checklistWidget.completionModal.viewed",e.ONBOARDING_CHECKLIST_WIDGET_COMPLETION_MODAL_CTA_CLICKED="onboarding.checklistWidget.completionModal.cta.clicked",e.ONBOARDING_CHECKLIST_WIDGET_CHECKLIST_MANUAL_OPENED="onboarding.checklistWidget.checklist.manualOpened",e.WORKSPACE_USER_INVITED="workspace.user.invited",e}({}),o=function(e){return e.SLASH_MENU="slash_menu",e.BLOCK_PROMPT="block_prompt",e.INSERT_WIDGET="insert_widget",e.INPUT_RULE="input_rule",e.KEYBOARD_SHORTCUT="keyboard_shortcut",e.CARD_DIVIDER="card_divider",e.CARD_DIVIDER_DROPDOWN="card_divider_dropdown",e.CARD_DIVIDER_AI="card_divider_ai",e.FORMATTING_MENU="formatting_menu",e.SUMMARIZE="summarize",e.FILMSTRIP="filmstrip",e.FILMSTRIP_DROPDOWN="filmstrip_dropdown",e.FILMSTRIP_CARD_MENU="filmstrip_card_menu",e.CARD_TEMPLATE_MODAL="card_template_modal",e.CARD_TEMPLATE_PLACEHOLDER="card_template_placeholder",e}({})},82257:(e,t,l)=>{"use strict";l.d(t,{oR:()=>r}),l(31085);var a=l(14041),n=l(30503);let o=a.createContext({publishedVersionOverride:!1}),i=()=>(0,a.useContext)(o);function r(){let{publishedVersionOverride:e}=i();return e||(0,n.NF)()}},747:(e,t,l)=>{"use strict";l.d(t,{c:()=>m});var a=l(31242),n=l(14041),o=l(17303),i=l(88957),r=l(61690),s=l(62849),d=l(30503),u=l(82257),c=l(13749);let m=e=>{let{url:t,nonPublishedUrl:l}=e,{push:m}=(0,a.useRouter)(),f=(0,s.En)(),p=(0,i.GV)(r.Jo),g=(0,u.oR)(),h=(0,i.GV)(o.C),b=g?(0,d.M7)({url:t,doc:p,previewEnabled:h}):l||t,y=f&&(0,d.uH)(t,p),v=(0,n.useCallback)(e=>{(0,c.jv)(b)&&(e.preventDefault(),m(b,void 0,{shallow:!0}))},[b,m]);return(0,n.useMemo)(()=>({linkUrl:b,handleClick:h?v:void 0,isCurrentPage:y}),[v,b,h,y])}},13154:(e,t,l)=>{"use strict";l.d(t,{M:()=>n,P:()=>a});let a=e=>{window.gammaTiming=window.gammaTiming||{},window.gammaTiming[e]=performance.now()},n=()=>{if("complete"!==document.readyState){window.addEventListener("load",n);return}window.removeEventListener("load",n),console.log("%cPerformance Timings","color: white; background-color: #6B46C1; padding: 5px; font-size: 1.5em;"),Object.entries(window.gammaTiming).sort((e,t)=>{let[,l]=e,[,a]=t;return l-a}).forEach(e=>{let[t,l]=e;l=Math.round(100*l)/100,console.log("".concat(t,": ").concat(l,"ms"))}),console.log("%cPerformance Timings END","color: white; background-color: #6B46C1; padding: 5px; font-size: 1.5em;")}},35147:(e,t,l)=>{"use strict";l.d(t,{Gd:()=>p,JN:()=>g,_J:()=>b,l$:()=>f,lo:()=>h});var a=l(8796);l(46343),l(13749);let n={site:void 0,isPublishing:!1,currentDocId:void 0,currentNavItem:void 0,hasNavAnimated:!1,pagesLastUpdatedMap:{}},o=(0,a.Z0)({name:"Site",initialState:n,reducers:{reset:()=>n,setSite(e,t){let{site:l}=t.payload;e.site=l},setPublishing(e,t){let{isPublishing:l}=t.payload;e.isPublishing=l},setCurrentDocId(e,t){let{currentDocId:l}=t.payload;e.currentDocId=l},setCurrentNavItem(e,t){let{currentNavItem:l}=t.payload;e.currentNavItem=l},setHasNavAnimated(e,t){let{hasNavAnimated:l}=t.payload;e.hasNavAnimated=l},setPageUpdated(e,t){let{pageId:l,lastUpdatedAt:a}=t.payload;e.pagesLastUpdatedMap[l]=a}}}),{setSite:i,setCurrentDocId:r,setCurrentNavItem:s,setPublishing:d,setPageUpdated:u,setHasNavAnimated:c,reset:m}=o.actions,f=e=>t=>{e(c({hasNavAnimated:t}))},p=e=>e.Site.site,g=e=>{var t;return null===(t=e.Site.site)||void 0===t?void 0:t.theme},h=e=>e.Site.hasNavAnimated,b=o.reducer},13749:(e,t,l)=>{"use strict";l.d(t,{wK:()=>r,z5:()=>i,jv:()=>s}),l(56622),l(40074),l(59646);var a=l(73893),n=l(92405);a.$.APPLICATION_ENVIRONMENT,a.$.APPLICATION_ENVIRONMENT;let o=e=>{if(e)return(null==e?void 0:e.routes.find(e=>"/"===e.path||""===e.path))||(null==e?void 0:e.routes[0])},i=e=>{if(!e)return;let t=o(e);if(t)return(0,n.pF)({docId:t.docId,absolute:!0})},r=e=>(null==e?void 0:e.startsWith("/"))?e:"/"+e,s=e=>/^\/docs\/[-\w]+\/preview$/.test(e)},7203:(e,t,l)=>{"use strict";l.d(t,{vd:()=>n,L6:()=>o});let a=new(l(36832)).b,n=e=>{let{theme:t}=e;a.emit("openThemeConfiguration",{baseTheme:t,view:"editor"})},o=e=>{let{theme:t}=e;a.emit("openThemeConfiguration",{baseTheme:t,view:"editor",isNewFork:!0})}},80304:(e,t,l)=>{"use strict";l.d(t,{TJ:()=>es,cS:()=>ed});var a=l(8796);l(46343),l(28997);var n=l(34185),o=l(27569);let i=()=>({theme:null,originalTheme:null,baseTheme:null,previewingDocContent:void 0,themeBackgroundImgStatus:"idle",themeLogoImgStatus:"idle"}),r=(0,a.Z0)({name:"ThemeEditing",initialState:i(),reducers:{resetThemeEditingState:()=>i(),setOriginalTheme:(e,t)=>{e.originalTheme=t.payload.originalTheme},setPreviewingDocContent:(e,t)=>{e.previewingDocContent=t.payload.json},initBlankTheme(e){e.theme=(0,n.N)()},setBaseTheme(e,t){e.theme={...e.theme,...t.payload.baseTheme}},updateThemeName(e,t){e.theme&&(e.theme.name=t.payload.name)},updateCardColor(e,t){e.theme&&(e.theme.config.cardColor=t.payload.color)},updateCardBorderColor(e,t){e.theme&&(e.theme.config.cardBorderColor=t.payload.color)},updatePrimaryColor(e,t){e.theme&&(e.theme.accentColor=void 0,e.theme.config.primaryColor=t.payload.color,e.theme.config.accentBackgrounds=void 0,e.theme.config.stylePrompt=void 0)},updateSecondaryColors(e,t){e.theme&&(e.theme.config.secondaryColors=t.payload.colors)},updateHeadingFont(e,t){if(!e.theme)return;let{font:l,fontsMap:a}=t.payload;e.theme.headingFont=l,e.theme.fonts=(0,o.Hs)({fontsMap:a,headingFontId:l,bodyFontId:e.theme.bodyFont})},updateBodyFont(e,t){if(!e.theme)return;let{fontsMap:l,font:a}=t.payload;e.theme.bodyFont=a,e.theme.fonts=(0,o.Hs)({fontsMap:l,bodyFontId:a,headingFontId:e.theme.headingFont})},updateHeadingFontWeight(e,t){e.theme&&(e.theme.headingFontWeight=t.payload.weight)},updateBodyFontWeight(e,t){e.theme&&(e.theme.bodyFontWeight=t.payload.weight)},updateBodyColor(e,t){e.theme&&(e.theme.config.bodyColor=t.payload.color)},updateHeadingColor(e,t){e.theme&&(e.theme.config.headingColor=t.payload.color)},updateHeadingFontAndWeight(e,t){e.theme&&(e.theme.headingFont=t.payload.font,e.theme.headingFontWeight=t.payload.weight,e.theme.fonts=(0,o.Hs)({fontsMap:t.payload.fontsMap,headingFontId:t.payload.font,bodyFontId:e.theme.bodyFont}))},updateBodyFontAndWeight(e,t){e.theme&&(e.theme.bodyFont=t.payload.font,e.theme.bodyFontWeight=t.payload.weight,e.theme.fonts=(0,o.Hs)({fontsMap:t.payload.fontsMap,bodyFontId:t.payload.font,headingFontId:e.theme.headingFont}))},updateFontPair(e,t){if(!e.theme)return;let{fontPair:l,fontsMap:a}=t.payload;e.theme.headingFont=l.heading.font,e.theme.bodyFont=l.body.font,e.theme.headingFontWeight=l.heading.weight,e.theme.bodyFontWeight=l.body.weight,e.theme.fonts=(0,o.Hs)({fontsMap:a,headingFontId:l.body.font,bodyFontId:l.heading.font})},updateConfig(e,t){e.theme&&(e.theme.config={...e.theme.config,...t.payload.config})},toggleDisabilityAdjustment(e){e.theme&&(e.theme.config.disableReadabilityAdjustment=!e.theme.config.disableReadabilityAdjustment)},updateLetterSpacingHeading(e,t){e.theme&&(e.theme.config.letterSpacingHeading=t.payload.letterSpacing)},updateLetterSpacingBody(e,t){e.theme&&(e.theme.config.letterSpacingBody=t.payload.letterSpacing)},updateLineHeightHeading(e,t){e.theme&&(e.theme.config.lineHeightHeading=t.payload.lineHeight)},updateLineHeightBody(e,t){e.theme&&(e.theme.config.lineHeightBody=t.payload.lineHeight)},updateBodyFontSize(e,t){e.theme&&(e.theme.config.fontSize=t.payload.fontSize)},updateHeadingFontSize(e,t){e.theme&&(e.theme.config.headingFontSize=t.payload.fontSize)},updateHeadingTransform(e,t){e.theme&&(e.theme.config.headingTransform=t.payload.transform)},updateShapeColorScheme(e,t){e.theme&&(e.theme.config.shapeColorScheme=t.payload.shapeColorScheme)},updateShapeColors(e,t){e.theme&&(e.theme.config.shapeColors=t.payload.colors)},updateLinkColor(e,t){e.theme&&(e.theme.config.linkColor=t.payload.color)},updateButtonRoundness(e,t){e.theme&&(e.theme.config.buttonRoundness=t.payload.roundness)},updateButtonColor(e,t){e.theme&&(e.theme.config.buttonColor=t.payload.color)},updateShapeShadow(e,t){e.theme&&(e.theme.config.shapeShadow=t.payload.shapeShadow)},updateShapeBorder(e,t){e.theme&&(e.theme.config.shapeBorder=t.payload.shapeBorder)},updateShapeFill(e,t){e.theme&&(e.theme.config.shapeFill=t.payload.shapeFill)},updateAccentCut(e,t){e.theme&&(e.theme.config.accentCut=t.payload.accentCut)},updateCardTransparency(e,t){e.theme&&(e.theme.config.cardTransparency=t.payload.cardTransparency)},updateCardBorder(e,t){e.theme&&(e.theme.config.cardBorder=t.payload.cardBorder)},updateRoundness(e,t){e.theme&&(e.theme.config.roundness=t.payload.roundness)},updateCardShadow(e,t){e.theme&&(e.theme.config.cardShadow=t.payload.cardShadow)},updateStylePrompt(e,t){e.theme&&(e.theme.config.stylePrompt=t.payload.stylePrompt)},updateAccentBackgrounds(e,t){e.theme&&(e.theme.config.accentBackgrounds=t.payload.accentBackgrounds)},handleBackgroundImageUploadStart(e,t){e.theme&&(e.themeBackgroundImgStatus="loading",e.theme.config.background=t.payload.background)},handleBackgroundImageUploadSuccess(e,t){e.theme&&(e.themeBackgroundImgStatus="idle",e.theme.config.background=t.payload.background)},handleBackgroundImageUploadError(e){e.themeBackgroundImgStatus="error"},handleLogoImageUploadStart(e){e.themeLogoImgStatus="loading"},handleLogoImageUploadSuccess(e,t){var l;e.theme&&(e.themeLogoImgStatus="idle",e.theme.logoUrl=(null===(l=t.payload.logoImage)||void 0===l?void 0:l.src)||void 0,e.theme.config.logoImage=t.payload.logoImage)},handleLogoImageUploadError(e){e.themeLogoImgStatus="error"},handleRemoveLogoImage(e){e.theme&&(e.theme.logoUrl=void 0,e.theme.config.logoImage=void 0)},updateColorKeywords(e,t){e.theme&&(e.theme.config.keywords||(e.theme.config.keywords={color:[],tone:[]}),e.theme.config.keywords.color=t.payload.colorKeywords)},updateToneKeywords(e,t){e.theme&&(e.theme.config.keywords||(e.theme.config.keywords={color:[],tone:[]}),e.theme.config.keywords.tone=t.payload.toneKeywords)},updateThemePriority(e,t){e.theme&&(e.theme.priority=t.payload.priority||0)},updateThemeContentStyles(e,t){e.theme&&(e.theme.config.contentStyles=t.payload.contentStyles)}}}),{resetThemeEditingState:s,setOriginalTheme:d,setPreviewingDocContent:u,updateThemeName:c,initBlankTheme:m,setBaseTheme:f,updateCardColor:p,updateCardBorderColor:g,updatePrimaryColor:h,updateSecondaryColors:b,updateHeadingFont:y,updateBodyFont:v,updateHeadingFontWeight:k,updateBodyFontWeight:w,updateBodyColor:x,updateHeadingColor:S,updateHeadingFontAndWeight:A,updateBodyFontAndWeight:C,updateConfig:z,updateFontPair:I,toggleDisabilityAdjustment:j,updateLetterSpacingHeading:F,updateLetterSpacingBody:B,updateLineHeightHeading:R,updateLineHeightBody:_,updateBodyFontSize:M,updateHeadingFontSize:E,updateHeadingTransform:T,updateShapeColorScheme:O,updateShapeColors:P,updateLinkColor:N,updateButtonRoundness:D,updateButtonColor:L,updateShapeShadow:W,updateShapeBorder:U,updateShapeFill:G,updateAccentCut:H,updateCardTransparency:V,updateCardBorder:q,updateRoundness:K,updateCardShadow:J,updateStylePrompt:$,updateAccentBackgrounds:Q,handleBackgroundImageUploadStart:Y,handleBackgroundImageUploadSuccess:X,handleBackgroundImageUploadError:Z,handleLogoImageUploadStart:ee,handleLogoImageUploadSuccess:et,handleLogoImageUploadError:el,handleRemoveLogoImage:ea,updateColorKeywords:en,updateToneKeywords:eo,updateThemePriority:ei,updateThemeContentStyles:er}=r.actions,es=e=>{var t,l;return null===(l=e.ThemeEditing)||void 0===l?void 0:null===(t=l.theme)||void 0===t?void 0:t.id},ed=r.reducer},48192:(e,t,l)=>{"use strict";l.d(t,{j:()=>a});let a="accent.theme"},57799:(e,t,l)=>{"use strict";l.d(t,{E:()=>s,V:()=>d});var a=l(31085),n=l(76228),o=l(80853),i=l(95986),r=l(42391),s=function(e){return e[e.small=4]="small",e[e.medium=7]="medium",e}({});let d=e=>{let{color:t,setColor:l=()=>{},isActive:s=!1,name:d,size:u=7,tooltipIsDisabled:c=!1}=e,m=(0,r.$p)(t)?"white":"black";return(0,a.jsx)(i.Tz,{label:d||t.toUpperCase(),placement:"top",isDisabled:c,children:(0,a.jsx)(o.$,{display:"inline-block",alignSelf:"center",boxSize:u,borderRadius:"md",border:"1px solid",borderColor:"blackAlpha.300",color:m,bgColor:null!=t?t:"#FFFFFF",onClick:()=>l(t),variant:"unstyled",minW:0,fontSize:"xs",transitionProperty:"border",transitionDuration:"normal",children:s&&(0,a.jsx)(n.S,{})})})}},31549:(e,t,l)=>{"use strict";l.d(t,{v:()=>p});var a=l(31085),n=l(18528),o=l(80853),i=l(35687),r=l(80532),s=l(61778),d=l(20501),u=l(24221),c=l(52177),m=l(1602),f=l.n(m);let p=e=>{let{color:t,isDefaultColor:l,isMixed:m=!1,...p}=e;return(0,a.jsx)(n.I,{as:o.$,variant:"plain",size:"sm",boxShadow:"none",minW:"fit-content",textAlign:"left",rightIcon:(0,a.jsx)(u.g,{fixedWidth:!0,icon:d.Jt$,transform:"shrink-6"}),...p,children:(0,a.jsxs)(i.B,{direction:"row",spacing:2,align:"center",children:[(0,a.jsx)(r.az,{as:"span",alignSelf:"center",boxSize:5,borderRadius:"md",border:"2px solid",borderColor:"gray.300",bgColor:t}),(0,a.jsx)(s.E,{fontFamily:l||m?void 0:"mono",textTransform:l||m?void 0:"uppercase",fontSize:"sm",children:m?(0,a.jsx)(c.x6,{id:"+UN6+J"}):l?(0,a.jsx)(c.x6,{id:"ovBPCi"}):f()(t).toHexString()})]})})}},49624:(e,t,l)=>{"use strict";l.d(t,{b:()=>F});var a=l(31085),n=l(2600),o=l(70323),i=l(25420),r=l(80853),s=l(20501),d=l(24221),u=l(52177),c=l(14041),m=l(10458),f=l(12327),p=l(48637),g=l(62313),h=l(61778),b=l(18201),y=l(15672),v=l(91559),k=l(57799);let w=e=>{let{label:t,colors:l,setColor:n,currentColor:o,isDefault:i,handleAddColorButtonClick:s}=e,{isInOfflineMode:d}=(0,v.u)();return(0,a.jsx)(p.r,{children:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(g.z,{px:"2",fontSize:"sm",w:"100%",justifyContent:"space-between",alignItems:"center",mb:"2",mt:s?1:0,children:[(0,a.jsx)(h.E,{children:t}),(0,a.jsx)(b.h,{}),s&&(0,a.jsx)(r.$,{variant:"link",fontSize:"sm",onClick:s,isDisabled:d,children:(0,a.jsx)(u.x6,{id:"ePK91l"})})]}),(0,a.jsx)(y.r,{gap:1.5,columns:6,p:2,pt:0,children:l.map((e,t)=>{let{hex:l,name:r}=e;return(0,a.jsx)(k.V,{name:r,color:l,setColor:n,isActive:i?null===o:o===l},t)})})]})})},x=()=>[{key:"black",hex:"#000000",name:f.Ru._({id:"THokF3"})},{key:"dark-gray",hex:"#4D4D4D",name:f.Ru._({id:"uUMrFZ"})},{key:"gray",hex:"#808080",name:f.Ru._({id:"qS5//Q"})},{key:"light-gray",hex:"#CCCCCC",name:f.Ru._({id:"xa/b9m"})},{key:"white-smoke",hex:"#F2F2F2",name:f.Ru._({id:"rGj3KB"})},{key:"white",hex:"#FFFFFF",name:f.Ru._({id:"5Ex+AP"})},{key:"light-sun",hex:"#FCEC99",name:f.Ru._({id:"nOXj3q"})},{key:"peach",hex:"#FFD1A7",name:f.Ru._({id:"68+2yw"})},{key:"salmon",hex:"#FAA1A1",name:f.Ru._({id:"TrGQaZ"})},{key:"lavender",hex:"#D8AFF8",name:f.Ru._({id:"gc4DdH"})},{key:"baby-blue",hex:"#AFCBF8",name:f.Ru._({id:"+bmpN5"})},{key:"pale-green",hex:"#AEE4BD",name:f.Ru._({id:"hUOhvE"})},{key:"gold",hex:"#F9D933",name:f.Ru._({id:"FYlHHU"})},{key:"orange",hex:"#FFA44F",name:f.Ru._({id:"4OE5Sf"})},{key:"red",hex:"#F44444",name:f.Ru._({id:"wRTiSD"})},{key:"purple",hex:"#B05EF1",name:f.Ru._({id:"mF9LxA"})},{key:"blue",hex:"#5E98F1",name:f.Ru._({id:"Zn5crm"})},{key:"green",hex:"#5CC97B",name:f.Ru._({id:"VmkjGB"})},{key:"dark-goldenrod",hex:"#957D00",name:f.Ru._({id:"vWWr+k"})},{key:"brown",hex:"#995515",name:f.Ru._({id:"JLxwQS"})},{key:"maroon",hex:"#910D0D",name:f.Ru._({id:"cg4yu3"})},{key:"dark-purple",hex:"#5E208E",name:f.Ru._({id:"oqSDkM"})},{key:"midnight-blue",hex:"#204C8E",name:f.Ru._({id:"QCyMdk"})},{key:"forest-green",hex:"#1F7135",name:f.Ru._({id:"HVCLqF"})}],S=e=>{let{setColor:t,currentColor:l}=e;return(0,a.jsx)(w,{label:f.Ru._({id:"Zp2USm"}),colors:x(),setColor:t,currentColor:l})};var A=l(88957),C=l(7203),z=l(1771),I=l(61690);let j=e=>{let{setColor:t,currentColor:l}=e,n=(0,A.GV)(I.SJ),o=(0,z.ND)(n,!0).map(e=>{let t=(0,z.Ik)(e);return{hex:t,key:t}});return(0,a.jsx)(w,{label:f.Ru._({id:"J1XRO3"}),colors:o,setColor:t,currentColor:l,handleAddColorButtonClick:()=>{n.workspaceId?(0,C.vd)({theme:n}):(0,C.L6)({theme:n})},addColorLabel:null===n.workspaceId?f.Ru._({id:"0TWTg2"}):f.Ru._({id:"TExCtI"})})},F=e=>{let{currentColor:t,setColor:l,unsetColor:f=()=>l(null),source:p}=e,g=(0,m.st)(),h=(0,c.useCallback)(e=>{null==g||g.track(m.VV.COLOR_PICKER_SET_COLOR,{color:e,source:p}),l(e)},[l,g,p]),b=(0,c.useCallback)(()=>{null==g||g.track(m.VV.COLOR_PICKER_RESET,{source:p}),f()},[f,g,p]);return(0,m.JQ)(e=>{e.track(m.VV.COLOR_PICKER_OPENED,{source:p})},[p]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(n.T,{divider:(0,a.jsx)(o.c,{}),p:0,align:"start",children:[(0,a.jsx)(j,{setColor:h,currentColor:t}),(0,a.jsx)(S,{setColor:h,currentColor:t})]}),(0,a.jsx)(i.s,{px:5,py:3,bg:"gray.100",alignItems:"center",justifyContent:"center",mx:-2,mb:-2,mt:2,children:(0,a.jsx)(r.$,{onClick:b,variant:"link",size:"sm",colorScheme:"gray",leftIcon:(0,a.jsx)(d.g,{icon:s.U23}),children:(0,a.jsx)(u.x6,{id:"L+rMC9"})})})]})}},40197:(e,t,l)=>{"use strict";l.d(t,{ws:()=>b,OE:()=>y,Jm:()=>h,_m:()=>m,z8:()=>f,mI:()=>p,SB:()=>x,T5:()=>g,z0:()=>v,kI:()=>k,AG:()=>w});var a=l(31085),n=l(80532),o=l(20501),i=l(3040),r=l(24221),s=l(52177),d=l(12327),u=l(39286),c=l(80215);let m=6,f={bodyFont:"Inter",headingFont:"Inter",fontSize:1},p={heading:700,body:400};s.x6,d.Ru._({id:"VjG5AF"}),s.x6,u.On,n.az,s.x6,d.Ru._({id:"B+0JwP"}),s.x6,r.g,o.ffg,s.x6,d.Ru._({id:"c0FWFX"}),r.g,o.Oh6;let g={sm:{name:()=>d.Ru._({id:"1DA6ap"}),previewSx:{borderRadius:"4"},cardRadius:.125,blockRadius:.125,pathRounding:.01},md:{name:()=>d.Ru._({id:"ovBPCi"}),previewSx:{borderRadius:"8"},cardRadius:.6,blockRadius:.35,pathRounding:.02},lg:{name:()=>d.Ru._({id:"LeIKtN"}),previewSx:{borderRadius:"12"},cardRadius:1.2,blockRadius:.75,pathRounding:.03},xl:{name:()=>d.Ru._({id:"79MurW"}),previewSx:{borderRadius:"20"},cardRadius:2,blockRadius:1.25,pathRounding:.04}},h={none:{name:()=>d.Ru._({id:"EdQY6l"}),previewSx:{boxShadow:"none"},shadow:void 0},default:{name:()=>d.Ru._({id:"ovBPCi"}),previewSx:{boxShadow:"lg"},shadow:"0 0.25em 0.375em -0.0625em rgba(0, 0, 0, 0.1), 0 0.125em 0.25em -0.0625em rgba(0, 0, 0, 0.06)"},hard:{name:()=>d.Ru._({id:"g5Fk5U"}),previewSx:{boxShadow:"4px 4px 0 0 rgba(0, 0, 0, 0.4)"},shadow:"var(--card-shadow-distance) var(--card-shadow-distance) 0 0 var(--card-border-color)",pdfShadow:!0},soft3d:{name:()=>d.Ru._({id:"9Ti2G9"}),previewSx:{boxShadow:"-0.375em -0.375em 0.75em rgba(0, 0, 0, 0.25), 0.375em 0.375em 0.75em rgba(255, 255, 255, 0.25)"},deprecated:!0,shadow:""}},b={none:{name:()=>d.Ru._({id:"EdQY6l"}),icon:(0,a.jsx)(r.g,{icon:o.Vf1}),previewSx:{borderWidth:"0px"},cardBorderEm:0,shapeBorderEm:0,lineThicknessEm:.125,shadowSizeEm:.125,cardShadowSizeEm:.5},sm:{name:()=>d.Ru._({id:"RGjFMI"}),icon:(0,a.jsx)(n.az,{w:6,h:.5,bg:"gray.900",borderRadius:"md"}),previewSx:{borderWidth:"1px",borderStyle:"solid"},cardBorderEm:.0625,shapeBorderEm:.0625,lineThicknessEm:.125,shadowSizeEm:.125,cardShadowSizeEm:.4},md:{name:()=>d.Ru._({id:"agPptk"}),icon:(0,a.jsx)(n.az,{w:6,h:1,bg:"gray.900",borderRadius:"md"}),previewSx:{borderWidth:"2px",borderStyle:"solid"},cardBorderEm:.125,shapeBorderEm:.125,lineThicknessEm:.125,shadowSizeEm:.15,cardShadowSizeEm:.5},lg:{name:()=>d.Ru._({id:"JwqAmu"}),icon:(0,a.jsx)(n.az,{w:6,h:2,bg:"gray.900",borderRadius:"md"}),previewSx:{borderWidth:"4px",borderStyle:"solid"},cardBorderEm:.25,shapeBorderEm:.175,lineThicknessEm:.25,shadowSizeEm:.2,cardShadowSizeEm:.7}},y={sm:{name:()=>d.Ru._({id:"1DA6ap"}),previewSx:{borderRadius:"1.5"},borderRadius:"0.125em"},md:{name:()=>d.Ru._({id:"ovBPCi"}),previewSx:{borderRadius:"4"},borderRadius:"0.375em"},lg:{name:()=>d.Ru._({id:"LeIKtN"}),previewSx:{borderRadius:"8"},borderRadius:"0.75em"},xl:{name:()=>d.Ru._({id:"Q4Of8O"}),previewSx:{borderRadius:"full"},borderRadius:"8em"}},v={solid:{name:()=>d.Ru._({id:"5bi1la"}),icon:(0,a.jsx)(r.g,{icon:i.GEE}),previewSx:{backgroundColor:"gray.200"},opacity:1},semi:{name:()=>d.Ru._({id:"EmiaJC"}),icon:(0,a.jsx)(r.g,{icon:o.B2J}),previewSx:{backgroundColor:"gray.100"},opacity:.5},none:{name:()=>d.Ru._({id:"EdQY6l"}),icon:(0,a.jsx)(r.g,{icon:o.GEE}),previewSx:{backgroundColor:"transparent"},opacity:0}},k={none:{name:()=>d.Ru._({id:"EdQY6l"}),previewSx:{boxShadow:"none"},shadowDistance:0,shadowBlur:"0",shapeFilter:"none",shadowColorScheme:"card"},soft:{name:()=>d.Ru._({id:"bgjaGb"}),previewSx:{boxShadow:"var(--chakra-shadows-md)"},shadowBlur:"1.5em",shadowDistance:0,shadowColorScheme:"card"},hard:{name:()=>d.Ru._({id:"g5Fk5U"}),previewSx:{boxShadow:"3px 3px 0 0 rgba(0, 0, 0, 0.4)"},shadowBlur:"0",shadowDistance:.75,shadowColorScheme:"block",pdfShadow:!0},soft3d:{name:()=>d.Ru._({id:"9Ti2G9"}),previewSx:{boxShadow:"inset -0.125em -0.125em 0.25em rgba(255, 255, 255, 0.25), inset 0.125em 0.125em 0.25em rgba(0, 0, 0, 0.25)"},deprecated:!0,getShadow:e=>(0,c.m)(e,.125,!0),getClickShadow:e=>(0,c.m)(e,.125,!1),shapeFilter:"url(#theme-shape-shadow)"}},w={cardTransparency:"default",roundness:"md",buttonRoundness:"md",cardShadow:"default",cardBorder:"sm",shapeFill:"solid",shapeShadow:"none",shapeBorder:"sm",shapeColorScheme:"default",accentCut:"default"},x={default:{shapeColorScheme:"accent"},daydream:{roundness:"xl",buttonRoundness:"xl",shapeFill:"none",shapeBorder:"md",cardBorder:"lg",cardTransparency:"faded",cardShadow:"none",shapeColorScheme:"custom"},finesse:{roundness:"sm",buttonRoundness:"sm",cardBorder:"none",cardShadow:"none",shapeFill:"solid",shapeBorder:"none",shapeShadow:"none"},glass:{cardTransparency:"frosted",shapeColorScheme:"accent",cardShadow:"none"},icebreaker:{roundness:"sm",buttonRoundness:"sm",cardBorder:"none",cardShadow:"none",shapeFill:"solid",shapeBorder:"none",shapeShadow:"none"},soft3d:{cardShadow:"soft3d",cardBorder:"none",roundness:"lg",buttonRoundness:"xl",shapeShadow:"soft3d",shapeFill:"none",shapeBorder:"none"}}},87747:(e,t,l)=>{"use strict";l.d(t,{PJ:()=>c,rd:()=>u}),l(31085),l(14041);var a=l(73893);l(77914);var n=l(65998);l(3204);var o=l(88957),i=l(35147);l(40197);var r=l(1771),s=l(61690),d=l(30358);l(7203);let u=()=>{let e=(0,o.GV)(s.SJ),t=(0,o.GV)(i.JN);return t?(0,r.Mw)(t):!!e&&(0,r.Mw)(e)},c=(e,t)=>{let{isGammaOrgUser:l}=(0,d.ur)(),o=(0,n.u)("uploadThemeImagesToProd");return l&&o&&"themeBackground"===t?{orgId:"theme_images/standard",templateId:a.$.TRANSLOADIT_THEME_IMAGE_TEMPLATE_ID,useStandardThemeBucket:!0}:{orgId:e,templateId:void 0,useStandardThemeBucket:!1}}},80215:(e,t,l)=>{"use strict";l.d(t,{Y:()=>r,m:()=>s});var a=l(31085),n=l(14041),o=l(42391),i=l(1771);let r=(0,n.memo)(e=>{let{theme:t,id:l}=e,n=(0,i.Mw)(t);return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("filter",{id:l||"soft3d-small-inner-shadow",children:[(0,a.jsx)("feFlood",{floodColor:n?"rgba(0, 0, 0, 0.6)":"rgba(0, 0, 0, 0.15)",result:"flood1"}),(0,a.jsx)("feComposite",{operator:"out",in2:"SourceGraphic",in:"flood1",result:"composite1"}),(0,a.jsx)("feMorphology",{operator:"dilate",radius:.5,in:"composite1",result:"morphology1"}),(0,a.jsx)("feGaussianBlur",{stdDeviation:1.5,in:"morphology1",result:"blur1"}),(0,a.jsx)("feOffset",{dx:2,dy:2,in:"blur1",result:"offset1"}),(0,a.jsx)("feFlood",{floodColor:n?"rgba(255, 255, 255, 0.1)":"rgba(255, 255, 255, 0.75)",result:"flood2"}),(0,a.jsx)("feComposite",{operator:"out",in2:"SourceGraphic",in:"flood2",result:"composite2"}),(0,a.jsx)("feMorphology",{operator:"dilate",radius:.5,in:"composite2",result:"morphology2"}),(0,a.jsx)("feGaussianBlur",{stdDeviation:1.5,in:"morphology2",result:"blur2"}),(0,a.jsx)("feOffset",{dx:-2,dy:-2,in:"blur2",result:"offset2"}),(0,a.jsxs)("feMerge",{children:[(0,a.jsx)("feMergeNode",{in:"offset1"}),(0,a.jsx)("feMergeNode",{in:"offset2"})]}),(0,a.jsx)("feComposite",{operator:"atop",in2:"SourceGraphic"})]})})});r.displayName="Soft3DSmallOuterShadow";let s=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:.375,l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=2*Math.abs(t),n=(0,o.$p)(e);return"".concat(l?"inset":""," ").concat(-t,"em ").concat(-t,"em ").concat(a,"em ").concat(n?"rgba(255, 255, 255, 0.15)":"rgba(255, 255, 255, 0.75)",", ").concat(l?"inset":""," ").concat(t,"em ").concat(t,"em ").concat(a,"em ").concat(n?"rgba(0, 0, 0, 0.75)":"rgba(0, 0, 0, 0.15)")}},39124:(e,t,l)=>{"use strict";l.d(t,{x:()=>n});var a=l(42391);let n=e=>(0,a.$p)(e)?(0,a.Pf)(e,10):(0,a.Pf)(e,-10)},70605:(e,t,l)=>{"use strict";l.d(t,{EB:()=>d,Gx:()=>a,Up:()=>r,uQ:()=>o,zQ:()=>n});let a="themed-clickable-box",n={transitionProperty:"transform",transitionDuration:"normal"},o={transform:"scale(1.03)",_before:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",boxShadow:"inset 0 0 0 500px var(--expandable-hover-background)",pointerEvents:"none"}},i={border:"var(--shape-border-width) solid var(--neutral-border-color)",borderRadius:"var(--box-border-radius)",backgroundColor:"var(--clickable-background-color)",boxShadow:"var(--clickable-shadow)",backdropFilter:"var(--card-backdrop-filter)","@media print":{boxShadow:"none"}},r={_hover:{transform:"scale(1.1)"},color:"var(--link-color)",height:"auto",padding:"0.7em",paddingY:"0.2em",minW:"2.5em",position:"relative"},s=(e,t)=>({...n,...i,_hover:t?void 0:o,"@media print":{boxShadow:"none"}}),d=(e,t)=>({[".".concat(a)]:s(e,t)})},79428:(e,t,l)=>{"use strict";l.d(t,{CO:()=>s,tL:()=>u,xE:()=>d});var a=l(42391),n=l(22544),o=l(40197),i=l(1771),r=l(80215);let s={boxShadow:"var(--card-shadow)",backdropFilter:"var(--card-backdrop-filter)",backgroundColor:"var(--card-background-color)",borderRadius:"var(--card-border-radius)","@media print":{boxShadow:"var(--card-box-shadow)",border:"var(--card-border)"}},d={backdropFilter:"var(--card-backdrop-filter)",backgroundColor:"var(--card-background-color)",borderRadius:"0"},u=e=>{let{cardColor:t,config:l,theme:s}=e,d=(0,i.ZY)(t),u=(0,i.Ik)(t),c=(0,i.Bc)(l),m=(n.hQ||n.rS)&&"frosted"===l.cardTransparency?.95:.75,f=o.T5[l.roundness].cardRadius,{cardBorderEm:p,cardShadowSizeEm:g}=o.ws[l.cardBorder],h=(0,i.Ik)((0,i.J1)(s)),b=p>0&&"sm"===l.roundness?"1px":"".concat(f,"em"),{shadow:y,pdfShadow:v}=o.Jm[l.cardShadow||"default"],k=n.rS&&!v?void 0:"soft3d"===l.cardShadow?(0,r.m)(u):y,w=0===p?void 0:"0 0 0 ".concat(p,"em ").concat(h),x=d?(0,a.Pf)(u,20):(0,a.Pf)(u,-5);return{"--card-background-color":c?(0,a.$3)(u,m):u,"--card-border-color":h,"--card-backdrop-filter":"frosted"!==l.cardTransparency||n.hQ||n.rS?"none":"blur(20px) saturate(170%)","--card-border":0===p?void 0:"var(--card-border-width) solid var(--card-border-color)","--card-border-width":"".concat(p,"em"),"--card-border-radius":b,"--card-shadow-distance":"".concat(g,"em"),"--card-border-shadow":w,"--card-box-shadow":k,"--card-shadow":[w,k].filter(e=>!!e).join(", "),"--clickable-background-color":"none"===l.shapeFill?(0,a.$3)(x,.4):(0,a.$3)(x,.6)}}},41900:(e,t,l)=>{"use strict";l.d(t,{U6:()=>n,Dv:()=>o,dd:()=>s,U2:()=>d});var a=l(1771);let n="themed-heading",o="themed-heading-no-gradient",i={fontWeight:"var(--heading-font-weight)",fontFamily:"var(--heading-font)",color:"var(--heading-color)",background:"unset",backgroundClip:"unset",width:"fit-content",maxWidth:"100%",letterSpacing:"var(--letter-spacing-heading)",textTransform:"var(--heading-transform)"},r={...i,background:"var(--heading-gradient)",backgroundClip:"text",caretColor:"var(--heading-color)",color:"transparent","span.textColor":{textShadow:"0px 0.25px 0px var(--text-color), -0px -0.25px 0px var(--text-color)","@media print":{textShadow:"none"}}},s=e=>"linear-gradient"===(0,a.Lz)(e).type?{["*:where(.".concat(n,")")]:r,[".".concat(o)]:{[".".concat(n)]:i},"@media print":{[".".concat(n)]:i},[".".concat("is-pptx-exporting")]:{[".".concat(n)]:i}}:{[".".concat(n)]:i},d=e=>({[".".concat(n)]:i,"--heading-color":e})},93681:(e,t,l)=>{"use strict";l.d(t,{z:()=>a});let a={borderRadius:"var(--box-border-radius)"}},19937:(e,t,l)=>{"use strict";l.d(t,{S:()=>c});var a=l(82354),n=l(93765);let o=e=>{let{accentCut:t}=e.config;if(!t)return{};let{maskStyles:l,fgStyles:a}=i[t]||{};return{"[data-layout-cut=left]":l.left,"[data-layout-cut=right]":l.right,"[data-layout-cut=top]":l.top,"[data-layout-cut-fg=left]":a.left,"[data-layout-cut-fg=right]":a.right,"[data-layout-cut-fg=top]":a.top}},i={default:{name:()=>"Default",maskStyles:{left:void 0,right:void 0,top:void 0},fgStyles:{left:void 0,right:void 0,top:void 0}},fade:{name:()=>"Fade",maskStyles:{left:{maskImage:'url("'.concat("https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/gradient-left.5e1ae259.svg",'")'),maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"right",width:"110%",marginRight:"-10%"},right:{maskImage:'url("'.concat("https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/gradient-right.81936f6b.svg",'")'),maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"left",width:"110%",marginLeft:"-10%"},top:{maskImage:'url("'.concat("https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/gradient-top.9cbcc51e.svg",'")'),maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"bottom",height:"110%"}},fgStyles:{left:{maxWidth:"90%",marginRight:"10%"},right:{maxWidth:"90%",marginLeft:"10%"},top:void 0}},diagonal:{name:()=>"Diagonal",maskStyles:{left:{maskImage:'url("'.concat("https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/diagonal-left.c66da52d.svg",'")'),maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"right",width:"105%",marginRight:"-5%"},right:{maskImage:'url("'.concat("https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/diagonal-right.c56ea47c.svg",'")'),maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"left",width:"105%",marginLeft:"-5%"},top:{maskImage:'url("'.concat("https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/diagonal-top.f5cfbd00.svg",'")'),maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"bottom",height:"105%"}},fgStyles:{left:{maxWidth:"80%",marginRight:"20%"},right:{maxWidth:"80%",marginLeft:"20%"},top:{maxHeight:"85%",marginBottom:"auto"}}},round:{name:()=>"Round",maskStyles:{left:{maskImage:'url("'.concat("https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/circle-left.b2ca2ce2.svg",'")'),maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"right",width:"105%",marginRight:"-5%"},right:{maskImage:'url("'.concat("https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/circle-right.9a77e2f4.svg",'")'),maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"left",width:"105%",marginLeft:"-5%"},top:{maskImage:'url("'.concat("https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/circle-top.49150ee5.svg",'")'),maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"bottom",height:"105%"}},fgStyles:{left:{maxWidth:"80%",marginRight:"20%"},right:{maxWidth:"80%",marginLeft:"20%"},top:void 0}},roundInverse:{name:()=>"Round Inverse",maskStyles:{left:{maskImage:'url("'.concat("https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/circle-inverted-left.dbc8a93f.svg",'")'),maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"right",width:"110%",marginRight:"-10%"},right:{maskImage:'url("'.concat("https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/circle-inverted-right.de2dd517.svg",'")'),maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"left",width:"110%",marginLeft:"-10%"},top:{maskImage:'url("'.concat("https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/circle-inverted-top.07d69c71.svg",'")'),maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"bottom",height:"112%"}},fgStyles:{left:{maxWidth:"90%",marginRight:"10%"},right:{maxWidth:"90%",marginLeft:"10%"},top:{maxHeight:"90%",marginBottom:"auto"}}},wiggle:{name:()=>"Wiggle",maskStyles:{left:{maskImage:'url("'.concat("https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/wiggle-left.578c81e9.svg",'")'),maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"right",width:"105%",marginRight:"-5%"},right:{maskImage:'url("'.concat("https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/wiggle-right.8ee6fc0f.svg",'")'),maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"left",width:"105%",marginLeft:"-5%"},top:{maskImage:'url("'.concat("https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/wiggle-top.41b099b7.svg",'")'),maskSize:"cover",maskRepeat:"no-repeat",maskPosition:"bottom",height:"105%"}},fgStyles:{left:{maxWidth:"94%",marginRight:"6%"},right:{maxWidth:"94%",marginLeft:"6%"},top:{maxHeight:"95%",marginBottom:"auto"}}}};var r=l(70605),s=l(41900),d=l(63413),u=l(71220);let c=(e,t)=>({...(0,s.dd)(e),...(0,r.EB)(e,t),...(0,n.tX)(e),...o(e),...(0,d.py)(),...(0,u.zz)(),[".".concat(a.QJ," .").concat(a._P)]:e.config.contentStyles})},63413:(e,t,l)=>{"use strict";l.d(t,{D6:()=>u,P7:()=>c,QI:()=>j,Re:()=>v,SA:()=>d,VN:()=>p,_B:()=>m,eI:()=>f,gt:()=>I,lR:()=>g,n3:()=>z,py:()=>h});var a=l(42391),n=l(22544),o=l(40197),i=l(1771),r=l(41900),s=l(67442);let d="themed-html-shape-background",u="themed-svg-shape-background",c="themed-html-shape-fill",m="themed-svg-shape-fill",f="themed-line",p="themed-shape-outside-text",g="themed-shape-text-over-background",h=()=>({[".".concat(d)]:y,[".".concat(u)]:v,[".".concat(f)]:S,[".".concat("themed-svg-line")]:A,[".".concat(c)]:w,[".".concat(m)]:x,[".".concat(p)]:C,[".".concat(g)]:k}),b="var(--shape-shadow-color, var(--shape-border-color-override, var(--shape-border-color)))",y={borderRadius:"var(--box-border-radius)",boxShadow:"var(--shape-shadow, var(--shape-shadow-size) var(--shape-shadow-size) var(--shape-shadow-blur) ".concat(b,")"),border:"var(--shape-border-width) solid var(--shape-border-color-override, var(--shape-border-color))",background:"var(--shape-bg-color-override, var(--shape-bg-image, var(--shape-bg-color-alpha)))",backgroundColor:"var(--shape-bg-color-override, var(--shape-bg-color-alpha))","--body-color":"var(--shape-text-color)",...(0,r.U2)("var(--shape-text-color)")},v={fill:"var(--shape-bg-color-override, var(--shape-bg-image-svg) var(--shape-bg-color-alpha))",stroke:"var(--shape-border-color-override, var(--shape-border-color))",strokeWidth:"var(--shape-border-width)",vectorEffect:"non-scaling-stroke",strokeLinejoin:"round",strokeLinecap:"round",filter:"var(--shape-filter, drop-shadow(var(--shape-shadow-size) var(--shape-shadow-size) var(--shape-shadow-blur) ".concat(b,"))")},k={"--body-color":"var(--shape-text-color)",...(0,r.U2)("var(--shape-text-color)")},w={background:"var(--shape-bg-color-override, var(--shape-fill))"},x={fill:"var(--shape-bg-color-override, var(--shape-fill-svg))"},S={backgroundColor:"var(--shape-border-color-override, var(--line-color))",borderRadius:"var(--box-border-radius)"},A={stroke:"var(--shape-border-color-override, var(--line-color))",strokeLinejoin:"round",strokeLinecap:"round"},C={...(0,r.U2)("var(--body-color)")},z=e=>{let{bodyColor:t,cardColor:l,config:n,theme:r}=e,d=(0,i.Ik)(l),u=(0,i.Ik)((0,i.QD)(r,n.shapeColorScheme)),c=(0,i.GV)(r,n.shapeColorScheme,n.shapeFill),m="custom"===n.shapeColorScheme?"var(--neutral-border-color)":c,f=o.z0[n.shapeFill].opacity,p=(0,a.sN)(d,u,f),g=(0,i.Ik)(t),h=f>0&&!(0,a.a6)(u,g)?(0,s.S0)(u).textColor:g;return{"--shape-bg-image":"none"===n.shapeFill||"accent"!==n.shapeColorScheme?void 0:"var(--accent-gradient-background)","--shape-bg-color-alpha":p,"--shape-bg-color":u,"--shape-border-color":c,"--shape-text-color":h,"--line-color":m,"--shape-bg-image-svg":"none"===n.shapeFill||"accent"!==n.shapeColorScheme?"url(#transparent)":"url(#theme-accent-background-gradient-linear)","--shape-fill":"var(--accent-gradient-fill, var(--accent-color))","--shape-fill-opacity":f,"--shape-fill-svg":"url(#theme-accent-gradient-linear) var(--accent-color)"}},I=e=>{var t;let{config:l}=e,a=o.T5[l.roundness].blockRadius,n=null===(t=o.OE[l.buttonRoundness])||void 0===t?void 0:t.borderRadius,{shapeBorderEm:i,lineThicknessEm:r}=o.ws[l.shapeBorder];return{"--box-border-radius":"sm"===l.roundness&&i>0?"1px":"".concat(a,"em"),"--shape-border-width":"".concat(i,"em"),"--line-thickness":"round(".concat(r,"em, 1px)"),"--button-border-radius":n}},j=e=>{let{cardColor:t,config:l}=e,a=(0,i.Ik)(t),r=o.kI[l.shapeShadow],s=o.ws[l.shapeBorder].shadowSizeEm;if("getShadow"in r)return{"--shape-shadow":r.getShadow(a),"--clickable-shadow":r.getClickShadow(a),"--shape-filter":r.shapeFilter};{let{shadowDistance:e,shadowBlur:l,shadowColorScheme:a,pdfShadow:o}=r,i="block"===a?void 0:F(t),d="0 0.25em 0.375em -0.0625em rgba(0, 0, 0, 0.1), 0 0.125em 0.25em -0.0625em rgba(0, 0, 0, 0.06)";return n.rS&&!o?{"--shape-shadow":"none","--clickable-shadow":"none","--shape-filter":"none"}:0===e&&"0"===l?{"--shape-shadow":"none","--clickable-shadow":d}:{"--shape-shadow-size":"".concat(e*s,"em"),"--shape-shadow-blur":l,"--shape-shadow-color":i,"--clickable-shadow":d,"--shape-filter":void 0}}},F=e=>{let t=(0,i.Ik)(e);return .35>(0,a.VU)(t)?(0,a.$3)("white",.25):(0,a.$3)((0,a.PE)(t,.2),.125)}},67442:(e,t,l)=>{"use strict";l.d(t,{Ll:()=>s,S0:()=>r,pS:()=>i,q9:()=>d});var a=l(42391),n=l(39124),o=l(41900);let i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"var(--card-color)";if(!e)return{};let a=0==t?e:(0,n.x)(e);return{"--shape-bg-color-override":0===t?void 0:1===t?e:"color-mix(in oklab, ".concat(e," ").concat(100*t,"%, ").concat(l,")"),"--shape-border-color-override":a}},r=e=>{if(!e)return{textColor:void 0,textColorVars:void 0};let t=(0,a.$p)(e)?"#fff":"#000",l=s(t);return{textColor:t,textColorVars:l}},s=e=>{if(e)return{"--shape-text-color":e,"--body-color":e,"--heading-color":e,"--link-color":e,"--link-color-inverted":(0,a.$p)(e)?"#fff":"#000","--link-color-hover":(0,a.$p)(e)?(0,a.Zt)(e,10):(0,a.Zt)(e,-10)}},d=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!e)return;let l=i(e,t);if(0===t)return l;let{textColor:a,textColorVars:n}=r(e),s=a?(0,o.U2)(a):void 0;return{...l,...n,...s}}},71220:(e,t,l)=>{"use strict";l.d(t,{a0:()=>a,zz:()=>n});let a="themed-table",n=()=>({[".".concat(a)]:o}),o={border:"0.0625em solid var(--neutral-border-color)",borderRadius:"var(--box-border-radius)","tbody tr":{_even:{backgroundColor:"blackAlpha.50"},_odd:{backgroundColor:"whiteAlpha.50"}},td:{borderInlineStart:"0.0625em solid var(--shape-border-color)",_first:{borderInlineStartWidth:"0"}}}},55037:(e,t,l)=>{"use strict";l.d(t,{Dh:()=>h,ZI:()=>g});var a=l(2940),n=l.n(a),o=l(93765),i=l(42391),r=l(40197),s=l(1771),d=l(28997),u=l(27569),c=l(33919),m=l(79428),f=l(63413);let p=(e,t)=>{let l=void 0!==t,a=!e.config.disableReadabilityAdjustment||l,n=l?r._m:s.H5,o=l?4.5:3,d=t?{type:"solid",color:t}:(0,s.Tn)(e),u=(0,s.Ik)(d),c=t?(0,i.$p)(t):(0,s.Mw)(e),m=(0,s.CD)(e)[0],f=(0,s.Ik)(m),p=a?(0,s.Vj)(m,u,o,!1):m,g=(0,s.Jh)(e),h=a?(0,s.Vj)(g,u,o,!1):g,b=(0,s.Ik)(h),y=(0,s.jO)(e),v=a?(0,s.Vj)(y,u,o,!1):y,k=(0,s.Ik)(v),w=(0,s.fQ)(e),x=a?(0,s.Vj)(w,u,n,l):w,S=(0,s.Ik)(x),A=(0,i.$p)(S),C=(0,s.Lz)(e),z=a?(0,s.Vj)(C,u,o,l):C,I=(0,s.Ik)(z);return{bodyColorReadable:x,bodyColorSolid:S,isBodyColorDark:A,headingColorReadable:z,headingColorSolid:I,linkColorReadable:h,linkColorSolid:b,buttonColorReadable:v,buttonColorSolid:k,primaryColor:m,primaryColorReadable:p,primaryColorSolid:f,cardColor:d,cardColorSolid:u,isCardDark:c}},g=n()((e,t)=>{var l,a;let{bodyFont:n,headingFont:g,fonts:h}=e,b=(0,u.vt)(h,n)||r.z8.bodyFont,y=(0,u.vt)(h,g)||r.z8.headingFont,{bodyColorReadable:v,bodyColorSolid:k,isBodyColorDark:w,headingColorReadable:x,primaryColorReadable:S,primaryColorSolid:A,primaryColor:C,linkColorSolid:z,buttonColorReadable:I,buttonColorSolid:j,cardColorSolid:F,cardColor:B,isCardDark:R}=p(e,t),_={...(0,d.M)(e),...e.config},M=(0,m.tL)({cardColor:B,config:_,theme:e}),E=(0,f.n3)({bodyColor:v,cardColor:B,config:_,theme:e}),T=(0,f.gt)({config:_}),O=(0,f.QI)({cardColor:B,config:_}),P="linear-gradient"!==C.type?void 0:"semi"===_.shapeFill?(0,c.nz)(C,F,.5):C,N=(0,c.Hh)(P,R?.25:.9);return{...M,...E,...T,...O,"--body-font":'"'.concat(b,'"'),"--heading-font":'"'.concat(y,'"'),"--heading-font-weight":(0,u.Kn)(e,"heading"),"--body-font-weight":(0,u.Kn)(e,"body"),"--letter-spacing-body":e.config.letterSpacingBody?"".concat(e.config.letterSpacingBody,"em"):void 0,"--letter-spacing-heading":e.config.letterSpacingHeading?"".concat(e.config.letterSpacingHeading,"em"):void 0,"--line-height-body":null!==(l=e.config.lineHeightBody)&&void 0!==l?l:o.Uw,"--line-height-heading":null!==(a=e.config.lineHeightHeading)&&void 0!==a?a:o.eL,"--heading-transform":e.config.headingTransform,"--accent-color":A,"--accent-color-readable":(0,s.Ik)(S),"--accent-gradient":(0,c.yh)(S),"--accent-gradient-fill":(0,c.yh)(C),"--accent-gradient-background":(0,c.yh)(N),"--accent-color-background-muted":R?(0,i.PE)(A,.15):(0,i.PE)(A,.9),"--expandable-hover-background":(0,i.$3)(z,.1),"--neutral-border-color":R?"var(--chakra-colors-whiteAlpha-400)":"var(--chakra-colors-blackAlpha-200)","--button-color":j,"--button-gradient":(0,c.yh)(I),"--button-color-inverted":(0,i.$p)(j)?"#fff":"#000","--link-color":z,"--link-color-hover":(0,i.$p)(z)?(0,i.Zt)(z,10):(0,i.Zt)(z,-10),"--link-box-shadow":"0 0 0px 3px ".concat((0,i.$3)(z,1)),"--body-color":k,"--body-color-muted":(0,i.$3)(k,.5),"--body-color-inverted":R?"#000":"#fff","--link-color-inverted":(0,i.$p)(z)?"#fff":"#000","--highlight-color-dark":R?"var(--body-color)":"var(--body-color-inverted)","--highlight-color-light":R?"var(--body-color-inverted)":"var(--body-color)","--highlight-link-color-hover-dark":R?(0,i.Zt)(k,w?10:-10):(0,i.Zt)("#fff",-10),"--highlight-link-color-hover-light":R?(0,i.Zt)("#000",10):(0,i.Zt)(k,w?10:-10),"--heading-color":(0,s.Ik)(x),"--heading-gradient":(0,c.yh)(x),"--card-color":F,"--card-color-mask":(0,i.$3)(F,(0,i.$p)(F)?.8:.85),"--placeholder-button-bg-color":R?(0,i.Lm)("gray.800"):(0,i.Lm)("gray.200"),"--placeholder-button-bg-hover-color":R?(0,i.Lm)("gray.600"):(0,i.Lm)("gray.300"),"--placeholder-button-text-color":R?(0,i.Lm)("gray.300"):(0,i.Lm)("gray.400"),"--placeholder-button-text-hover-color":R?(0,i.Lm)("gray.200"):(0,i.Lm)("gray.800")}}),h=n()(p)},34252:(e,t,l)=>{"use strict";l.d(t,{M:()=>a.M});var a=l(28997)},57673:(e,t,l)=>{"use strict";l.d(t,{OM:()=>h,ST:()=>g,_N:()=>c,cA:()=>u});var a=l(8796),n=l(41054),o=l(90854);let i={activeView:void 0,themesToDisplay:[],filterKeywords:[],searchQuery:"",globalThemes:[],workspaceThemes:[]},r=(0,a.Z0)({name:"ThemePicker",initialState:i,reducers:{reset:()=>i,setActiveView(e,t){e.activeView=t.payload.activeView},setWorkspaceThemes(e,t){e.workspaceThemes=t.payload.workspaceThemes},setGlobalThemes(e,t){e.globalThemes=t.payload.globalThemes},setFilterKeywords(e,t){e.filterKeywords=t.payload.filterKeywords},setSearchQuery(e,t){e.searchQuery=t.payload.searchQuery},resetThemePickerFilters:e=>{e.activeView=void 0,e.themesToDisplay=[],e.filterKeywords=[],e.searchQuery=""}}}),{reset:s,setActiveView:d,setGlobalThemes:u,setWorkspaceThemes:c,setFilterKeywords:m,setSearchQuery:f,resetThemePickerFilters:p}=r.actions;(0,n.Mz)(e=>e.ThemePicker.globalThemes,e=>e.ThemePicker.workspaceThemes,e=>e.ThemePicker.searchQuery,e=>e.ThemePicker.filterKeywords,e=>e.ThemePicker.activeView,(e,t,l,a,n)=>{if("standard"===n){if(0===a.length)return[...e].sort(o._1);let t=e.filter(e=>0!==a.length&&a.every(t=>{var l,a;return(null===(l=e.config.keywords)||void 0===l?void 0:l.color.includes(t))||(null===(a=e.config.keywords)||void 0===a?void 0:a.tone.includes(t))})),l=e.filter(e=>0!==a.length&&a.some(t=>{var l,a;return(null===(l=e.config.keywords)||void 0===l?void 0:l.color.includes(t))||(null===(a=e.config.keywords)||void 0===a?void 0:a.tone.includes(t))})).filter(e=>!t.includes(e));return[...t.sort(o._1),...l.sort(o._1)]}if("custom"===n)return[...t].sort(o._1);let i=null==l?void 0:l.toLowerCase();return[...e,...t].filter(e=>{var t,a,n,o,r,s;return!l||e.name.toLowerCase().includes(i)||(null===(a=e.config.keywords)||void 0===a?void 0:null===(t=a.color)||void 0===t?void 0:t.includes(i))||(null===(o=e.config.keywords)||void 0===o?void 0:null===(n=o.tone)||void 0===n?void 0:n.includes(i))||e.workspaceId&&(null===(s=e.createdBy)||void 0===s?void 0:null===(r=s.displayName)||void 0===r?void 0:r.toLowerCase().includes(i))}).sort(o._1)});let g=(0,n.Mz)(e=>e.ThemePicker.globalThemes,e=>e.ThemePicker.workspaceThemes,(e,t)=>[...e,...t]),h=r.reducer},1771:(e,t,l)=>{"use strict";l.d(t,{Bc:()=>S,CD:()=>I,GV:()=>_,Gw:()=>G,H5:()=>x,Hs:()=>y,Ik:()=>C,J1:()=>P,Jh:()=>M,Lz:()=>D,Mw:()=>A,ND:()=>W,Oq:()=>N,QD:()=>R,Sf:()=>H,Tn:()=>O,VH:()=>F,Vj:()=>L,ZR:()=>V,ZY:()=>z,Zs:()=>b,bh:()=>B,fQ:()=>T,iN:()=>w,jO:()=>E,mO:()=>K,nI:()=>v});var a=l(95986),n=l(2940),o=l.n(n),i=l(40074),r=l.n(i),s=l(87835),d=l.n(s),u=l(1602),c=l.n(u),m=l(38684),f=l(11081);l(26813);var p=l(42391),g=l(39124),h=l(33919);let b=a.t1.colors.trueblue[500],y="#000000",v="#272525",k=a.t1.colors.gray[200],w="#FFFFFF",x=4.5,S=e=>e.cardTransparency?"frosted"===e.cardTransparency||"faded"===e.cardTransparency:"glass"===e.themeBase||"daydream"===e.themeBase,A=e=>{var t,l;let a=N(e);return a?(0,p.$p)(a):null!==(l=null===(t=e.config.container)||void 0===t?void 0:t.isDark)&&void 0!==l&&l},C=o()(e=>"string"==typeof e?e:"linear-gradient"===e.type?(0,h.i_)(e):e.color||v),z=o()(e=>(0,p.$p)(C(e))),I=o()(e=>[F(e),...j(e)]),j=o()(e=>{var t;return e.config.secondaryColors?e.config.secondaryColors:(null===(t=e.config.secondaryAccentColors)||void 0===t?void 0:t.filter(Boolean).map(e=>({type:"solid",color:e})))||[]}),F=o()(e=>{var t;let{primaryColor:l,accentGradient:a}=e.config;return l||(a&&!a.disabled&&a.colors.length>=2?(0,h.z2)(a):{type:"solid",color:null!==(t=e.accentColor)&&void 0!==t?t:b})}),B=o()(e=>{let{shapeColors:t}=e.config;return t&&t.length>0?t:I(e).map(e=>({type:"solid",color:C(e)}))}),R=o()((e,t)=>{let l=B(e),a=C(O(e)),n=C(F(e)),o=(0,p.$p)(a),i=(0,p.VU)(a);return{type:"solid",color:"default"===t?(0,p.Zv)((0,p.Pf)(a,i>.25?-6:12),i>.5?15:0):"accent"===t?o?(0,p.PE)(n,.25):(0,p.PE)(n,.9):C(l[0])}}),_=o()((e,t,l)=>"none"===l&&"default"!==t?C(R(e,t)):(0,g.x)(C(R(e,t)))),M=o()(e=>{let{linkColor:t}=e.config;return t||{type:"solid",color:C(F(e))}}),E=o()(e=>{let{buttonColor:t}=e.config;return t||F(e)}),T=o()(e=>{let{bodyColor:t}=e.config;return t?"string"==typeof t?{type:"solid",color:t}:t:{type:"solid",color:A(e)?k:v}}),O=o()(e=>{let{cardBackground:t,cardColor:l,container:a}=e.config;if(l)return l;let n=(0,m.gK)(t||(null==a?void 0:a.background));return n?{type:"solid",color:n}:{type:"solid",color:(null==a?void 0:a.isDark)?"#0C0C0C":w}}),P=o()(e=>{let{config:t}=e,l=A(e);return"string"==typeof t.cardBorderColor?{type:"solid",color:t.cardBorderColor}:t.cardBorderColor?t.cardBorderColor:S(t)?{type:"solid",color:l?"rgba(230, 230, 230, 0.25)":"rgba(230, 230, 230, 0.75)"}:{type:"solid",color:l?"#565151":"#E5E0DF"}}),N=e=>C(O(e)),D=o()(e=>{let{headingColor:t,headingGradient:l}=e.config;return q(t)?t:l&&!l.disabled&&l.colors.length>=2?(0,h.z2)(l):"string"==typeof t?{type:"solid",color:t}:{type:"solid",color:A(e)?"#FFFFFF":y}}),L=o()(function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:x,a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return"linear-gradient"===e.type?(0,h.J5)(e,t,l,a):{type:"solid",color:(0,p.w8)(e.color,t,l,a)}}),W=o()((e,t,l)=>{let a=[...I(e),T(e),D(e),O(e),e.config.linkColor,e.config.buttonColor,..."custom"===e.config.shapeColorScheme&&e.config.shapeColors?e.config.shapeColors:[]].filter(t?K:q);return l?a:d()(a,U)}),U=o()(e=>"solid"===e.type?c()(e.color).toHexString():JSON.stringify(e)),G=(e,t)=>U(e)===U(t),H=o()(e=>"linear-gradient"===e.type?{background:(0,h.yh)(e)}:{backgroundColor:e.color});o()(e=>"linear-gradient"===e.type?{background:(0,h.yh)(e),backgroundClip:"text",caretColor:(0,h.i_)(e),color:"transparent"}:{color:e.color}),o()(e=>{var t;let{background:l}=e.config;return l?(null==l?void 0:l.type)==="color"&&l.color?{type:"solid",color:l.color.hex}:(null==l?void 0:l.type)==="image"&&l.image&&(null===(t=l.image.meta)||void 0===t?void 0:t.average_color)?{type:"solid",color:l.image.meta.average_color}:{type:"solid",color:f.Hp.color.hex}:{type:"solid",color:f.Hp.color.hex}});let V=o()(e=>"linear-gradient"===e.type?r()(e.stops,"position").map(e=>"".concat(c()(e.color).toHexString().toUpperCase()," ").concat(e.position,"%")).join(", "):c()(e.color).toHexString().toUpperCase()),q=e=>"object"==typeof e&&"type"in e,K=e=>q(e)&&"solid"===e.type},28997:(e,t,l)=>{"use strict";l.d(t,{M:()=>o,X:()=>i});var a=l(26813),n=l(40197);let o=e=>{let{themeBase:t}=e.config;if(!t){var l,o;t=(null==e?void 0:null===(l=e.config.container)||void 0===l?void 0:l.effect)===a.t.FROSTED||(null==e?void 0:null===(o=e.config.container)||void 0===o?void 0:o.effect)===a.t.FADED?"glass":"default"}let i=t?n.SB[t]:void 0;return{...n.AG,...i,...e.config}},i=e=>e?e.config.logoImage?e.config.logoImage.src||null:e.logoUrl||null:null},34185:(e,t,l)=>{"use strict";l.d(t,{N:()=>o});var a=l(12327);let n=()=>a.Ru._({id:"rzKWuu"}),o=()=>({id:"new",name:n(),archived:!1,priority:0,config:{},fonts:[]})},27569:(e,t,l)=>{"use strict";l.d(t,{Hs:()=>r,Kn:()=>n,vt:()=>i}),l(82354);var a=l(40197);let n=(e,t)=>{var l;return null!==(l=e["body"===t?"bodyFontWeight":"headingFontWeight"])&&void 0!==l?l:a.mI[t]},o=e=>e&&["adonis-web","p22-mackinac-pro"].includes(e),i=function(e,t){var l;let a=!(arguments.length>2)||void 0===arguments[2]||arguments[2];return a&&o(t)?t:null==e?void 0:null===(l=e.find(e=>e&&e.id===t))||void 0===l?void 0:l.name},r=e=>{let{fontsMap:t,bodyFontId:l,headingFontId:n}=e,o=t[a.z8.headingFont],i=t[a.z8.bodyFont],r=t[l]||i,s=t[n]||o;return[{id:r.id,name:r.name,url:r.cssUrl},{id:s.id,name:s.name,url:s.cssUrl}]}},33919:(e,t,l)=>{"use strict";l.d(t,{Hh:()=>c,J5:()=>d,i_:()=>u,nz:()=>m,yh:()=>s,z2:()=>f});var a=l(2940),n=l.n(a),o=l(40074),i=l.n(o),r=l(42391);let s=n()(e=>{if(!e||"linear-gradient"!==e.type)return;let t=i()(e.stops,"position");return"linear-gradient(".concat(e.angle,"deg, ").concat(t.map(e=>"".concat(e.color," ").concat(e.position,"%")),")")}),d=n()((e,t,l,a)=>{if(a&&e.stops.some(e=>!(0,r.a6)(e.color,t,l))){let l=(0,r.$p)(t)?"#FFFFFF":"#000000";return{...e,stops:[{color:l,position:0},{color:l,position:100}]}}let n=e.stops.map(e=>({color:(0,r.w8)(e.color,t,l,a),position:e.position}));return{...e,stops:n}}),u=n()(e=>{if(e.fallbackColor)return e.fallbackColor;let t=i()(e.stops,"position");for(let e=0;e=50){if(50===l.position)return l.color;if(50===a.position)return a.color;let e=(50-l.position)/(a.position-l.position);return(0,r.sN)(l.color,a.color,e)}}return t[t.length-1].color}),c=(e,t)=>{if(!e)return;let l=e.stops.map(e=>({color:(0,r.PE)(e.color,t),position:e.position}));return{...e,stops:l}},m=(e,t,l)=>{if(!e)return;let a=e.stops.map(e=>({color:(0,r.sN)(e.color,t,l),position:e.position}));return{...e,stops:a}},f=e=>{var t;return{type:"linear-gradient",stops:e.colors.map((t,l)=>({color:t||"#888888",position:(10+80*l)/(e.colors.length-1)})),angle:null!==(t=e.angle)&&void 0!==t?t:135}}},90854:(e,t,l)=>{"use strict";l.d(t,{_1:()=>a,xI:()=>n}),l(11081),l(26813);let a=(e,t)=>{let l=RegExp(RegExp("\\p{Emoji_Presentation}"),"gu"),a=e.name.replace(l,"").trim(),n=t.name.replace(l,"").trim();return(e.workspaceId||t.workspaceId?0:t.priority-e.priority)||a.localeCompare(n,"en-US",{ignorePunctuation:!0})},n=e=>{if(e.config.stylePrompt)return e.config.stylePrompt;let t=e.config.keywords;if(!t)return;let l=t.color.slice(0,6).join(" "),a=t.tone.slice(0,6).join(" ");return"".concat(l,", ").concat(a)}},37068:(e,t,l)=>{"use strict";l.d(t,{C:()=>pg});var a=l(83683),n=l(28396),o=l(73893),i=l(47687),r=l(13236),s=l(37864),d=l(11329),u=l(58599),c=l(29362),m=l(31085),f=l(80532),p=l(57284);let g=e=>(0,m.jsx)(p.u,{...e,children:(0,m.jsxs)(f.az,{position:"relative","data-selection-ring":"padded",children:[(0,m.jsx)(u.$p,{as:"blockquote"}),(0,m.jsx)(f.az,{position:"absolute",left:"0",top:"0",height:"100%",w:"var(--line-thickness)",backgroundColor:"var(--accent-color)",backgroundImage:"var(--accent-gradient)"})]})}),h=s.Ay.extend({group:"cardBlock layoutBlock footnoteBlock tableBlock smartLayoutBlock",content:"(block | calloutBlock)+",addNodeView:()=>(0,u.gu)(g,{update:c.z0}),addCommands(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),unwrapQuoteOnDelete:()=>e=>{let{state:t,tr:l}=e,{selection:a}=t;if(!a.empty)return!1;let n=(0,r.KP)(e=>e.type.name===h.name)(a);if(!n||!(a.from<=n.pos+2))return!1;let o=a.$from.blockRange(a.$to);if(!o)return!1;let i=(0,d.jP)(o);return!!i&&(l.lift(o,i),!0)}}}});var b=l(43504);let y=/(?:^|\s)((?:\*)((?:[^*]+))(?:\*))$/,v=/(?:^|\s)((?:\*\*)((?:[^*]+))(?:\*\*))$/,k=b.Ay.extend({addInputRules(){return[(0,r.OX)({find:y,type:this.type}),(0,r.OX)({find:v,type:this.type})]},renderHTML(e){let{HTMLAttributes:t}=e;return["b",(0,r.KV)(this.options.HTMLAttributes,t),0]}});var w=l(20169),x=l(31060),S=l(23231);let A=r.bP.create({name:"buttonGroup",content:"button{1, ".concat(S.r4,"}"),group:"block",allowGapCursor:!1,addNodeView:()=>(0,u.gu)(x.r,{update:c.R$}),parseHTML:()=>[{tag:"div[class=button-group]"},{tag:"buttons"}],renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,r.KV)(t,{class:"button-group"}),0]},renderHTMLforAI(e){let{node:t}=e;return["buttons",{},0]}});var C=l(62313),z=l(61778),I=l(81313),j=l(24221),F=l(14041),B=l(41900),R=l(1771),_=l(42391),M=l(4381),E=l(91725),T=l(98057),O=l(93765),P=l(63955),N=l(75185),D=l(16262);let L=e=>{let{node:t,editor:l,getPos:a,decorations:n}=e,{variant:o,icon:i,color:r}=t.attrs,{firstChildSize:s}=(0,T.P)(n),{theme:d,isDark:c}=(0,M.a)(n),g=(0,O.bh)(s,d),h=(0,R.Ik)((0,R.VH)(d)),{colorScheme:b,icon:y}=(0,D.Tg)(o),{backgroundColor:v,iconColor:k,bodyColor:w}=r?W(r):U(c,b,h),x=(0,F.useCallback)(()=>{l.isEditable&&l.commands.selectNodeAtPos(a())},[l,a]);return(0,m.jsx)(p.u,{...e,children:(0,m.jsxs)(f.az,{backgroundColor:"".concat(v," !important"),pt:"0.25em",pb:"0.5em",px:"1em",className:"calloutBox",borderRadius:"var(--box-border-radius)",css:{"--body-color":w,"--heading-color":w},"data-selection-ring":!0,pos:"relative",children:[(0,m.jsxs)(C.z,{direction:"row",align:s?"baseline":"flex-start",spacing:"1em",children:[i&&(0,m.jsx)(z.E,{sx:g,onClick:x,color:k,mt:s?void 0:"1em",contentEditable:!1,children:(0,m.jsx)(j.g,{icon:y,fixedWidth:!0})}),(0,m.jsx)(u.$p,{style:{flex:"1 1 auto",minWidth:0},className:(0,I.cx)(B.Dv)})]}),(0,m.jsx)(E.A,{...e})]})})},W=e=>{let t=(0,_.$p)(e),l=t?(0,_.PE)(e,.7):(0,_.PE)(e,.3);return{backgroundColor:e,bodyColor:t?"white":"black",iconColor:l}},U=(e,t,l)=>{let a=e?(0,_.PE)("accent"===t?l:P.hr.dark[t].hex,.15):(0,_.PE)("accent"===t?l:P.hr.light[t].hex,.85),n=e?"accent"===t?(0,_.PE)(l,.7):N.qd.dark[t].hex:"accent"===t?(0,_.PE)(l,.3):N.qd.light[t].hex;return{backgroundColor:a,bodyColor:e?"white":"black",iconColor:n}},G=r.bP.create({name:"calloutBox",group:"cardBlock layoutBlock footnoteBlock smartLayoutBlock",content:"(block | calloutBlock)+",selectable:!0,isolating:!0,containerHandle:!0,addAttributes:()=>({variant:{default:"note"},icon:{default:!0},color:{}}),addNodeView:()=>(0,u.gu)(L,{update:c.z0}),parseHTML:()=>[{tag:"aside"}],renderHTML(e){let{HTMLAttributes:t}=e;return["aside",(0,r.KV)(t,{class:"calloutBox"}),0]}});var H=l(5377),V=l(81570),q=l(45214),K=l(952),J=l(88957),$=l(77646),Q=l(11081),Y=l(95580),X=l(26884),Z=l(43873),ee=l(90406),et=l(69646),el=l(42849),ea=l(14139),en=l(20379);let eo=!1;var ei=l(14250),er=l(82354),es=l(61690),ed=l(74727),eu=l(80853),ec=l(20501),em=l(52177),ef=l(12327),ep=l(15072),eg=l(50923),eh=l(55090),eb=l(70605),ey=l(44018),ev=l(61077),ek=l(51183),ew=l(24008);let ex=(0,F.memo)(e=>{let{decorations:t,editor:l,getPos:a,node:n}=e,o=(0,eg.st)(),i=(0,J.jL)(),{cardId:r,isPresentMode:s,isEditable:d,isMobileDevice:u}=(0,ew.f)(e),{title:c,text:g}=(0,ep.d)({editor:l,node:n,cardId:r}),{previewContent:h}=e.node.attrs,b=""===h,y=null==c?void 0:c.replaceAll(ey.n,e=>''.concat(e,"")),v=(0,J.GV)(es.SJ),k=(0,O.bh)("h4",v),w=(0,ek.A3)(t),x=(0,F.useCallback)(e=>{e.stopPropagation(),s&&!d?(i((0,es.mF)({attached:!1})),l.commands.descendIntoCurrentCard(a(),"push"),null==o||o.track(eh.VV.CARD_EXPANDED,{is_present_mode:!0,method:"click"})):((0,et.wE)(r,!1),setTimeout(()=>{if(!d||l.isDestroyed)return;let e=a();l.commands.selectInsideNodeAtPos(e)},50),null==o||o.track(eh.VV.CARD_EXPANDED,{is_present_mode:!1,method:"click"}))},[r,s,d,i,l,a,o]),S=b||!(null==g?void 0:g.trim());return(0,m.jsxs)(p.u,{...e,children:[(0,m.jsx)(E.A,{...e,"data-testid":"card-drag-handle",handlePlacement:"outside"}),(0,m.jsxs)(f.az,{mb:"0.25em",position:"relative",contentEditable:!1,userSelect:"none",role:"group","data-card-id":r,"data-export-as-image":!0,children:[(0,m.jsxs)(ed.e,{position:"absolute",insetInlineEnd:"0.75em",top:"0.75em","data-print-hidden":!0,variant:"unstyled",colorScheme:"gray",fontFamily:"Inter, sans-serif","data-thumbnail-hidden":!0,children:[d&&(0,m.jsx)(eS,{hidePreview:b,...e}),(0,m.jsx)(eA,{onClick:x})]}),(0,m.jsxs)(f.az,{cursor:"pointer",className:(0,I.cx)(er.QJ,"card-collapsed",w&&"expandable-selected"),_groupHover:eb.uQ,...eb.zQ,paddingX:u?"1em":"1.5em",paddingY:"1em",onClick:x,"data-collapsed-card":!0,"data-selection-ring":!0,"data-selection-background":!0,"data-content-reference":!0,sx:{backgroundColor:"var(--clickable-background-color)",boxShadow:"var(--card-border-shadow, 0px 0px 0px 1px var(--neutral-border-color)), var(--card-box-shadow, var(--clickable-shadow))",borderRadius:"calc(var(--card-border-radius) / 2)","@media print":{boxShadow:"none",border:"var(--card-border, 1px solid var(--neutral-border-color))"}},children:[(0,m.jsx)(z.E,{sx:k,noOfLines:1,marginInlineEnd:"1.75em",mb:"0.375em",className:(0,I.cx)(B.U6),children:y?(0,m.jsx)(z.E,{as:"span",dangerouslySetInnerHTML:{__html:ev.W.sanitize(y)}}):c||(0,m.jsx)(z.E,{as:"span",color:"gray.400",children:(0,m.jsx)(em.x6,{id:"gLDJuJ"})})}),(0,m.jsxs)(C.z,{color:"var(--body-color-muted)",children:[(0,m.jsx)(z.E,{noOfLines:1,fontFamily:S?"Inter, sans-serif":void 0,fontSize:"0.9em",children:S?(0,m.jsx)(em.x6,{id:"4m3nxQ"}):g}),b&&(0,m.jsx)(j.g,{icon:ec.Jt$,size:"sm"})]})]})]})]})});ex.displayName="CollapsedCard";let eS=e=>{let{hidePreview:t,updateAttributes:l}=e,a=(0,J.GV)(es.cS),n=(0,F.useCallback)(e=>{l&&(l({previewContent:t?null:""}),e.stopPropagation())},[l,t]);return(0,m.jsx)(eu.$,{opacity:0,zIndex:a?0:1,transitionProperty:"opacity",transitionDuration:"normal",_groupHover:{opacity:1},sx:eb.Up,fontSize:"0.7em",onClick:n,className:eb.Gx,children:t?(0,m.jsx)(em.x6,{id:"fsyAH8"}):(0,m.jsx)(em.x6,{id:"Po0vX/"})})},eA=e=>{let{onClick:t}=e,l=(0,J.GV)(es.cS);return(0,m.jsxs)(eu.$,{"aria-label":ef.Ru._({id:"JjrOSL"}),className:eb.Gx,onClick:t,sx:eb.Up,zIndex:l?0:1,fontSize:"0.7em","data-testid":"expand-card-button",children:[(0,m.jsx)(j.g,{icon:ec.vQu,fontSize:"0.9em"}),(0,m.jsx)(z.E,{as:"span",_groupHover:{opacity:1,display:"inline"},opacity:"0",display:"none",marginInlineStart:2,children:(0,m.jsx)(em.x6,{id:"1A3EXy"})})]})};var eC=l(2600),ez=l(18201),eI=l(95986),ej=l(65998),eF=l(63152),eB=l(15576);let eR=(0,F.createContext)(void 0);eR.Provider;let e_=()=>(0,F.useContext)(eR);var eM=l(16372);let eE=e=>{let{editorId:t,children:l}=e,a=(0,eB.l)(),n=e_();return(0,eM.b)(t||n)&&a?l:null};var eT=l(4468);let eO={presentBg:1,customerLogo:4,cardButtons:11,nestedCardBody:2,nestedCardBodyWithComment:3,cardDivider:1};var eP=l(87643),eN=l(25420),eD=l(36832);class eL extends eD.b{initialize(){this.on("cardViewed",e=>{let{cardId:t,interval:l}=e;this.viewedCards[t]=this.viewedCards[t]||0,this.viewedCards[t]+=l});let e=()=>{var e;this.cardViewedThreshold=null!==(e=ej.of.get("cardViewedThreshold"))&&void 0!==e?e:5e3};ej.of.subscribe("cardViewedThreshold",e),e()}flush(){let e={};for(let t in this.viewedCards){let l=this.viewedCards[t];l&&!(l{let{cardId:t,...l}=e,[a,n]=(0,F.useState)(0),[o,i]=(0,F.useState)(!1),[r,s]=(0,F.useState)(0);return(0,F.useEffect)(()=>{let e=eW.on("cardViewed",e=>{let{cardId:l,interval:a}=e;t===l&&n(e=>e+a)}),l=eW.on("flush",e=>{let{viewed:l}=e;n(0),l[t]&&(i(!0),s(l[t]),setTimeout(()=>i(!1),2e3))});return()=>{e(),l()}},[t]),(0,m.jsxs)(f.az,{...l,bg:o?"#c3313a":"#f5ae00",children:[!o&&(0,m.jsxs)(f.az,{children:["time on card: ",Math.floor(a/1e3),"s"]}),o&&(0,m.jsxs)(f.az,{children:["Tracked View: ",r,"s"]})]})},eG=e=>{let t=(0,J.GV)(ej.Gm),{getPos:l,node:a}=e,{id:n}=a.attrs;return t?(0,m.jsxs)(eN.s,{left:8,top:2,zIndex:"overlay",position:"absolute",pointerEvents:"none",opacity:.5,contentEditable:!1,children:[(0,m.jsx)(f.az,{bg:"yellow",px:2,mr:2,borderRadius:"md",children:n}),(0,m.jsxs)(f.az,{bg:"trueblue.200",px:2,mr:2,borderRadius:"md",children:["f:",l()," t:",l()+a.nodeSize]}),(0,m.jsx)(eU,{cardId:n,px:2,borderRadius:"md"})]}):null};var eH=l(11718),eV=l(31201),eq=l(19098),eK=l(64444),eJ=l(40173),e$=l(93185),eQ=l(32202),eY=l(3706),eX=l(35687),eZ=l(70323),e0=l(28478),e1=l(67965),e2=l(70338),e6=l(48226),e4=l(9335),e5=l(26813),e3=l(59707),e8=l(86186),e7=l(21696),e9=l(9021);let te=[{key:"start",name:()=>ef.Ru._({id:"Xl2IZ9"}),icon:ec.jot,description:()=>ef.Ru._({id:"N0rIpR"})},{key:"center",name:()=>ef.Ru._({id:"7FOGnf"}),icon:ec.nr0,description:()=>ef.Ru._({id:"3JV7Yt"})},{key:"end",name:()=>ef.Ru._({id:"H0UcZG"}),icon:ec.yHR,description:()=>ef.Ru._({id:"LcSMtc"})}],tt=e=>{let{defaultAlignment:t,alignment:l,setAlignment:a}=e;return(0,m.jsx)(ed.e,{isAttached:!0,size:"sm",display:"flex",children:te.map(e=>{let n=l||e.key!==t?e.key===l?"trueblue.100":void 0:"trueblue.50";return(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(eI.c8,{label:e.name(),description:e.description()}),placement:"top",children:(0,m.jsx)(e9.K,{"aria-label":e.name(),px:"2.5",boxShadow:"none",icon:(0,m.jsx)(j.g,{icon:e.icon}),variant:"plain",bg:n,onClick:()=>{a(e.key)}})},e.key)})})};var tl=l(5366),ta=l(29383);let tn=e=>{let{icon:t,label:l,children:a,...n}=e;return(0,m.jsxs)(eX.B,{direction:"row",spacing:4,alignItems:"center",...n,children:[(0,m.jsx)(j.g,{fixedWidth:!0,icon:t}),(0,m.jsx)(z.E,{children:l}),(0,m.jsx)(ez.h,{}),a]})},to=e=>{let{editor:t,accentPos:l,cardId:a,hasAccentImage:n,isBehindLayout:o}=e,i=(0,F.useCallback)(()=>{l&&t.commands.updateAttributesAtPos(l,{background:{type:e5.h.NONE}})},[t,l]),r=(0,F.useCallback)(()=>{ta.R.emit("toggleEditBackgroundDrawer",{openDrawer:!0,cardId:a})},[a]);return(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(tn,{label:o?(0,m.jsx)(em.x6,{id:"23c2Uw"}):(0,m.jsx)(em.x6,{id:"e5Sy/T"}),icon:ec.Cyq,children:(0,m.jsx)(C.z,{spacing:1,children:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(eu.$,{size:"sm",variant:"link",onClick:r,colorScheme:"trueblue",children:n?(0,m.jsx)(em.x6,{id:"ePK91l"}):(0,m.jsx)(em.x6,{id:"PNapeY"})}),n&&(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(em.x6,{id:"sGYCGx"}),placement:"top",children:(0,m.jsx)(e9.K,{"aria-label":ef.Ru._({id:"sGYCGx"}),size:"sm",variant:"link",onClick:i,colorScheme:"red",icon:(0,m.jsx)(j.g,{icon:ec.K3F})})})]})})})})},ti=e=>{let{editor:t,getPos:l,onAddOrEditClick:a,isDisabled:n,hasBackdrop:o}=e,i=(0,F.useCallback)(()=>{t.commands.updateAttributesAtPos(l(),{background:{type:e5.h.NONE}})},[t,l]);return(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(tn,{icon:ec.pt,label:(0,m.jsx)(em.x6,{id:"ANn8Qe"}),color:n?"gray.500":void 0,children:[n&&(0,m.jsx)(eI.Tz,{placement:"top",label:(0,m.jsx)(em.x6,{id:"ZnOCf5"}),isDisabled:!n,children:(0,m.jsx)(j.g,{fixedWidth:!0,icon:ec.k6j})}),(0,m.jsx)(C.z,{spacing:1,children:!n&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(eu.$,{size:"sm",variant:"link",onClick:a,colorScheme:"trueblue",children:o?(0,m.jsx)(em.x6,{id:"ePK91l"}):(0,m.jsx)(em.x6,{id:"PNapeY"})}),o&&(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(em.x6,{id:"IfZ6hd"}),placement:"top",children:(0,m.jsx)(e9.K,{"aria-label":ef.Ru._({id:"IfZ6hd"}),size:"sm",variant:"link",onClick:i,colorScheme:"red",icon:(0,m.jsx)(j.g,{icon:ec.K3F})})})]})})]})})};var tr=l(63341),ts=l(18528),td=l(72821),tu=l(48310),tc=l(33473),tm=l(2219),tf=l(15672),tp=l(55037),tg=l(43909),th=l(76228),tb=l(38684),ty=l(17539);let tv=e=>{let{label:t,onClick:l,isChecked:a,cardBackground:n,isDark:o=!1,...i}=e,r=(0,tb.FD)(n,o,ty.p7);return(0,m.jsxs)(eu.$,{borderRadius:"md",display:"block",height:"auto",variant:"ghost",color:"black",onClick:l,p:1,...i,children:[(0,m.jsxs)(eN.s,{borderWidth:"1px",borderColor:"gray.200",sx:r,p:2,backgroundAttachment:"unset",_focus:{boxShadow:"outline"},overflow:"hidden",position:"relative",direction:"column",align:"center",justify:"center",height:"80px",children:[(0,m.jsx)(tl.TH,{background:n}),(0,m.jsx)(f.az,{position:"relative",p:2,zIndex:0,transitionProperty:"inset",transitionDuration:"normal",width:"100%",overflow:"hidden",color:"var(--body-color)",children:(0,m.jsx)(tk,{})})]}),(0,m.jsxs)(eN.s,{align:"center",mt:1,children:[a&&(0,m.jsx)(th.S,{w:3,mr:1}),(0,m.jsx)(z.E,{fontSize:"sm",fontWeight:"medium",children:t})]})]})},tk=()=>{let e="currentColor";return(0,m.jsxs)(eX.B,{spacing:1,h:"28px",position:"relative",zIndex:1,children:[(0,m.jsx)(f.az,{h:"6px",w:"50%",bg:e,borderRadius:"sm"}),(0,m.jsx)(f.az,{h:"3px",w:"100%",bg:e,borderRadius:"sm"}),(0,m.jsx)(f.az,{h:"3px",w:"100%",bg:e,borderRadius:"sm"}),(0,m.jsx)(f.az,{h:"3px",w:"30%",bg:e,borderRadius:"sm"})]})},tw=[{label:()=>ef.Ru._({id:"37VL/A"}),value:"frosted"},{label:()=>ef.Ru._({id:"W4wYdx"}),value:"faded"},{label:()=>ef.Ru._({id:"siC4v8"}),value:"none"}],tx=e=>{let{background:t,container:l,updateAttributes:a}=e,n={...tl.$,...t.mask},o=(0,J.GV)(es.SJ),i=(0,tg.NC)(o,l),r=(0,tp.ZI)(o,i);return(0,m.jsx)(eC.T,{spacing:4,w:"100%",align:"stretch",css:r,children:(0,m.jsxs)(eC.T,{spacing:2,align:"stretch",children:[(0,m.jsx)(tm.D,{size:"md",children:(0,m.jsx)(em.x6,{id:"OXOTHU"})}),(0,m.jsx)(tf.r,{columns:2,spacing:2,children:tw.map(e=>{var l;let{label:o,value:r}=e,s={...t,mask:{...n,effect:r}};return(0,m.jsx)(tv,{onClick:()=>{a({background:s})},label:o(),isChecked:(null===(l=t.mask)||void 0===l?void 0:l.effect)===r,cardBackground:s,cardColor:i},r)})})]})})},tS=e=>{var t,l;let{editor:a,accentPos:n,accentBackground:o,effect:i}=e,r=(0,F.useCallback)(e=>{if(!n||!o)return;let t={background:{mask:{...o.mask,effect:e}}};a.commands.updateNestedAttributesAtPos(n,t)},[a,o,n]),s=null!=i?i:tl.$.effect,d=null!==(l=null===(t=tw.find(e=>e.value===i))||void 0===t?void 0:t.label())&&void 0!==l?l:(0,m.jsx)(em.x6,{id:"xg0y9o"});return(0,m.jsx)(tn,{label:(0,m.jsx)(em.x6,{id:"u4YODQ"}),icon:ec.B2J,children:(0,m.jsxs)(tr.W,{isLazy:!0,children:[(0,m.jsx)(ts.I,{as:eu.$,variant:"plain",size:"sm",minW:"128px",boxShadow:"none",textAlign:"left",rightIcon:(0,m.jsx)(eH.D,{}),children:d}),(0,m.jsx)(td.c,{children:(0,m.jsx)(tu.i,{value:s,type:"radio",onChange:r,children:tw.map(e=>{let{value:t,label:l}=e;return(0,m.jsx)(tc.k,{value:t,children:l()},t)})})})]})})};var tA=l(31549),tC=l(49624);let tz=e=>{var t;let{editor:l,attrs:a,getPos:n}=e,o=(0,J.GV)(es.SJ);return{currentColor:(0,tb.gK)(null===(t=a.container)||void 0===t?void 0:t.background),themeCardColor:(0,R.Oq)(o),setCardColor:e=>{let{container:t}=a,o=e?{background:{type:e5.h.COLOR,color:{hex:e}}}:{background:void 0};void 0!==t.isDark&&(o.isDark=void 0),l.commands.updateNestedAttributesAtPos(n(),{container:{...t,...o}})}}},tI=e=>{let{editor:t,attrs:l,getPos:a}=e,{setCardColor:n,currentColor:o,themeCardColor:i}=tz({editor:t,attrs:l,getPos:a});return(0,m.jsx)(tn,{icon:ec.wIs,label:"behind"===l.layout?(0,m.jsx)(em.x6,{id:"cA3hQ0"}):(0,m.jsx)(em.x6,{id:"9d2iLQ"}),children:(0,m.jsxs)(tr.W,{isLazy:!0,children:[(0,m.jsx)(tA.v,{color:null!=o?o:i,isDefaultColor:void 0===o}),(0,m.jsx)(td.c,{overflow:"hidden",children:(0,m.jsx)(tC.b,{currentColor:null!=o?o:i,setColor:n,source:"CardColor"})})]})})},tj=[{key:"sm",name:()=>ef.Ru._({id:"58+81B"}),buttonText:()=>ef.Ru._({id:"ZQA8ce"}),description:()=>ef.Ru._({id:"LX+k3Q"})},{key:"md",name:()=>ef.Ru._({id:"ovBPCi"}),buttonText:()=>ef.Ru._({id:"Tmu3kA"}),description:()=>ef.Ru._({id:"Of2q2s"})},{key:"lg",name:()=>ef.Ru._({id:"I5S9ZE"}),buttonText:()=>ef.Ru._({id:"SMwD6s"}),description:()=>ef.Ru._({id:"nRirkB"})}],tF=e=>{let{contentWidth:t,defaultContentWidth:l,setWidth:a,allowedWidths:n=["sm","md","lg"]}=e;return(0,m.jsx)(ed.e,{isAttached:!0,size:"sm",display:"flex",children:tj.filter(e=>n.includes(e.key)).map(e=>{let n=t||e.key!==l?e.key===t?"trueblue.100":void 0:"trueblue.50";return(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(eI.c8,{label:e.name(),description:e.description()}),placement:"top",children:(0,m.jsx)(eu.$,{"aria-label":e.name(),px:"2.5",boxShadow:"none",variant:"plain",bg:n,onClick:()=>{a(e.key)},children:e.buttonText()})},e.key)})})},tB=e=>{let{editor:t,getPos:l,contentWidth:a}=e,{defaultContentWidth:n}=(0,J.GV)(es.Uu),o=(0,F.useCallback)(e=>{t.commands.updateNestedAttributesAtPos(l(),{container:{width:e}})},[t,l]);return(0,m.jsx)(tn,{icon:ec.So7,label:(0,m.jsx)(em.x6,{id:"cPp+Ef"}),children:(0,m.jsx)(tF,{setWidth:o,contentWidth:a,defaultContentWidth:n,allowedWidths:["md","lg"]})})};var tR=l(59835);let t_=e=>{let{editor:t,getPos:l,isFullWidth:a}=e,n=(0,F.useCallback)(()=>{t.commands.updateAttributesAtPos(l(),{cardSize:a?"contained":"full"})},[t,l,a]);return(0,m.jsx)(tn,{icon:ec.Cpz,label:(0,m.jsx)(em.x6,{id:"BquNv8"}),children:(0,m.jsx)(tR.d,{isChecked:a,onChange:n})})};var tM=l(49964),tE=l(10458),tT=l(50933),tO=l.n(tT);let tP=()=>{let e=(0,J.GV)(es.SJ);return(0,F.useCallback)(()=>tO()(e.config.accentBackgrounds),[e])},tN=(e,t)=>{let l=tP(),a=(0,tE.st)();return(0,F.useCallback)(n=>{"blank"===n?e.commands.setCardLayout(t,n):e.commands.setCardLayout(t,n,l),null==a||a.track(tE.VV.CARD_LAYOUT_UPDATED,{source:"card-styling-menu",layout:n})},[e,t,l,a])},tD=["blank","top","left","right","behind"],tL=e=>{let{layout:t,editor:l,getPos:a,edgeLayoutsEnabled:n}=e,o=tN(l,a()),i=tD.filter(e=>n||["blank","behind"].includes(e));return(0,m.jsx)(ed.e,{mb:2,dir:"ltr",children:i.map(e=>{let l=(0,tM.Nu)(e);return(0,m.jsx)(eI.Tz,{label:l,placement:"top",children:(0,m.jsx)(e9.K,{"aria-label":l,flex:1,variant:"plain",size:"md",onClick:()=>o(e),icon:(0,m.jsx)(tW,{layout:e,isSelected:t===e}),boxShadow:"none",background:t===e?"trueblue.50":"white"})},e)})})},tW=e=>{let{layout:t,isSelected:l}=e,a=l?"trueblue.400":"gray.300",n=null;return"top"===t?n=(0,m.jsx)(f.az,{height:"0.375rem",width:"100%",background:a}):"left"===t?n=(0,m.jsxs)(eN.s,{height:"100%",minH:"100%",children:[(0,m.jsx)(f.az,{width:"0.625rem",minH:"100%",background:a}),(0,m.jsx)(f.az,{flex:"1",minH:"100%"})]}):"right"===t&&(n=(0,m.jsxs)(eN.s,{height:"100%",minH:"100%",children:[(0,m.jsx)(f.az,{flex:"1",minH:"100%"}),(0,m.jsx)(f.az,{width:"0.625rem",minH:"100%",background:a})]})),(0,m.jsx)(f.az,{boxSizing:"border-box",height:"1.25rem",width:"1.75rem",border:"2px solid",borderRadius:"sm",borderColor:a,background:"behind"===t?a:"none",children:n})};var tU=l(85452),tG=l(24293),tH=l(33023),tV=l(14608),tq=l(59742),tK=l(9746),tJ=l(65446),t$=l(34363),tQ=l(18658),tY=l(92515),tX=l(57812),tZ=l(19727),t0=l(71792),t1=l(96502),t2=l(90290),t6=l(69648),t4=l(46511),t5=l(48192),t3=l(62216),t8=l(73818),t7=l(77914),t9=l(91559),le=l(62911),lt=l(8077);let ll=e=>{if(!e.source&&e.type===e5.h.IMAGE){var t;return null===(t=e.image)||void 0===t?void 0:t.source}return e.source},la=(0,F.memo)(e=>{let{editor:t,defaultMessage:l,isDark:a,setCurrentSourceKey:n,currentSourceKey:o,currentSource:i,updateCurrentBackground:r,currentBackground:s,isValidSource:d,editType:u="background",contextualTheme:c}=e,{isConnected:p}=(0,t9.u)(),g=(0,F.useCallback)(e=>{let t=t3.Fn[e];t.backgroundType&&r({type:t.backgroundType,source:e,[t.backgroundType]:void 0})},[r]),h=(0,F.useCallback)(()=>g(o),[o,g]),b=(0,F.useCallback)(e=>{e===t3.dO&&g(t3.dO),n(e)},[n,g]),y=ll(s);(0,F.useEffect)(()=>{y&&t3.Fn[y]&&n(y)},[y,n]);let v=!!(p||(null==i?void 0:i.availableOffline)),k=t3.ez[o],w="themeBackground"===u?t7.rWX.Theme:t7.rWX.Doc;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(le.r,{isConnected:v,description:(0,m.jsx)(em.x6,{id:"nfjtFu"}),mb:3,my:6}),(0,m.jsx)(lt.H,{isValidSource:d,onChange:b,currentSource:i}),i&&(0,m.jsx)(f.az,{opacity:v?1:.4,pointerEvents:v?"initial":"none",children:(0,m.jsx)(k,{editor:t,updateAttributes:e=>{i.backgroundType&&(i.key===t5.j?r(e):r({type:i.backgroundType,[i.backgroundType]:{...e},source:o}))},currentAttributes:(e=>i.backgroundType?i.key===t5.j?e:e[i.backgroundType]||{}:{})(s),resetToPlaceholder:h,editType:u,isDark:a,contextualTheme:c,savedMediaContext:w})}),o===t3.dO&&l]})});la.displayName="BackgroundPanel";let ln=e=>!!e.backgroundType,lo=e=>{let{editor:t,updateNestedAttributes:l,background:a,defaultMessage:n,isDark:o,isValidSource:i}=e,{currentEditBackgroundDrawerSourceKey:r,setBackgroundDrawerSourceKeyAction:s}=(0,t8.Bz)(),d=t3.Fn[r],u=(0,F.useCallback)(e=>{d.key===t5.j?l({background:e}):l({background:{...e,accentId:void 0}})},[null==d?void 0:d.key,l]),c=(0,F.useCallback)(e=>i?i(e)&&ln(e):ln(e),[i]);return(0,m.jsx)(la,{editor:t,isDark:o,isValidSource:c,defaultMessage:n,currentBackground:a,updateCurrentBackground:u,currentSourceKey:r,setCurrentSourceKey:s,currentSource:d})};var li=l(36830),lr=l(94984);let ls=()=>{let{isOpen:e,onOpen:t,onClose:l}=(0,tH.j)(),[a,n]=(0,F.useState)(0),o=(0,F.useCallback)(e=>{t(),n(e)},[t]),i=(0,J.jL)();return{openBackgroundTab:(0,F.useCallback)(function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];e&&i((0,lr.lj)()),o(0)},[i,o]),openStylesTab:(0,F.useCallback)(()=>{o(1)},[o]),isOpen:e,onClose:l,tabIndex:a,setTabIndex:n}},ld=(0,F.memo)(function(e){let{editor:t,isOpen:l,onClose:a,background:n,container:o,updateNestedAttributes:i,tabIndex:r,setTabIndex:s,isAccentImageDrawer:d=!1,enableMask:u=!1}=e,c=(0,li.N)(t),p=(0,F.useCallback)(()=>{0!==r&&s(0),a()},[a,r,s]),g=(0,t4.o)(),h=u&&(0,tl.dY)(n),b=d?tG.lK.accentImage():tG.lK.cardBackground(),y=(0,F.useCallback)(e=>!d||e.backgroundType!==e5.h.NONE,[d]);return(0,m.jsxs)(tV._,{trapFocus:!1,isOpen:l,placement:"right",onClose:p,size:g,blockScrollOnMount:!1,children:[(0,m.jsx)(tq.m,{background:"none"}),(0,m.jsxs)(tK.z,{onKeyDown:c,"data-in-editor-focus":!0,"data-edit-background-drawer":!0,"data-testid":"card-style-drawer",children:[(0,m.jsx)(tJ.s,{}),(0,m.jsx)(t$.r,{children:(0,m.jsx)(em.x6,{id:"xYilR2"})}),(0,m.jsx)(tQ.c,{overflowX:"hidden",sx:{scrollbarGutter:"stable both-edges"},children:(0,m.jsxs)(tY.t,{variant:"soft-rounded",size:"sm",isFitted:!0,isLazy:!0,index:r,onChange:s,children:[h&&(0,m.jsxs)(tX.w,{children:[(0,m.jsxs)(tZ.o,{children:[(0,m.jsx)(f.az,{me:2,children:(0,m.jsx)(j.g,{icon:ec.wIs})}),(0,m.jsx)(em.x6,{id:"GtJbUa"})]}),(0,m.jsxs)(tZ.o,{children:[(0,m.jsx)(f.az,{me:2,children:(0,m.jsx)(j.g,{icon:ec.pS3})}),(0,m.jsx)(em.x6,{id:"9LBB6c"})]})]}),(0,m.jsxs)(t0.T,{children:[(0,m.jsx)(t1.K,{p:0,pb:1,mt:h?4:0,children:(0,m.jsx)(lo,{editor:t,updateNestedAttributes:i,background:n,defaultMessage:(0,m.jsxs)(t2.F,{children:[(0,m.jsx)(t6._,{}),b]}),isDark:!1,isValidSource:y})}),h&&(0,m.jsx)(t1.K,{p:0,pb:1,mt:4,children:(0,m.jsx)(tx,{updateAttributes:i,background:n,container:o})})]})]})})]})]})}),lu=(0,F.memo)(e=>{var t,l;let{editor:a,getPos:n,attrs:o,accentBackgroundMaskEffect:i,displayLayout:r,insideSideLayout:s,isNested:d,isFullBleed:u,contentWidth:c,cardDimensionsKey:f,editBackdrop:p}=e,g=(0,J.jL)(),h=(0,F.useCallback)(()=>{g((0,tU.md)())},[g]),{verticalAlign:b,presentBackdrop:y}=(0,J.GV)(es.Uu),{setBackgroundDrawerSourceKeyAction:v}=(0,e7.B)(),k={};try{k=(0,el.l0)(a.state.doc.resolve(n()))}catch(e){console.error("[CardStylingMenuInner] could not get layout items for card ".concat(o.id,": ").concat(e))}let w=(0,eQ.d)(),x=(null===(t=k.accent)||void 0===t?void 0:t.pos)||null,S=null===(l=k.accent)||void 0===l?void 0:l.node.attrs.background,A=S&&S.type!==e5.h.NONE,I="none"!==o.background.type,B="default"!==o.cardSize||I||A||o.container.width||o.container.background||"blank"!==r||o.verticalAlign,R="behind"===r&&A&&(0,tl.dY)(S),_="fluid"===f||c,M="fluid"===f||I||y,E=(0,F.useCallback)(()=>{let e={};I&&(e.background={type:e5.h.NONE,source:void 0}),e.cardSize=void 0,e.verticalAlign=void 0,e.container={...o.container,width:void 0},o.container.background&&(e.container={...o.container,background:void 0}),"blank"!==r&&(e.layout="blank"),x?a.chain().updateAttributesAtPos(n(),e).updateNestedAttributesAtPos(x,{background:{type:e5.h.NONE}}).run():a.commands.updateAttributesAtPos(n(),e);let t=ef.Ru._({id:"rQHMjX"}),l=ef.Ru._({id:"9uI/rE"}),i=w({title:(0,m.jsxs)(C.z,{children:[(0,m.jsx)(z.E,{children:t}),(0,m.jsx)(eY.N,{textDecoration:"underline",onClick:()=>{(0,e1.tN)(a.state),w.close(i)},children:l})]}),status:"info",duration:3e3,position:"top"})},[I,o.container,r,x,a,n,w]);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(eX.B,{spacing:4,p:4,children:[(0,m.jsx)(tL,{editor:a,layout:r,getPos:n,edgeLayoutsEnabled:!s}),"blank"!==r&&(0,m.jsx)(to,{editor:a,accentPos:x,cardId:o.id,hasAccentImage:!!A,isBehindLayout:"behind"===r}),R&&(0,m.jsx)(tS,{editor:a,accentBackground:S,accentPos:x,effect:i}),(0,m.jsx)(tI,{editor:a,attrs:o,getPos:n}),!d&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(eZ.c,{my:"1"}),(0,m.jsx)(t_,{editor:a,getPos:n,isFullWidth:u}),(0,m.jsx)(tn,{icon:ec.ecg,label:(0,m.jsx)(em.x6,{id:"vUBA/H"}),children:(0,m.jsx)(tt,{defaultAlignment:b,alignment:o.verticalAlign,setAlignment:e=>{a.commands.updateAttributesAtPos(n(),{verticalAlign:e})}})}),_&&(0,m.jsx)(tB,{editor:a,getPos:n,contentWidth:c}),M&&(0,m.jsx)(ti,{editor:a,getPos:n,onAddOrEditClick:()=>{v(e2.L),p(!1)},hasBackdrop:I,isDisabled:u})]})]}),(0,m.jsxs)(e0.B,{px:5,py:3,bg:"gray.100",mx:-1,mb:-1,justify:B?"space-between":"center",alignItems:"center",borderBottomRadius:"xl",children:[B&&(0,m.jsx)(e0.Q,{children:(0,m.jsx)(eu.$,{onClick:E,variant:"link",size:"sm",colorScheme:"gray",my:0,leftIcon:(0,m.jsx)(j.g,{icon:ec.ub2}),children:(0,m.jsx)(em.x6,{id:"6hU6uw"})})}),(0,m.jsx)(e0.Q,{children:(0,m.jsx)(eu.$,{onClick:()=>{h(),e4.LF.emit(e4.DN.OPEN_PAGE_SETUP,"cards")},variant:"link",size:"sm",colorScheme:"gray",my:0,leftIcon:(0,m.jsx)(j.g,{icon:ec.BH7}),children:(0,m.jsx)(em.x6,{id:"fvaOtb"})})})]})]})}),lc=(0,F.memo)(e=>{let{attrs:t,editor:l,getPos:a}=e,{color:n,bg:o,hoverColor:i,hoverBg:r,borderColor:s}=(0,e8.Nb)(),d=(0,F.useRef)(null),u=(0,J.GV)((0,tU.C_)(t.id,"styling")),c=(0,J.jL)(),f=(0,F.useCallback)(()=>{c((0,tU.md)())},[c]),p=(0,F.useCallback)(()=>{c((0,tU.CM)({cardId:t.id,menuType:"styling"}))},[c,null==t?void 0:t.id]),{openBackgroundTab:g,...h}=ls(),b=(0,F.useCallback)(e=>{(0,e6.e)(l,a(),e)},[l,a]);return(0,eV.j)({ref:d,handler:e=>{if(!u)return;let l=e.target;if(l&&l instanceof Element){var a;let e=l.closest('[data-card-styles-menu-trigger="'.concat(t.id,'"]')),n=!!(null===(a=l.closest(".chakra-modal__content-container"))||void 0===a?void 0:a.querySelector("[data-edit-background-drawer]")),o=!!l.closest("[data-media-drawer-menu]");if(e||n||o)return}f()}}),(0,m.jsxs)(eI.L8,{isDark:!1,children:[(0,m.jsx)(C.z,{spacing:1,onClick:e3.dG,contentEditable:!1,pointerEvents:"auto",children:(0,m.jsxs)(eq.A,{isLazy:!0,returnFocusOnClose:!1,isOpen:u,onClose:f,closeOnBlur:!1,children:[(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(em.x6,{id:"F153E+"}),placement:"top",shouldWrapChildren:!0,children:(0,m.jsx)(eK.W,{children:(0,m.jsxs)(eu.$,{"data-card-styles-menu-trigger":t.id,height:tG.PN,fontWeight:"900",alignItems:"center",fontFamily:"Inter, sans-serif",display:"flex",backdropFilter:"blur(8px)",borderRadius:"sm",borderColor:s,color:n,boxShadow:"sm",cursor:"pointer",fontSize:"14px",bg:o,px:.5,_hover:{color:i,background:r},onClick:p,children:[(0,m.jsx)(j.g,{icon:ec.fyG,fixedWidth:!0}),(0,m.jsx)(eH.D,{})]})})}),(0,m.jsx)(eJ.Z,{children:(0,m.jsx)(e$.h,{"data-card-styles-menu":!0,ref:d,minWidth:"320px",width:"fit-content",maxWidth:"min(360px, 80vw)",fontFamily:"Inter, sans-serif",fontSize:"md",border:"none",children:(0,m.jsx)(lu,{...e,editBackdrop:g})})})]})}),(0,m.jsx)(ld,{editor:l,updateNestedAttributes:b,background:t.background,container:t.container,...h})]})});var lm=l(48637),lf=l(76166),lp=l(35436),lg=l(33683),lh=l(12917),lb=l(3040),ly=l(55576);let lv=new eD.b;var lk=l(18588),lw=l(57238),lx=l(49547),lS=l(22218),lA=l(82680),lC=l(40074),lz=l.n(lC),lI=l(42948);l(3478),l(31242),(()=>{let e=null;return async t=>{let a=t;t||(console.warn("[i18n] Unexpected empty locale"),a=lI.jA),e=a;try{let t=await l(492)("./".concat(a,"/messages"));a===e&&(ef.Ru.load(a,t.messages),ef.Ru.activate(a))}catch(e){console.error("[i18n] Error loading locale messages:",e.message)}}})();var lj=l(27042),lF=l(86724),lB=l(14691);l(68973);var lR=l(67238);let l_=(e,t)=>{let l=(0,lR.H)(),a=(0,lR._Y)();return e||t||(a?l:lI.jA)},lM=()=>{let e=(0,J.KA)();return l_((0,lj.uy)(e.getState()),(0,lF.o)(lB.E.gammaLocale,void 0))},lE=[{key:"en",englishName:"English (US)",displayName:"English (US)"},{key:"en-gb",englishName:"English (UK)",displayName:"English (UK)"},{key:"en-in",englishName:"English (India)",displayName:"English (India)"},{key:"es",englishName:"Spanish",displayName:"Espa\xf1ol"},{key:"es-es",englishName:"Spanish (Spain)",displayName:"Espa\xf1ol (Espa\xf1a)"},{key:"es-mx",englishName:"Spanish (Mexico)",displayName:"Espa\xf1ol (M\xe9xico)"},{key:"es-419",englishName:"Spanish (Latin America)",displayName:"Espa\xf1ol (Latinoam\xe9rica)"},{key:"ca",englishName:"Catalan",displayName:"Catal\xe0"},{key:"fr",englishName:"French",displayName:"Fran\xe7ais"},{key:"zh-cn",englishName:"Simplified Chinese",displayName:"简体中文"},{key:"zh-tw",englishName:"Traditional Chinese",displayName:"繁體中文"},{key:"ko",englishName:"Korean",displayName:"한국어"},{key:"ja",englishName:"Japanese (です/ます style)",displayName:"日本語 (です/ます体)"},{key:"ja-da",englishName:"Japanese (だ/である style)",displayName:"日本語 (だ/である体)"},{key:"pt-br",englishName:"Portuguese (Brazil)",displayName:"Portugu\xeas (Brasil)"},{key:"pt-pt",englishName:"Portuguese (Portugal)",displayName:"Portugu\xeas (Portugal)"},{key:"de",englishName:"German",displayName:"Deutsch"},{key:"it",englishName:"Italian",displayName:"Italiano"},{key:"ru",englishName:"Russian",displayName:"Русский"},{key:"pl",englishName:"Polish",displayName:"Polski"},{key:"uk",englishName:"Ukrainian",displayName:"Українська"},{key:"ro",englishName:"Romanian",displayName:"Rom\xe2nă"},{key:"hu",englishName:"Hungarian",displayName:"Magyar"},{key:"cs",englishName:"Czech",displayName:"Čeština"},{key:"el",englishName:"Greek",displayName:"Ελληνικά"},{key:"tr",englishName:"Turkish",displayName:"T\xfcrk\xe7e"},{key:"ar",englishName:"Arabic",displayName:"العربية"},{key:"ar-sa",englishName:"Arabic (Saudi Arabia)",displayName:"العربية (السعودية)"},{key:"he",englishName:"Hebrew",displayName:"עברית"},{key:"fa",englishName:"Persian",displayName:"فارسی"},{key:"nl",englishName:"Dutch",displayName:"Nederlands"},{key:"sv",englishName:"Swedish",displayName:"Svenska"},{key:"da",englishName:"Danish",displayName:"Dansk"},{key:"nb",englishName:"Norwegian",displayName:"Norsk"},{key:"fi",englishName:"Finnish",displayName:"Suomi"},{key:"id",englishName:"Indonesian",displayName:"Bahasa Indonesia"},{key:"vi",englishName:"Vietnamese",displayName:"Tiếng Việt"},{key:"hi",englishName:"Hindi",displayName:"हिन्दी"},{key:"gu",englishName:"Gujarati",displayName:"ગુજરાતી"},{key:"mr",englishName:"Marathi",displayName:"मराठी"},{key:"te",englishName:"Telugu",displayName:"తెలుగు"},{key:"bn",englishName:"Bengali",displayName:"বাংলা"},{key:"ta",englishName:"Tamil",displayName:"தமிழ்"},{key:"ur",englishName:"Urdu",displayName:"اردو"},{key:"kn",englishName:"Kannada",displayName:"ಕನ್ನಡ"},{key:"ml",englishName:"Malayalam",displayName:"മലയാളം"},{key:"th",englishName:"Thai",displayName:"ภาษาไทย"},{key:"sr",englishName:"Serbian",displayName:"Српски"},{key:"hr",englishName:"Croatian",displayName:"Hrvatski"},{key:"sq",englishName:"Albanian",displayName:"Shqip"},{key:"bg",englishName:"Bulgarian",displayName:"Български"},{key:"sl",englishName:"Slovenian",displayName:"Slovenščina"},{key:"bs",englishName:"Bosnian",displayName:"Bosanski"},{key:"mk",englishName:"Macedonian",displayName:"Македонски"},{key:"sw",englishName:"Swahili",displayName:"Kiswahili"},{key:"ha",englishName:"Hausa",displayName:"Hausa"},{key:"yo",englishName:"Yoruba",displayName:"Yor\xf9b\xe1"},{key:"tl",englishName:"Tagalog",displayName:"Tagalog"},{key:"ms",englishName:"Malay",displayName:"Bahasa Melayu"},{key:"kk",englishName:"Kazakh",displayName:"Қазақ тілі"},{key:"uz",englishName:"Uzbek",displayName:"O'zbek tili"},{key:"af",englishName:"Afrikaans",displayName:"Afrikaans"},{key:"lv",englishName:"Latvian",displayName:"Latviešu"},{key:"lt",englishName:"Lithuanian",displayName:"Lietuvių"},{key:"et",englishName:"Estonian",displayName:"Eesti"},{key:"is",englishName:"Icelandic",displayName:"\xcdslenska"},{key:"cy",englishName:"Welsh",displayName:"Cymraeg"}],lT=e=>{let t=null==e?void 0:e.toLowerCase();return lE.find(e=>e.key.toLowerCase()===t)||null},lO=e=>{let t=lT(e);if(t)return t;let l=lI.tF[e],a=l&&lT(l);if(a)return a;let[n]=e?e.toLowerCase().split("-"):[];return n&&lT(n)||null},lP=e=>{let t=lO(e);if(t)return t;let l=lD(e);return l?l:lO(lM())||lN},lN={key:"en",englishName:"English (US)",displayName:"English (US)"},lD=e=>{let t=lM();try{let l=new Intl.DisplayNames([t],{type:"language",fallback:"none"}),a=new Intl.DisplayNames(["en"],{type:"language",fallback:"none"}).of(e),n=l.of(e);if(!a||!n)return null;return{key:e.toLowerCase(),englishName:a,displayName:n}}catch(e){return null}},lL=lz()(lE,e=>e.displayName),lW=()=>{let e=(0,F.useMemo)(()=>{var e;let t=navigator.language.toLowerCase(),l=t.split("-")[0],a=null!==(e=lE.find(e=>e.key===t))&&void 0!==e?e:lE.find(e=>e.key===l);return null==a?void 0:a.key},[]),[t,l]=(0,lF.M)(lB.E.generateLanguage,null!=e?e:"en");return[(0,F.useMemo)(()=>{var e;return null!==(e=lE.find(e=>e.key===t))&&void 0!==e?e:lE[0]},[t]),l]},lU=(0,F.memo)(e=>{let{locale:t,setLocale:l,buttonProps:a}=e,[n,o]=(0,F.useState)([]);(0,F.useEffect)(()=>{o(e=>{if(lE.find(e=>e.key===t.key))return e;let l=[...e];return l.find(e=>e.key===t.key)||l.push(t),l})},[t.key]);let i=(0,F.useMemo)(()=>[...n,...lL],[n]);return(0,m.jsxs)(tr.W,{children:[(0,m.jsx)(ts.I,{as:eu.$,size:"sm",boxShadow:"sm",variant:"ghost",rightIcon:(0,m.jsx)(j.g,{size:"xs",icon:ec.Jt$}),leftIcon:(0,m.jsx)(j.g,{size:"xs",icon:lb.mh}),minW:"150px",...a,children:t.displayName}),(0,m.jsx)(eJ.Z,{children:(0,m.jsx)(td.c,{minWidth:"240px",maxH:"290px",overflowY:"auto",overflowX:"hidden",zIndex:"tooltip",children:(0,m.jsx)(tu.i,{value:t.key,title:ef.Ru._({id:"vXIe7J"}),type:"radio",onChange:e=>{l(e)},children:i.map(e=>(0,m.jsx)(tc.k,{value:e.key,children:e.displayName},e.key))})})})]})});lU.displayName="AILocalePicker";var lG=l(39286);let lH=e=>{let{isAdminView:t=!1,isFullDoc:l,isSite:a,onClose:n,startTranslation:o}=e,[i]=lW(),[r,s]=(0,F.useState)(i);return(0,m.jsx)(eI.L8,{isDark:!1,children:(0,m.jsxs)(lk.aF,{isOpen:!0,onClose:n,children:[(0,m.jsx)(tq.m,{}),(0,m.jsxs)(lw.$,{children:[(0,m.jsx)(t$.r,{children:(0,m.jsx)(eN.s,{alignItems:"center",mr:8,children:a?(0,m.jsx)(em.x6,{id:"56Urwv"}):l?(0,m.jsx)(em.x6,{id:"e2vVXR",values:{GAMMA_ARTIFACT_PROPER_NOUN:lG.TP}}):(0,m.jsx)(em.x6,{id:"DLQ7Yc"})})}),(0,m.jsx)(tJ.s,{}),(0,m.jsxs)(tQ.c,{children:[(0,m.jsx)(z.E,{mb:4,children:a?(0,m.jsx)(em.x6,{id:"dZwNdR"}):l?(0,m.jsx)(em.x6,{id:"6YnROT",values:{GAMMA_ARTIFACT_PROPER_NOUN:lG.TP}}):(0,m.jsx)(em.x6,{id:"WQFlqR"})}),(0,m.jsxs)(lx.MJ,{children:[(0,m.jsx)(lS.l,{children:(0,m.jsx)(z.E,{fontSize:"14px",children:(0,m.jsx)(em.x6,{id:"3LIgcv"})})}),(0,m.jsx)(lU,{buttonProps:{variant:"plain",justifyContent:"flex-start",textAlign:"left",width:"100%"},locale:r,setLocale:e=>{s(lP(e))}})]}),t&&(0,m.jsx)(eN.s,{mt:4,children:(0,m.jsxs)(t2.F,{status:"warning",children:[(0,m.jsx)(t6._,{}),"You're using the translation feature as an admin in the PUBLIC_STATIC editor. Translations made here will not be persisted to the database and are intended for admin review process only."]})})]}),(0,m.jsx)(lA.j,{children:(0,m.jsxs)(ed.e,{children:[(0,m.jsx)(eu.$,{variant:"ghost",colorScheme:"gray",onClick:n,color:t?{color:"orange.500"}:void 0,_hover:t?{bg:"orange.100"}:void 0,children:(0,m.jsx)(em.x6,{id:"dEgA5A"})}),(0,m.jsx)(eu.$,{variant:"solid",bg:t?"orange.500":void 0,_hover:{bg:t?"orange.700":void 0},onClick:()=>o(r),children:(0,m.jsx)(em.x6,{id:"pi8x/S"})})]})})]})]})})};var lV=l(15355),lq=l(71197),lK=l(47538),lJ=l(35147),l$=l(87809),lQ=l.n(l$);let lY=[{key:"rephrase.better",label:()=>ef.Ru._({id:"WLqWVj"}),instructions:"Improve the writing",icon:ec.xXs,group:"writing",loadingMessage:()=>ef.Ru._({id:"OxbbYn"}),variationName:()=>ef.Ru._({id:"5j51A1"}),completionMessage:()=>ef.Ru._({id:"EF1nyz"})},{key:"edit.spelling",label:()=>ef.Ru._({id:"kIRRvo"}),instructions:"Fix spelling & grammar",icon:ec.e68,group:"writing",loadingMessage:()=>ef.Ru._({id:"vLjsO9"}),variationName:()=>ef.Ru._({id:"MRZxAn"}),completionMessage:()=>ef.Ru._({id:"3G04Qf"})},{key:"edit.translate",label:()=>ef.Ru._({id:"pi8x/S"}),instructions:"",icon:ec.mh,group:"writing",loadingMessage:()=>ef.Ru._({id:"aKSJTV"}),variationName:()=>ef.Ru._({id:"a/ppJp"}),completionMessage:()=>ef.Ru._({id:"a/ppJp"})},{key:"rephrase.expand",label:()=>ef.Ru._({id:"rRLXT4"}),instructions:"Make this longer",icon:ec.ckx,group:"writing",loadingMessage:()=>ef.Ru._({id:"Q+x/E4"}),variationName:()=>ef.Ru._({id:"pvJgUJ"}),completionMessage:()=>ef.Ru._({id:"jgdqxQ"})},{key:"rephrase.condense",label:()=>ef.Ru._({id:"xTY2A5"}),instructions:"Make this more concise. Dont change the layout or images, only change the writing within the existing template.",icon:ec.Nby,group:"writing",loadingMessage:()=>ef.Ru._({id:"BjuYlr"}),variationName:()=>ef.Ru._({id:"Q7U9iz"}),completionMessage:()=>ef.Ru._({id:"l7sxzR"})},{key:"rephrase.simplify",label:()=>ef.Ru._({id:"Lx/Sd1"}),instructions:"Simplify the language",icon:ec.vq5,group:"writing",loadingMessage:()=>ef.Ru._({id:"AAhoH1"}),variationName:()=>ef.Ru._({id:"nvmoB1"}),completionMessage:()=>ef.Ru._({id:"5xpG46"})},{key:"rephrase.specifics",label:()=>ef.Ru._({id:"u6rs0A"}),instructions:"Rewrite this to be more specific. Use the previous text and the outline for context. If you don't have enough details, make them up.",icon:ec.g0Y,group:"writing",loadingMessage:()=>ef.Ru._({id:"HW6L/y"}),variationName:()=>ef.Ru._({id:"PRHEO1"}),completionMessage:()=>ef.Ru._({id:"dib9YI"})},{key:"rephrase.bullets",label:()=>ef.Ru._({id:"5bPd7Z"}),instructions:"Rewrite this information in a bullet format, using UL/OL/LI tags not the BULLETS block. Do not remove or add any new information.",template:"bullets",icon:ec.ITF,group:"writing",loadingMessage:()=>ef.Ru._({id:"+cj1qu"}),variationName:()=>ef.Ru._({id:"RYtHky"})},{key:"rephrase.sections",label:()=>ef.Ru._({id:"5J92Ft"}),instructions:"Break this information into multiple parts with different headings. Make sure each heading describes the content below it. Do not remove or add any new information, and try to preserve other formatting and images.",icon:ec.AmE,group:"writing",loadingMessage:()=>ef.Ru._({id:"+cj1qu"}),variationName:()=>ef.Ru._({id:"R4OWFD"})},{key:"rephrase.summary",label:()=>ef.Ru._({id:"t+4LyJ"}),instructions:"Understand the content of the slide and place a summary at the start of the slide that captures key points for the user to grasp on a high level. The content of the summary should be concise and must not come close to or exceed the level of content of the rest of the slide. The summary should be placed in a blockquote element.",icon:ec.R9H,group:"writing",loadingMessage:()=>ef.Ru._({id:"3NNCjl"}),variationName:()=>ef.Ru._({id:"3eR5HO"})},{key:"layout.different",label:()=>ef.Ru._({id:"gyYxFM"}),instructions:"I dont like this template. Try a different layout or visualization. You can rephrase the text to fit a new template, but don't alter the original voice or make up new details.",icon:ec.i7d,group:"layout",loadingMessage:()=>ef.Ru._({id:"cEGrM6"}),variationName:()=>ef.Ru._({id:"kLEOtI"})},{key:"layout.visual",label:()=>ef.Ru._({id:"gcHjj/"}),instructions:"I want to make this content more visual. Make up new images to illustrate the concepts. You can rephrase the text to fit the new template, but don't alter the original voice or make up new details",template:"imagesWithText",icon:ec.Si7,group:"layout",loadingMessage:()=>ef.Ru._({id:"hMtOFm"}),variationName:()=>ef.Ru._({id:"p0QPRq"})},{key:"layout.addImage",label:()=>ef.Ru._({id:"LfOSf5"}),instructions:"Make up a new image to illustrate the concepts. If there is already a primary image or a placeholder, keep it. Regardless, add a new image using an image-layout or COLUMNS. Keep the rest of my content and formatting the same. Don't change layout blocks or make up new details. Do not remove any of the text!",icon:ec.Cyq,group:"layout",loadingMessage:()=>ef.Ru._({id:"hMtOFm"}),variationName:()=>ef.Ru._({id:"2ap0Xm"})},{key:"layout.replaceImage",label:()=>ef.Ru._({id:"LJrP+M"}),instructions:"Remove all existing images and add a new image for each removed image that matches the content of the card. You can rephrase the text to fit the new template, but don't alter the original voice or make up new details. Do not remove any of the text!",icon:ec.yvG,group:"layout",loadingMessage:()=>ef.Ru._({id:"hMtOFm"}),variationName:()=>ef.Ru._({id:"KH0ZqR"})},{key:"layout.timeline",label:()=>ef.Ru._({id:"UrX5Wc"}),instructions:"Reformat this as a timeline",template:"timeline",icon:ec.v6v,group:"layout",loadingMessage:()=>ef.Ru._({id:"+tf05m"}),variationName:()=>ef.Ru._({id:"cklVjM"})}],lX=lQ()(lY,"group"),lZ=[{key:"writing",label:()=>ef.Ru._({id:"4kJRen"})},{key:"layout",label:()=>ef.Ru._({id:"rdU729"})}];var l0=l(69e3),l1=l(14452),l2=l(63587),l6=l(87116),l4=l(87064),l5=l(7292),l3=l.n(l5),l8=l(39850),l7=l.n(l8),l9=l(20221),ae=l(18784),at=l(11576),al=l(99742),aa=l(387),an=l(86671);let ao={generate:(0,al.d_)("0123456789abcdefghijklmnopqrstuvwxyz",15)},ai=new V.hs("UniqueCardId"),ar=e=>{let t=e=>{var l;return null===(l=e.content)||void 0===l?void 0:l.map(e=>{if(!e.content||e.type!==er.Qs)return e;let l={...e,attrs:{...e.attrs,id:ao.generate()}};return l.content=t(l),l})};return Object.assign({},e,{content:t(e)})},as=an.S.extend({name:"UniqueCardId"}).configure({attributeName:"id",initialValue:()=>ao.generate(),syncWithFilmstrip:()=>ej.of.get("transactionalFilmstrip"),filterTransaction:aa.kz,pluginKey:ai,transformPasted:(e,t,l)=>{let{types:a,initialValue:n,attributeName:o}=t,i={},r=e=>{let t=[];return e.forEach(e=>{if(e.isText){t.push(e);return}if(!a.includes(e.type.name)){t.push(e.copy(r(e.content)));return}let l=n(),s=e.type.create({...e.attrs,[o]:l},r(e.content),e.marks);e.type.name===er.Qs&&(i={...i,[e.attrs.id]:l}),t.push(s)}),l0.FK.from(t)},s=e=>{let t=[];return e.forEach(e=>{if(e.isText){t.push(e);return}if("cardMention"===e.type.name){let a=i[e.attrs.id];if(a){let n=e.type.create({...e.attrs,...a?{id:a}:{},docId:l});t.push(n)}else t.push(e);return}t.push(e.copy(s(e.content)))}),l0.FK.from(t)},d=s(r(e.content));return new l0.Ji(d,e.openStart,e.openEnd)}});var ad=l(65208),au=l(79893),ac=l(60490);let am=(e,t)=>ap(new af(e,null),t);class af{get type(){return this.jsonNode.type}get text(){return this.jsonNode.text}get content(){return this.jsonNode.content?this.jsonNode.content.map(e=>new af(e,this)):this.jsonNode.content}get attrs(){return this.jsonNode.attrs}set attrs(e){this.jsonNode.attrs=e}constructor(e,t){this.jsonNode=e,this.parent=t,this.__type="JSONContentNode"}}let ap=(e,t)=>{if(t(e),e.content)for(let l of e.content)ap(l,t)};var ag=l(92464),ah=l.n(ag);let ab=e=>ah()(e)(),ay=(e,t)=>{let l=Math.floor(ah()(t)()*e.length);return e[l]};var av=l(97391),ak=l(33587);let aw=["gridLayout","gallery","chart"],ax=["imagesText","pyramid","funnel","staircase","circleStats","barStats","semiCircle","circle","cycle","flower","ring"],aS=async(e,t)=>{var l,a;let n;let{cardIndex:o,imageOptions:i,docFormatKey:s,theme:d,loadImages:u}=t,c=await (0,ak.e)(e,{imageOptions:i,removeImagesFromLayouts:!0,loadImages:!1}),m=(0,r._w)(pg()),{content:f,dom:p}=(0,ad.S)(c,m),g=f.toJSON(),h=1===g.length&&"card"===g[0].type?(null===(l=g[0])||void 0===l?void 0:l.content)||[]:g,b=h.some(e=>"cardLayoutItem"===e.type),y=h.find(e=>"cardAccentLayoutItem"===e.type);if(b)(n=g[0]).attrs.layout&&!y&&(n.attrs.layout="blank"),n.attrs.id||(n.attrs.id=ao.generate());else{let e=null===(a=p.firstElementChild)||void 0===a?void 0:a.getAttribute("image-layout"),l=e&&tD.includes(e)?e:void 0,i=p.textContent?l7()(p.textContent).length:void 0;n=aj(h,{...t,cardIndex:o,docFormatKey:s,theme:d,cardLayout:l,wordCount:i})}return i&&"aiGenerated"===i.provider&&aA(n,m),u&&await az(n,m,{docId:"unknown",workspaceId:(0,ac.gx)(),...t.context}),aI(n),n},aA=(e,t)=>{am(e,e=>{if("text"===e.type)return;let l=l0.bP.fromJSON(t,{type:e.type,attrs:e.attrs}),a=(0,au.um)(l);if(!a||!a.loadImageParams)return;let{options:n}=a.loadImageParams;if(!n)return;let o=(0,l9.pH)("model"in n?n.model:void 0),i=aC(e),r=o.includes(i)?i:ae.X,s={...a.loadImageParams,options:{...a.loadImageParams.options,aspectRatio:r}};e.attrs=(0,au.wH)(l,{loadImageParams:s})})},aC=e=>{var t;let l=e.parent;if(!(null==l?void 0:l.attrs))return"square";if("smartLayoutCell"===e.type&&"imagesText"===l.attrs.variantKey)return"landscape";if("cardAccentLayoutItem"===e.type){let e=l.attrs.layout;if("left"===e||"right"===e)return"portrait";if("top"===e)return"landscape"}return"layoutCell"===l.type&&(null===(t=l.content)||void 0===t?void 0:t[0])===e?"portrait":"landscape"},az=async(e,t,l)=>{let a=[];am(e,async e=>{if("text"===e.type)return;let n=t.nodeFromJSON({type:e.type,attrs:e.attrs}),o=(0,au.um)(n);if(!o)return;let{loadImageStatus:i,loadImageId:r,loadImageParams:s}=o;if("queued"!==i||!s||!r)return;let d=(0,av.a)({loadImageId:r,loadImageParams:s,context:l}).then(t=>{e.attrs=(0,au.wH)(n,t)});a.push(d)}),await Promise.all(a)},aI=e=>{var t,l,a,n;let o=e.content.find(e=>"cardAccentLayoutItem"===e.type);if(!o)return;let i=o.attrs.background;if(!i)return;let r=null==i?void 0:null===(l=i.image)||void 0===l?void 0:null===(t=l.meta)||void 0===t?void 0:t.average_color,s=r&&(0,_.$p)(r);"behind"===e.attrs.layout&&(s||.5>ab(e.attrs.id))&&(null!==(n=(a=e.attrs).container)&&void 0!==n||(a.container={}),e.attrs.container.background={type:e5.h.COLOR,color:{hex:"#000000"}});let d=e.content.find(e=>"cardLayoutItem"===e.type);if(!d)return;let u=(d.content||[]).filter(e=>"paragraph"!==e.type||e.content);try{i.mask={effect:0===u.length?"none":"faded"}}catch(e){console.error("[caught] [fixBehindBackgroundMask]",e,"with accentBackground:",i)}},aj=(e,t)=>{var l,a;let n;let{cardIndex:o,docFormatKey:i,theme:r,cardLayout:s,cardDimensions:d}=t,u=ao.generate(),c=e.filter(e=>{var t,l;return"image"===e.type&&((null===(t=e.attrs)||void 0===t?void 0:t.src)||(null===(l=e.attrs)||void 0===l?void 0:l.loadImageStatus)==="queued")})||[],m=t.preserveLayouts||t.wordCount&&t.wordCount>("social"===i?50:120)||e.some(t=>{var l;return aw.includes(t.type)||"smartLayout"===t.type&&(null===(l=t.attrs)||void 0===l?void 0:l.variantKey)&&ax.includes(t.attrs.variantKey)||"smartLayout"===t.type&&t.content&&t.content.length>4||e.length>6}),f=c[0];f&&"blank"!==s?n={type:e5.h.IMAGE,image:f.attrs,source:f.attrs.source}:r&&(n=aM(r,u)),0===o&&("deck"===i||"document"===i)&&e.push({type:"contributors"}),e=e.flatMap(e=>aE(e,u));let p={};"deck"===i?p=aB({cardIndex:o,cardId:u,preventSideCardLayouts:m,cardLayout:s}):"document"===i?p=a_({cardIndex:o,cardId:u,preventSideCardLayouts:m,cardLayout:s}):"webpage"===i?p=aF({cardIndex:o,cardId:u,accentBackground:n,preventSideCardLayouts:m,cardLayout:s,theme:r}):"social"===i&&(p=aR({cardIndex:o,cardId:u,preventSideCardLayouts:m,cardLayout:s}));let g={container:{},layout:s||"blank",id:u,...p},h="blank"!==g.layout&&n?{type:"cardAccentLayoutItem",attrs:{itemId:"accent",background:n,fitType:"fill"}}:null;if(h||(g.layout="blank"),"left"===g.layout||"right"===g.layout||"social"===i){let t=!1;e.forEach(e=>{if("smartLayout"===e.type&&e.attrs){let l=e.attrs;t=!0,l.options.orientation="vertical",l.options.twoSided=!1}}),t&&(null==h?void 0:null===(a=h.attrs.background)||void 0===a?void 0:a.source)==="accent.theme"&&(g.layoutTemplateColumns="left"===g.layout?"25% 75%":"75% 25%")}if("top"===g.layout&&d&&!m){let{aspectRatio:e}=at.xs[d];e&&e<1&&(g.layoutTemplateRows="var(--top-accent-height-lg) auto")}let b={type:"cardLayoutItem",attrs:{itemId:"body"},content:e};return!f||"blank"===g.layout&&(null===(l=f.attrs)||void 0===l?void 0:l.src)||l3()(e,f),{type:"card",attrs:g,content:h?[h,b]:[b]}},aF=e=>{let{cardIndex:t,cardId:l,accentBackground:a,preventSideCardLayouts:n,theme:o,cardLayout:i}=e,r={},s=o?(0,R.CD)(o):[];if(i)r.layout=i;else if(0===t)r.layout=ay(["behind","right"],l);else if(.8>ab(l)){if(r.layout=n?"blank":ay(["left","right","behind","blank","blank"],l),n&&"blank"===r.layout&&s.length&&.25>ab(l)){let e=(0,R.Ik)(ay(s,l));r.container={background:{type:e5.h.COLOR,color:{hex:e}}}}}else if(s.length){let e=(0,R.Ik)(ay(s,l));r.cardSize="contained",r.background=ay([a,{type:e5.h.COLOR,color:{hex:e}}],l),r.layout="blank"}return r},aB=e=>{let{cardIndex:t,cardId:l,preventSideCardLayouts:a,cardLayout:n}=e,o={};return n?o.layout=n:0!==t||a?a?o.layout="blank":o.layout=ay(["left","left","right","right","top"],l):o.layout=ay(["left","right"],l),o},aR=e=>{let{cardId:t,preventSideCardLayouts:l,cardLayout:a}=e,n={};return a?n.layout=a:l?n.layout=ay(["behind","blank"],t):n.layout="top",n},a_=e=>{let{cardIndex:t,preventSideCardLayouts:l,cardId:a,cardLayout:n}=e,o={};return n?o.layout=n:0===t?(o.cardSize="full",o.layout="behind"):l?o.layout="blank":o.layout=ay(["blank","blank","blank","right","left"],a),o},aM=(e,t)=>{let l=ay(e.config.accentBackgrounds||[],t);if(l)return{...l,source:"accent.theme"}},aE=(e,t)=>{var l,a;if("smartLayout"!==e.type||!e.attrs||!e.content)return e;let n=e.attrs.variantKey;if("bullets"===n&&1===e.content.length&&(null===(l=e.content[0].content)||void 0===l?void 0:l.some(e=>"bullet"===e.type)))return e.content[0].content;if("numbers"===n){let l=null===(a=e.content)||void 0===a?void 0:a.map(e=>{var t;return null===(t=e.attrs)||void 0===t?void 0:t.label});(null==l?void 0:l.every(e=>e.endsWith("%")))&&(e.attrs.variantKey=ay(["barStats","circleStats"],t))}return"circle"===n&&(e.attrs.variantKey=ay(["circle","flower","ring","semiCircle"],t)),e.content.length>4&&(e.attrs.options.orientation="vertical"),e};l(31018);var aT=l(4977);let aO=async e=>{let{editor:t,loadImageId:l,newAttrs:a,node:n,theme:o,cardId:i}=e,s=(0,r.xe)(t.state.doc,e=>{let t=(0,au.um)(e);return!!t&&t.loadImageId===l})[0];if(!s){console.error("[AIStream] could not find image in editor with loadImageId=".concat(l,"}"));return}let d="cardAccentLayoutItem"===n.type.name&&"error"===a.loadImageStatus?{...s.node.attrs,background:aM(o,i)}:(0,au.wH)(s.node,a);t.chain().updateAttributesAtPos(s.pos,d).noUndo().run()},aP=async(e,t,l,a,n)=>{t.descendants((t,o)=>{var i;if(a&&on)return;let r=(0,au.um)(t);if(!r||"queued"!==r.loadImageStatus||!r.loadImageId||!r.loadImageParams)return;let{loadImageId:s,loadImageParams:d}=r,u=null===(i=(0,ac.bs)(e.gammaOrgId))||void 0===i?void 0:i.id;(0,av.a)({loadImageId:s,loadImageParams:d,context:{docId:e.gammaDocId,workspaceId:u}}).then(a=>{aO({editor:e,newAttrs:a,loadImageId:s,node:t,theme:l})})})},aN=new eD.b;var aD=l(19717),aL=l(90754),aW=l(78821),aU=l(90854),aG=l(22844),aH=l(32262);let aV=e=>{let t=e.getState(),l=(0,es.Ev)(t),a=(0,aG.ow)(t);return Object.keys(l.tree).map(e=>{var t;return null===(t=a[e])||void 0===t?void 0:t.title}).filter(e=>!!e).join("\n")};var aq=l(6157),aK=l(74109),aJ=l(58586),a$=l(92060),aQ=l(1712),aY=l(60948);let aX=(e,t)=>{if(!e.isEditable||!t.clipboardData)return!1;let l=t.clipboardData.getData("text/plain");if(!l||(0,aQ.tE)(l))return!1;let a=t.clipboardData.getData("text/html");if(null==a?void 0:a.includes("data-pm-slice"))return!1;let{state:n}=e;if(n.selection.$from.parent.type.spec.code){let t=n.tr.insertText(l);return e.view.dispatch(t),!0}let o=t.clipboardData.getData("vscode-editor-data"),i=o?JSON.parse(o):void 0,r=null==i?void 0:i.mode;if(!(!a||"markdown"===r||a0(l)))return!1;let{from:s,to:d}=n.selection;return t.preventDefault(),e.commands.insertMarkdownAt({from:s,to:d},l)},aZ=(e,t,l)=>{let a=aJ.xI.parse(e),{slice:n}=(0,ad.S)(a,t,l,!1);return n},a0=e=>{let t=e.match(/^```/gm);if(t&&t.length>1||e.match(/\[[^]+\]\(https?:\/\/\S+\)/gm)||e.match(/\[[^]+\]\(\/\S+\)/gm)||e.match(/^#{1,6}\s+\S+/gm))return!0;let l=e.match(/^\s*[\d-*].\s\S+/gm);return!!(l&&l.length>1||e.match(/^\s*-{3,}\s*$/gm))},a1=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a4;t&&(a$.A.prototype.escape=e=>e);let a=l.turndown(e);return t&&(a$.A.prototype.escape=a5),a},a2=(e,t,l,a,n)=>{try{let o=e.slice(t,l).content,i=(0,aY.t8)(o,e.type.schema),r=document.createElement("div");r.appendChild(i);let s=r.innerHTML;return a1(s,a,n)}catch(a){return console.error("[caught] rangeToMarkdown: ",t,l,e.nodeSize,a),""}},a6=(e,t)=>{try{return e.getAttribute(t)}catch(e){return null}},a4=new a$.A({headingStyle:"atx",bulletListMarker:"-",codeBlockStyle:"fenced",hr:"---"}).remove(["style"]).addRule("list",{filter:["ul","ol"],replacement:function(e,t){let l=t.parentNode;return((null==l?void 0:l.nodeName.match(/^(UL|OL)$/i))&&(e=" "+e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ")),(null==l?void 0:l.nodeName)==="LI"&&l.lastElementChild===t)?"\n"+e:"\n\n"+e+"\n\n"}}).addRule("listItem",{filter:"li",replacement:function(e,t,l){e=e.replace(/^\n+/,"").replace(/\n+$/,"\n").replace(/\n/gm,"\n ");let a=l.bulletListMarker||"-",n=a+" ",o=t.parentNode,i=a6(t,"indent");if(null!==i){let e=parseInt(i,10);!isNaN(e)&&e>0&&(n=" ".repeat(e)+n)}let r=a6(t,"variant");if(1===t.children.length&&t.children[0].nodeName.match(/^(UL|OL)$/i)&&t.textContent===t.children[0].textContent)n=" ";else if((null==o?void 0:o.nodeName)==="OL"){let e=o.getAttribute("start"),l=Array.prototype.indexOf.call(Array.prototype.filter.call(o.children,e=>"LI"===e.nodeName),t),i=e?Number(e)+l:l+1;n=n.replace(a,i+".")}else if("numbered"===r){let e=a6(t,"start")||1;n=n.replace(a,e+".")}return n+e+(t.nextSibling&&!/\n$/.test(e)?"\n":"")}}),a5=a$.A.prototype.escape,a3={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/Title-with-2-Column-Image-Left.a898abf9.svg",height:47,width:92,blurWidth:0,blurHeight:0},a8={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/Title-with-3-boxes.8a28c3c6.svg",height:49,width:91,blurWidth:0,blurHeight:0},a7={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/Title-with-3-images.172b44a3.svg",height:69,width:92,blurWidth:0,blurHeight:0},a9={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/Title-with-Bullets.066ad97e.svg",height:55,width:92,blurWidth:0,blurHeight:0},ne={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/Title-with-text.2a88d207.svg",height:45,width:92,blurWidth:0,blurHeight:0},nt={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/Title-with-timeline.5a8d1065.svg",height:63,width:91,blurWidth:0,blurHeight:0},nl=()=>[{name:ef.Ru._({id:"RYtHky"}),key:"bullets",image:a9},{name:ef.Ru._({id:"m2tQ9E"}),key:"paragraphs",image:ne},{name:ef.Ru._({id:"2abZdy"}),key:"twoColImage",image:a3},{name:ef.Ru._({id:"cklVjM"}),key:"timeline",image:nt},{name:ef.Ru._({id:"cDxTeG"}),key:"imagesWithText",image:a7},{name:ef.Ru._({id:"61H/21"}),key:"boxes",image:a8}],na=["bullets","paragraphs","twoColImage","sideImageWithText","timeline","imagesWithText","boxes","arrows","columns","pyramid","bigBullets","icons","chart"],nn={language:"English (US)",textAmount:"md",tone:"",audience:"",format:"deck",imageProvider:"aiGenerated"},no=e=>{var t,l;let{editor:a,getPos:n,theme:o,input:i,randomTemplate:s=!1}=e,{generate:d}=(0,l6.pt)("GenerateCard",{}),u=(0,J.GV)(es.Jo),c=u.organization.id,m=(0,J.GV)((0,lj.$E)(c)),[f,p]=(0,F.useState)(!1),g=(0,J.CU)(),h=(0,F.useCallback)(async e=>{if(!u||!u.organization)throw Error("Doc or organization not found");let{instructions:t="",template:l,input:a="",settings:n,interactionId:i}=e,r=performance.now(),s=aV(g),c={...nn,...n,editorMode:"structured",textMode:"generate",input:a,instructions:t,template:l,previous:e.context,outline:s,model:ej.of.get("generateDeckFastModel")},f=null==n?void 0:n.imageStyle;"aiGenerated"===c.imageProvider&&o&&(f=(0,aU.xI)(o));let p={interface:"add-card",interactionId:i,inputContent:a,inputMessage:t,inputData:{...n,template:l},product:(0,aW.A4)(u.organization),docId:u.id};(0,l4.rl)(p);let{promise:h}=d({workspaceId:m.id,variables:c,interactionId:i}),b=await h,y=await aS(b,{docFormatKey:c.format,loadImages:!1,theme:o,context:{workspaceId:m.id,docId:u.id,interactionId:i},imageOptions:{provider:c.imageProvider,generateStyle:f},preserveLayouts:!0});return(0,l4.Yh)({...p,outputContent:b,latency:performance.now()-r}),(0,aD.w)("generateCard",m,i),y},[d,u,o,g,m]),{template:b,settings:y}=i,v=lP(y.locale||(null==u?void 0:null===(l=u.docGenerateInput)||void 0===l?void 0:null===(t=l.settings)||void 0===t?void 0:t.locale)||"en");return{isGenerating:f,getContextAndGenerate:(0,F.useCallback)(async e=>{if(!a)return;let t=n(),l=a.view.state.doc.nodeAt(t);if(!l){console.error("[AICard] Cannot append card. Node unknown");return}let i=nr(a,t);p(!0);try{let n=(0,l4.$F)(),d=await h({input:e,template:b||(s?tO()(na):void 0),context:i,settings:{language:v.englishName},interactionId:n});d.attrs={...l.attrs,...d.attrs,container:{...l.attrs.container,...d.attrs.container},generatorInput:{...l.attrs.generatorInput,prompt:e,template:b,settings:y,status:"done",interactionId:n}};let u=(0,r.xe)(a.state.doc,e=>(0,$.jg)(e)&&e.attrs.id===l.attrs.id)[0];if(!u){console.warn("[useGenerateCard] Card not found. It may have been deleted while generating.");return}a.chain().insertContentAt({from:u.pos,to:u.pos+u.node.nodeSize},d).setMeta("isGenerateCard",!0).selectInsideCardBody(t).run();let c=l0.bP.fromJSON(a.state.schema,d);aP(a,c,o)}catch(e){console.error("[GenerateCard] Error generating card",e)}p(!1)},[a,n,h,b,s,v.englishName,y,o]),updateInput:(0,F.useCallback)(e=>{let t=n(),l=a.view.state.doc.nodeAt(t);(null==l?void 0:l.attrs.generatorInput)&&a.commands.updateNestedAttributesAtPos(t,{generatorInput:e})},[a,n]),locale:v}},ni=(e,t)=>{let{isInOfflineMode:l}=(0,t9.u)(),[a,n]=(0,F.useState)([]),[o,i]=(0,F.useState)("ready"),{generate:r}=(0,l6.pt)("SuggestCardTopics",{onStart(){i("generating"),n([])},onContent(e){n(e.split("\n").filter(Boolean))},onComplete(e){n(e.split("\n").filter(Boolean)),i("done")},onError(e){console.error("Error generating suggestions",e),i("error")},timeout:3e4}),s=(0,J.GV)(es.Jo),d=s.organization.id,u=(0,J.GV)((0,lj.$E)(d)),c=(0,aq.lI)(e),m=(0,aq.zK)(c),f=(0,J.CU)();return(0,F.useEffect)(()=>{if(!l&&t&&"ready"===o){let e=aV(f);e.trim().split("\n").length<3||r({variables:{outline:e,format:m},workspaceId:u.id})}},[o,r,l,t,f,m,s,u]),{suggestions:a,generateSuggestionsStatus:o}},nr=(e,t)=>{let l=a2(e.state.doc,Math.max(t-2e3,0),t),a=(0,aK.p9)(l).slice(-500);return(0,aK.$0)(a)},ns=()=>{let{generate:e}=(0,l6.pt)("EditCard",{}),{generate:t}=(0,l6.pt)("TranslateCard",{});return(0,F.useCallback)((l,a)=>(null==a?void 0:a.key)==="edit.translate"?t({...l,variables:{...l.variables,language:l.variables.request}}):e(l),[e,t])},nd=(e,t)=>({...e,layout:t.layout,layoutTemplateColumns:t.layout!==e.layout?t.layoutTemplateColumns:e.layoutTemplateColumns}),nu=e=>{let{editor:t,getPos:l,cardId:a}=e,n=ns(),o=(0,J.GV)(es.Jo),i=(0,J.GV)(es.SJ),r=(0,J.CU)(),s=(0,J.GV)((0,q.wQ)(a)),d=(0,aq.lI)(t),u=(0,aq.zK)(d),c=(0,F.useCallback)(async e=>{var t,l,s,d;let c=e.instructions?e.instructions:e.operation?e.operation.instructions:"",{previous:m,inputHtml:f,operation:p}=e;if(!o||!o.organization)throw Error("Doc or organization not found");let g=(null===(l=o.docGenerateInput)||void 0===l?void 0:null===(t=l.settings)||void 0===t?void 0:t.imageProvider)||ej.of.get("aiGeneratorDefaultImageProvider"),h=(0,l4.$F)(),b=performance.now(),y=aV(r),v={interface:"edit-card",interactionId:h,inputContent:f,inputMessage:c,inputData:{custom:!!p,operation:null==p?void 0:p.key,operationGroup:null==p?void 0:p.group,format:u,imageProvider:g},product:(0,aW.A4)(o.organization),docId:o.id,cardId:a},k=(0,ac.bs)(o.organization.id);try{let{promise:e}=n({workspaceId:(null==k?void 0:k.id)||o.organization.id,variables:{inputHtml:f,request:c,format:u,outline:y,previousHtml:m,template:null==p?void 0:p.template,imageProvider:g,model:ej.of.get("editCardModel")},interactionId:h},p),t=null===(d=o.docGenerateInput)||void 0===d?void 0:null===(s=d.settings)||void 0===s?void 0:s.imageStyle;!t&&"aiGenerated"===g&&i&&(t=(0,aU.xI)(i)),(0,l4.rl)(v);let l=await e;console.log("[EditCard] Response",l);let a=(0,l1.DB)(l),r=await aS(a,{docFormatKey:u,loadImages:!1,context:{workspaceId:(null==k?void 0:k.id)||o.organization.id,docId:o.id,interactionId:h},imageOptions:{provider:g,generateStyle:t},theme:i});return(0,l4.Yh)({...v,outputContent:a,outputMessage:l.replace(a,"[outputContent]"),latency:performance.now()-b}),(0,aD.w)("editCard",k,h),{output:r,interactionId:h}}catch(e){throw(0,l4.tB)({...v,errorMessage:e.message,errorCode:e.code,errorName:e.name,errorStack:e.stack,outputMessage:"Error editing card",latency:performance.now()-b}),e}},[u,o,r,a,n,i]),m=(0,F.useCallback)(async e=>{let{instructions:n,operation:o}=e,i=l(),s=t.view.state.doc.nodeAt(i);if(!s){console.error("[AICard] Cannot append card. Node unknown");return}try{var d,u;r.dispatch((0,q.Ic)({cardId:a,suggestions:{status:"loading",loadingMessage:null==o?void 0:null===(d=o.loadingMessage)||void 0===d?void 0:d.call(o),variants:[]}}));let e=nr(t,i),l=(0,l2.K)(t,s),{output:m,interactionId:f}=await c({instructions:n,operation:o,inputHtml:l,previous:e});m.attrs=nd(s.attrs,m.attrs),nc(t,a,m),r.dispatch((0,q.Ic)({cardId:a,suggestions:{status:"done",interactionId:f,selected:"v1",operation:o,instructions:n,variants:[{label:ef.Ru._({id:"HxF6Fk"}),isOriginal:!0,id:"original",card:s.toJSON()},{label:(null==o?void 0:null===(u=o.variationName)||void 0===u?void 0:u.call(o))||ef.Ru._({id:"YledUl"}),isOriginal:!1,id:"v1",card:m}]}}))}catch(e){console.error("[EditCard] Error regenerating card",e),r.dispatch((0,q.Ic)({cardId:a,suggestions:{status:"error",variants:[]}}))}},[c,t,l,r,a]);return(0,F.useEffect)(()=>aN.on("translate",e=>{let{type:t,cardId:l,language:n}=e,o=lY.find(e=>"edit.translate"===e.key);"card"===t&&l===a&&o&&m({instructions:"".concat(n.englishName," (").concat(n.key,")"),operation:o})}),[a,m]),{editCard:m,status:s}},nc=(e,t,l)=>{let a=(0,r.xe)(e.state.doc,e=>(0,$.jg)(e)&&e.attrs.id===t)[0];if(!a){console.warn("[useGenerateCard] Card not found. It may have been deleted while generating.");return}e.chain().setMeta("isEditCardVariant",!0).setMeta("cardNotesHandled",!0).insertContentAt({from:a.pos,to:a.pos+a.node.nodeSize},l).selectInsideCardBody(a.pos).run();let n=l0.bP.fromJSON(e.state.schema,l);aP(e,n,(0,es.SJ)((0,J.KA)().getState()))},nm=e=>{let{cardId:t}=e,{isOpen:l,onClose:a,onOpen:n}=(0,aL.E)({id:"TranslateCardDisclosure"}),o=(0,F.useCallback)(e=>{aN.emit("translate",{type:"card",cardId:t,language:e}),a()},[t,a]);return{isTranslateCardOpen:l,onTranslateCardOpen:n,onTranslateCardClose:a,startTranslation:o}},nf=e=>{let{attrs:t,editor:l,getPos:a}=e,n=t.id,o=!!(0,J.GV)(lJ.Gd),{isTranslateCardOpen:i,onTranslateCardOpen:r,onTranslateCardClose:s,startTranslation:d}=nm({cardId:n}),u=(0,J.GV)((0,lK.iZ)("chat")),{color:c,bg:f,hoverColor:p,hoverBg:g,borderColor:h}=(0,e8.Nb)(),b=(0,F.useRef)(null),{status:y,editCard:v}=nu({editor:l,getPos:a,cardId:t.id}),k="loading"===y,w=(0,lq.tO)(void 0,"editCard",tE.VV.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GENERATE_CARD),x=(0,F.useCallback)(e=>{var t;if(w()){if((null===(t=e.operation)||void 0===t?void 0:t.key)==="edit.translate"){r();return}v(e)}},[w,v,r]),S=(0,J.jL)(),A=(0,J.GV)((0,tU.C_)(t.id,"editWithAI")),C=(0,F.useCallback)(()=>{S((0,tU.md)())},[S]),z=(0,F.useCallback)(()=>{S((0,tU.CM)({cardId:t.id,menuType:"editWithAI"}))},[S,null==t?void 0:t.id]);(0,eV.j)({ref:b,handler:e=>{if(!A)return;let l=e.target;null!=l&&l.closest('[data-card-ai-edit-menu-trigger="'.concat(t.id,'"]'))||C()}});let I=(0,F.useRef)(null),B=(0,ej.u)("editCard2"),{isInOfflineMode:R}=(0,t9.u)();return B?(0,m.jsxs)(eI.L8,{isDark:!1,children:[(0,m.jsxs)(tr.W,{isLazy:!0,onClose:C,onOpen:z,isOpen:A,closeOnBlur:!1,initialFocusRef:I,children:[(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(em.x6,{id:"EVnzPs"}),placement:"top",shouldWrapChildren:!0,children:(0,m.jsxs)(ts.I,{as:eu.$,isActive:A,isDisabled:R,"data-guider-highlight":"edit-with-ai-button","data-card-ai-edit-menu-trigger":t.id,height:tG.PN,fontWeight:"900",alignItems:"center",fontFamily:"Inter, sans-serif",display:"flex",backdropFilter:"blur(8px)",borderRadius:"sm",borderColor:h,color:c,boxShadow:"sm",cursor:"pointer",fontSize:"14px",bg:f,px:.5,_hover:{color:p,background:g},isLoading:k,pointerEvents:"auto",children:[(0,m.jsx)(j.g,{icon:lb.p7g,fixedWidth:!0}),(0,m.jsx)(eH.D,{})]})}),(0,m.jsx)(eJ.Z,{children:(0,m.jsxs)(td.c,{"data-card-ai-menu":!0,minWidth:"320px",width:"fit-content",maxWidth:"min(360px, 80vw)",fontFamily:"Inter, sans-serif",fontSize:"md",border:"none","data-card-ai-edit-menu-trigger":t.id,maxH:"60vh",display:"flex",flexDirection:"column",children:[(0,m.jsx)(np,{editCardIfAllowed:x,onClose:C,firstItemRef:b,inputRef:I,isDisabled:k,pb:"10%"}),(0,m.jsx)(e0.B,{px:5,py:3,bg:"gray.100",mx:-2,mb:-2,justify:"center",alignItems:"center",borderBottomRadius:"xl",children:(0,m.jsx)(e0.Q,{children:(0,m.jsx)(eu.$,{onClick:()=>{l.commands.selectInsideCardBody(a()),u||lv.emit("toggle",{}),C()},variant:"link",size:"sm",colorScheme:"gray",my:0,leftIcon:(0,m.jsx)(j.g,{icon:lh.Y$q}),children:(0,m.jsx)(em.x6,{id:"mw/rmM"})})})})]})})]}),i&&(0,m.jsx)(lH,{isSite:o,isFullDoc:!1,onClose:s,startTranslation:d})]}):null},np=(0,F.memo)(e=>{let{editCardIfAllowed:t,onClose:l,firstItemRef:a,inputRef:n,isDisabled:o,groups:i=["writing","layout"],showCreditCosts:r=!0,opacityFadeUpsell:s=!1,...d}=e,u="-webkit-gradient(linear, left top, left bottom, from(rgba(0,0,0,1)), to(rgba(0,0,0,0)))";return(0,m.jsxs)(f.az,{px:.5,pt:.5,flex:1,overflowY:"auto",style:s?{WebkitMaskImage:u,maskImage:u}:i.length>1?{maskImage:"linear-gradient(to bottom, transparent, black 0%, black 90%, transparent)"}:void 0,...d,children:[(0,m.jsx)(lm.r,{children:(0,m.jsxs)(lf.M,{size:"sm",mb:2,children:[(0,m.jsx)(lp.W,{fontSize:"sm",color:"orchid.300",children:(0,m.jsx)(j.g,{icon:lb.p7g})}),(0,m.jsx)(ly._,{initialHeight:"32px",ref:n,paddingInlineStart:9,py:1.5,borderRadius:"xl",maxLength:300,isDisabled:o,onKeyDown:e=>{var i,r;if(!o){if("Enter"===e.key&&!e.shiftKey){e.preventDefault(),e.stopPropagation();let a=null===(r=n.current)||void 0===r?void 0:r.value;if(!a)return;t({instructions:a}),l()}"ArrowDown"===e.key&&(null===(i=n.current)||void 0===i?void 0:i.value.length)===0&&(e.preventDefault(),e.stopPropagation(),a.current&&a.current.focus())}},placeholder:ef.Ru._({id:"vKZEFh"})})]})}),lZ.map((e,n)=>{let o=lX[e.key];return o&&0!==o.length&&i.includes(e.key)?(0,m.jsx)(lm.r,{title:e.label(),children:o.map((e,o)=>(0,m.jsx)(lg.D,{icon:(0,m.jsx)(j.g,{icon:e.icon,fixedWidth:!0}),onClick:()=>{t({operation:e}),l()},ref:0===o&&0===n?a:null,children:(0,m.jsxs)(C.z,{children:[(0,m.jsx)(z.E,{children:e.label()}),r&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(ez.h,{}),(0,m.jsx)(lV.G,{type:"editCard",colorScheme:"blackAlpha",color:"blackAlpha.600",fontSize:"sm"})]})]})},e.key))},e.key):null})]})});np.displayName="EditCardAIMenuGroups";var ng=l(56824),nh=l(52192);let nb=e=>{let{interactionId:t,operation:l,instructions:a,template:n}=e,[o,i]=(0,F.useState)(null),r=(0,F.useCallback)((e,o,i)=>{(0,l4.pS)({feedback:o,tags:i,rating:e,interactionId:t,instructions:a,operation:l,template:n})},[t,a,l,n]),s=(0,F.useCallback)(e=>{i(e),(0,l4.D8)({rating:e,interactionId:t,operation:l,template:n,instructions:a})},[t,l,n,a]);return(0,m.jsx)(nh.f3,{rating:o||void 0,setRating:s,RatingButtons:nh.LW,feedbackTags:ny,trackFeedback:r})},ny=[{key:"wrong-language",label:(0,m.jsx)(em.x6,{id:"R2Ly6h"})},{key:"wrong-layout",label:(0,m.jsx)(em.x6,{id:"moXJSM"})},{key:"wrong-content",label:(0,m.jsx)(em.x6,{id:"AgLuGi"})},{key:"wrong-images",label:(0,m.jsx)(em.x6,{id:"IAt1qK"})},{key:"too-similar",label:(0,m.jsx)(em.x6,{id:"Np7sCV"})},{key:"too-different",label:(0,m.jsx)(em.x6,{id:"/wLn3u"})},{key:"instructions",label:(0,m.jsx)(em.x6,{id:"Tq32Jp"})},{key:"other",label:(0,m.jsx)(em.x6,{id:"/IX/7x"})}],nv=e=>{let{suggestions:t,cardId:l,isDark:a,editor:n}=e,{color:o,bg:i}=(0,e8.Nb)(),r=(0,e8.wP)(),{status:s,variants:d,selected:u,loadingMessage:c,interactionId:f,instructions:p,operation:g}=t,h=(0,J.jL)(),b=(0,F.useCallback)((e,t)=>{h((0,q.S6)({cardId:l,variantId:e})),nc(n,l,t)},[h,l,n]),y=(0,tE.st)(),v=(0,F.useCallback)(()=>{var e;null==y||y.track(tE.VV.AI_CARD_VARIATION_KEPT,{cardId:l,variantId:u,isOriginal:null===(e=d.find(e=>e.id===u))||void 0===e?void 0:e.isOriginal,interactionId:f,source:"button"}),h((0,q.YB)({cardId:l}))},[h,l,u,y,d,f]),k=(0,ng.dU)("trueblue.500","trueblue.100"),w=(0,ng.dU)("trueblue.50","gray.700"),x=(0,ng.dU)("red.100","red.700"),S=(0,ng.dU)("red.500","red.100");return(0,m.jsx)(C.z,{contentEditable:!1,userSelect:"none",align:"center",position:"absolute",left:"50%",transform:"translateX(-50%)",marginLeft:-3,pointerEvents:"auto",spacing:2,children:"loading"===s?(0,m.jsxs)(C.z,{borderWidth:"1px",...r,pointerEvents:"none",children:[(0,m.jsx)(j.g,{icon:lb.p7g}),(0,m.jsxs)(z.E,{children:[c||(0,m.jsx)(em.x6,{id:"RQqcwV"}),"..."]})]}):"error"===s?(0,m.jsxs)(C.z,{borderWidth:"1px",...r,_hover:{},bg:x,color:S,children:[(0,m.jsx)(j.g,{icon:ec.QJT}),(0,m.jsx)(z.E,{children:(0,m.jsx)(em.x6,{id:"nwtY4N"})}),(0,m.jsx)(e9.K,{"aria-label":ef.Ru._({id:"yz7wBu"}),size:"xs",minW:4,minH:4,h:4,isRound:!0,variant:"ghost",onClick:v,icon:(0,m.jsx)(j.g,{icon:ec.GRI}),colorScheme:a?"white":"blackAlpha"})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(ed.e,{spacing:"-1px",children:[d.map(e=>(0,m.jsx)(eu.$,{...r,color:u===e.id?k:o,bg:u===e.id?w:i,variant:u===e.id?"plainSelected":"plain",onClick:()=>b(e.id,e.card),position:"relative",children:e.label},e.id)),(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(em.x6,{id:"MuX+Gc"}),placement:"top",children:(0,m.jsx)(e9.K,{...r,icon:(0,m.jsx)(j.g,{icon:lb.e68}),"aria-label":ef.Ru._({id:"MuX+Gc"}),onClick:v})})]}),f&&(0,m.jsx)(nb,{interactionId:f,operation:null==g?void 0:g.key,template:null==g?void 0:g.template,instructions:p})]})})};var nk=l(43342),nw=l(32849),nx=l(42717);let nS=e=>{let{theme:t,editor:l,getPos:a,updateAttributes:n,input:o}=e,{getContextAndGenerate:i,isGenerating:r}=no({theme:t,editor:l,getPos:a,input:o,randomTemplate:!0}),s=(0,lq.tO)(()=>i(o.prompt),"generateCard",tE.VV.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GENERATE_CARD),d=(0,e8.wP)(),u=(0,nw.ez)("unlimited_credits");return(0,m.jsx)(C.z,{contentEditable:!1,userSelect:"none",align:"center",position:"absolute",left:"50%",transform:"translateX(-50%)",marginLeft:-3,pointerEvents:"auto",children:r?(0,m.jsx)(f.az,{px:4,children:(0,m.jsx)(nk.y,{size:"xs",color:"purple.500"})}):(0,m.jsxs)(C.z,{spacing:2,children:[(0,m.jsxs)(ed.e,{spacing:"-1px",children:[(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(em.x6,{id:"K1Ro+T"}),placement:"top",children:(0,m.jsx)(e9.K,{...d,icon:(0,m.jsx)(j.g,{icon:lb.CeG}),"aria-label":ef.Ru._({id:"K1Ro+T"}),onClick:()=>n({layoutTemplateColumns:null,generatorInput:{...nx.O,prompt:o.prompt}})})}),(0,m.jsx)(eI.Tz,{label:(0,m.jsxs)(eC.T,{spacing:.5,pb:1,children:[(0,m.jsx)(z.E,{children:(0,m.jsx)(em.x6,{id:"KDw4GX"})}),!u&&(0,m.jsx)(lV.G,{type:"generateCard",ml:0})]}),placement:"top",children:(0,m.jsx)(e9.K,{...d,icon:(0,m.jsx)(j.g,{icon:lb.VH5}),onClick:s,"aria-label":ef.Ru._({id:"KDw4GX"})})}),(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(em.x6,{id:"fyn0X5"}),placement:"top",children:(0,m.jsx)(e9.K,{...d,icon:(0,m.jsx)(j.g,{icon:lb.e68}),"aria-label":ef.Ru._({id:"fyn0X5"}),onClick:()=>n({generatorInput:null})})})]}),o.interactionId&&(0,m.jsx)(nb,{interactionId:o.interactionId,operation:"generate-card",template:o.template,instructions:o.prompt})]})})};var nA=l(83292),nC=l(15428),nz=l(79428),nI=l(22544);function nj(){let e=(0,nA._)(["\n 0% {\n margin-inline: 0;\n }\n 100% {\n margin-inline: var(--nested-card-margin);\n }\n"]);return nj=function(){return e},e}let nF=(0,nC.i7)(nj()),nB=e=>{let{attrs:t,isFullBleed:l,displayFullBleed:a,isNested:n,isPresentMode:o,isEditable:i,isFocused:r,isDark:s,isLetterboxed:d,showPresentBackdrop:u,isCommentOpenOnCard:c,theme:p,children:g}=e,{id:h,container:b}=t,y=(0,tg.NC)(p,b),v=a?nz.xE:nz.CO,k=o&&!n,w=(0,tp.ZI)(p,b.background?y:void 0),x=l?{width:n||d?"var(--card-width)":"100%"}:{zIndex:n?c?eO.nestedCardBodyWithComment:eO.nestedCardBody:void 0,width:"var(--card-width)"},S=k?{minW:u||d?"auto":"100%",minH:"var(--card-min-height)",my:"auto"}:{minW:"0%",minH:"var(--card-min-height)"},A=nI.D1?0:er.M2;return(0,m.jsxs)(eN.s,{className:(0,I.cx)(er.p$),"data-card-body":h,"data-selection-ring":!0,"data-guider-highlight":"card-body","data-letterboxed":d?"true":void 0,"data-content-reference":!0,"data-testid":"card-body","data-hide-comments":o&&!u,fontSize:"var(--font-size)",animation:n?"".concat(nF," ").concat(A,"ms ease-out forwards"):void 0,position:"relative",...x,...S,maxW:"var(--card-max-width)",css:{"--grid-outline-color":s?"var(--chakra-colors-gray-700)":"var(--chakra-colors-gray-200)",...w,"--card-border-radius":a?0:w["--card-border-radius"]},justify:"center",borderRadius:"var(--card-border-radius)",pl:l&&!n?"var(--doc-padding-left)":void 0,pr:l&&!n?"var(--doc-padding-right)":void 0,_hover:i&&a&&!r?{"> .card-body-background":{outline:"2px solid var(--grid-outline-color)"}}:void 0,outline:d?"max(50vw, 50vh) solid black":void 0,children:[(0,m.jsx)(f.az,{position:"absolute",inset:"0",sx:v,className:"card-body-background",borderRadius:"inherit",contentEditable:!1,zIndex:o?-1:void 0,outline:r?"2px solid var(--chakra-ring-color)":void 0,outlineOffset:l&&!o?"-2px":void 0,border:n&&"0em"===w["--card-border-width"]?"1px solid var(--neutral-border-color)":void 0,"data-export-master":!!a||void 0}),(0,m.jsx)(eI.L8,{isDark:s,children:g})]})};var nR=l(64130),n_=l(77256),nM=l(45709),nE=l(12784),nT=l.n(nE),nO=l(69771);let nP="FLUSH_SYNCED_EDITOR";var nN=l(2696),nD=l(4616),nL=l(51436);let nW={blankCard:"/new"},nU=()=>(0,nL.st)().reduce((e,t)=>{let{id:l,name:a,jsonContent:n}=t;return e[l]={type:"cardTemplate",key:l,nodeName:"card",name:a,...nW[l]&&{shortcut:nW[l]},icon:lh.Qyz,execute:e=>{e.commands.insertContentAndSelect(n)}},e},{}),nG=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return(0,nD.g)(e).map(e=>{let{name:t,templateIds:l}=e,a=l.map(e=>nU()[e]);return{subcategory:t(),items:a}})};var nH=l(46882),nV=l(89284),nq=l(18651),nK=l(27670);let nJ=function(e,t){var l;let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;if(!t||!t.type)return(0,m.jsx)(F.Fragment,{},o);if("text"===t.type)return(0,m.jsx)(F.Fragment,{},"text-".concat(o));let i=e.nodes[t.type];if(!i)return(0,m.jsx)(F.Fragment,{});let r=null===(l=t.content)||void 0===l?void 0:l.map((l,a)=>nJ(e,l,t,n+1,a));return F.createElement(i.component,{key:"".concat(i.type,"-").concat(o),node:t,depth:n,parent:a,index:o},r)},n$=e=>{let{children:t,orientation:l="vertical",...a}=e,n="vertical"===l?eX.B:C.z;return(0,m.jsx)(n,{spacing:"var(--block-spacing)",...a,children:t})},nQ=e=>(0,m.jsx)(f.az,{bg:"var(--main-color)",h:"var(--paragraph-height)",w:"100%",borderRadius:"var(--text-border-radius)",...e}),nY=e=>{let{style:t="solid",children:l,...a}=e;return(0,m.jsx)(n$,{w:"100%",bg:"solid"===t?"var(--main-color)":"transparent",minH:"2em",borderRadius:"var(--box-border-radius)",border:"outline"===t?"var(--border-width) solid var(--main-color)":"none",...a,children:l&&l})};var nX=l(35789);let nZ=e=>{let{iconSize:t="2x",icon:l,...a}=e;return(0,m.jsx)(nX.o,{minH:"4em",bg:"var(--box-background-color)",color:"var(--accent-color)",borderRadius:"var(--box-border-radius)",...a,children:l||(0,m.jsx)(j.g,{icon:ec.Cyq,size:t})})},n0={top:{grid:{gridTemplateColumns:"1fr",gridTemplateRows:"auto 1fr",gridTemplateAreas:'"accent" "body"'},items:{accent:{type:"accent"},body:{type:"body"}},allowFit:!1},behind:{grid:{gridTemplateColumns:"1fr",gridTemplateRows:"auto"},items:{accent:{type:"accent",style:{gridArea:"1 / 1"}},body:{type:"body",style:{gridArea:"1 / 1",zIndex:1}}},allowFit:!1},blank:{grid:{gridTemplateColumns:"1fr",gridTemplateRows:"1fr",gridTemplateAreas:'"body"'},items:{body:{type:"body"}},allowFit:!1},left:{grid:{gridTemplateColumns:"".concat(37.5,"% ").concat(62.5,"%"),gridTemplateRows:"auto ",gridTemplateAreas:'"accent body"'},items:{accent:{type:"accent"},body:{type:"body"}},allowFit:!0},right:{grid:{gridTemplateColumns:"".concat(62.5,"% ").concat(37.5,"%"),gridTemplateRows:"auto",gridTemplateAreas:'"body accent"'},items:{accent:{type:"accent"},body:{type:"body"}},allowFit:!0}},n1=e=>n0[null!=e?e:"blank"]||n0.blank,n2=e=>{var t;let{node:l}=e;return(null===(t=l.attrs)||void 0===t?void 0:t.itemId)==="accent"?(0,m.jsx)(n4,{...e}):(0,m.jsx)(n6,{...e})},n6=e=>{let{node:t,children:l}=e;return(0,m.jsx)(n$,{className:"thumbnail-node-".concat(t.type),spacing:"1em",p:"1em",alignSelf:"center","data-testid":"card-layout-thumbnail",children:l})},n4=e=>{var t;let{node:l,parent:a}=e,n=l.attrs,o=null==a?void 0:a.attrs,i=n1(null!==(t=null==o?void 0:o.layout)&&void 0!==t?t:"blank");if(!((null==n?void 0:n.itemId)&&i.items[n.itemId]))return null;let r=i.allowFit&&(null==n?void 0:n.fitType)==="fit";return(0,m.jsx)(eN.s,{className:"thumbnail-node-".concat(l.type),children:r?(0,m.jsx)(eN.s,{flexDirection:"column",justifyContent:"center",alignItems:"center",bg:"var(--box-background-color)",flex:1,h:"100%",children:(0,m.jsx)(nZ,{w:"70%",minH:"55%",bg:"var(--main-color)"})}):(0,m.jsx)(nZ,{w:"100%",h:"auto",borderRadius:"none"})})},n5=e=>{var t,l,a,n,o;let{node:i,isCollapsed:r=!1,children:s}=e,d=i.attrs,u=n1(null!==(a=null==d?void 0:d.layout)&&void 0!==a?a:"blank"),c=u.items;return(0,m.jsx)(eN.s,{className:(0,I.cx)("thumbnail-node-".concat(i.type),r&&"collapsed"),"data-testid":"card-thumbnail",minH:r?"2.5em":"var(--card-template-min-height)",w:r?"100%":"var(--card-template-width)",h:"auto",border:"2px solid",borderColor:"var(--main-color)",borderRadius:"base",flexDirection:"column",overflow:"hidden",children:(0,m.jsxs)(eN.s,{flexDirection:"column",fontSize:"".concat(.375,"em"),flex:1,justifyContent:"center",children:[!r&&(0,m.jsx)(f.az,{display:"grid",flex:1,sx:{...u.grid,...c.body?{"> .thumbnail-node-cardLayoutItem":null!==(n=null===(t=c.body)||void 0===t?void 0:t.style)&&void 0!==n?n:{gridArea:"body"}}:{},...c.accent?{"> .thumbnail-node-cardAccentLayoutItem":null!==(o=null===(l=c.accent)||void 0===l?void 0:l.style)&&void 0!==o?o:{gridArea:"accent"}}:{}},children:s}),r&&(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(nQ,{w:"50%",mx:"1em",h:"2em",borderRadius:"calc(var(--text-border-radius) * 2)"})})]})})},n3={bar:ec.s67,pie:ec.W1p,line:ec.gK3,donut:ec.oDg,"horizontal-bar":ec.Mkm};var n8=l(18733),n7=l(22481),n9=l(95905);let oe=e=>({"--flex-align":(0,n9.lI)(e)}),ot=e=>({["& .thumbnail-node-paragraph > div:nth-of-type(1n+".concat(e+1,")")]:{display:"none"}});var ol=l(1906);let oa=e=>{let{children:t,...l}=e;return(0,m.jsx)(f.az,{boxSize:"var(--bullet-size)",borderRadius:"0.25em",bg:"var(--main-color)",...l,children:t})},on="0.5em";var oo=l(54979);let oi={xs:"sm",sm:"sm",md:"lg",lg:"xl",xl:"2x",full:"2x"},or=e=>{var t,l,a,n,o,i,r,s,d;let{node:u,parent:c,children:f}=e,p=oe(null!==(s=null==c?void 0:null===(l=c.attrs)||void 0===l?void 0:null===(t=l.options)||void 0===t?void 0:t.horizontalAlign)&&void 0!==s?s:"center"),g=null!==(d=null==c?void 0:null===(n=c.attrs)||void 0===n?void 0:null===(a=n.options)||void 0===a?void 0:a.imageShape)&&void 0!==d?d:"square",h=oo.z[g],b=(null==c?void 0:null===(o=c.attrs)||void 0===o?void 0:o.variantKey)==="iconsText",y=(null==c?void 0:null===(r=c.attrs)||void 0===r?void 0:null===(i=r.options)||void 0===i?void 0:i.shapeSize)||"lg",v=ot(2);return(0,m.jsxs)(eN.s,{className:"thumbnail-node-".concat(u.type),gap:"var(--block-spacing)",flexDirection:"column",children:[b?(0,m.jsx)(nZ,{minH:"0",icon:(0,m.jsx)(j.g,{icon:lb.yy,size:oi[y]||"lg"}),bg:b?"none":void 0}):(0,m.jsx)(nZ,{minH:"2em",minW:"2em",sx:h}),(0,m.jsx)(n$,{css:p,sx:b?void 0:v,children:f})]})},os=e=>{var t;let{node:l,children:a}=e,n=(null===(t=l.attrs)||void 0===t?void 0:t.variantKey)==="iconsText";return(0,m.jsx)(tf.r,{rowGap:"1.5em",columnGap:"1.5em",columns:n?4:3,children:a})},od="0.25em",ou=e=>{let{node:t}=e;return(0,m.jsx)(eN.s,{className:"thumbnail-node-".concat(t.type),bg:"var(--main-color)",h:"1.25em"})},oc=e=>{let{isFunnel:t=!1,children:l}=e;return(0,m.jsx)(tf.r,{columns:1,autoRows:"1fr",gap:od,pos:"relative",mx:"auto",w:"min(100%, calc((var(--card-template-width) * 0.5) / ".concat(.375,"))"),clipPath:t?"polygon(50% 100%, 0 0, 100% 0)":"polygon(50% 0%, 0% 100%, 100% 100%)",children:l})},om=(e,t)=>Math.floor(33+67/(t-1)*e),of={bullets:{Cell:e=>{let{node:t,children:l}=e;return(0,m.jsxs)(eN.s,{className:"thumbnail-node-".concat(t.type),pos:"relative",align:"flex-start",gap:"1em",flex:"1 1 auto",w:"calc(".concat(50,"% - ").concat("1em",")"),children:[(0,m.jsx)(oa,{}),(0,m.jsx)(n$,{flex:"1",children:l})]})},Wrapper:e=>{let{children:t}=e;return(0,m.jsx)(eN.s,{gap:"1em",wrap:"wrap",children:t})}},timeline:{Cell:e=>{var t,l;let{node:a,parent:n,children:o}=e,i=(null==n?void 0:null===(l=n.attrs)||void 0===l?void 0:null===(t=l.options)||void 0===t?void 0:t.orientation)==="horizontal",r="".concat(2,"em");return(0,m.jsxs)(eN.s,{className:"thumbnail-node-".concat(a.type),pos:"relative",...i?{gridColumn:"span 2",gridRow:3,align:"flex-start",justify:"center",pt:r}:{gridRow:"span 2",gridColumn:3,align:"flex-start",pl:r},orientation:"horizontal",align:"start",children:[(0,m.jsx)(oa,{pos:"absolute",...i?{top:0,transform:"translateY(-50%)"}:{left:0,transform:"translateX(-50%)"},children:(0,m.jsx)(f.az,{position:"absolute",zIndex:"-1",bg:"var(--main-color)",...i?{height:"".concat(1,"em"),width:"var(--border-width)",left:"50%",top:"100%",transform:"translateX(-50%)"}:{width:"".concat(1,"em"),height:"var(--border-width)",top:"50%",transform:"translateY(-50%)",left:"100%"}})}),(0,m.jsx)(n$,{flex:"1",children:o})]})},Wrapper:e=>{var t,l;let{children:a,node:n}=e,o=(null===(l=n.attrs)||void 0===l?void 0:null===(t=l.options)||void 0===t?void 0:t.orientation)==="horizontal",i=o?(0,m.jsx)(f.az,{gridRow:2,gridColumn:1,children:(0,m.jsx)(f.az,{position:"absolute",height:"var(--border-width)",width:"100%",left:"0",right:"0",bg:"var(--main-color)"})}):(0,m.jsx)(nX.o,{gridColumn:2,gridRow:1,children:(0,m.jsx)(f.az,{position:"absolute",width:"var(--border-width)",top:"0",bottom:"0",bg:"var(--main-color)"})});return(0,m.jsxs)(nH.x,{...o?{templateRows:"auto 0px auto",autoColumns:"1fr",justifyContent:"center",columnGap:"1em",mt:"var(--bullet-size)"}:{templateColumns:"0px 0px 1fr",autoRows:"auto",justifyContent:"center",rowGap:"1em",ml:"var(--bullet-size)"},pos:"relative","data-testid":"timeline-thumbnail",children:[i,a]})}},imagesText:{Cell:or,Wrapper:os},textBoxes:{Cell:e=>{var t,l;let{node:a,parent:n,children:o}=e,i=oe((null==n?void 0:null===(l=n.attrs)||void 0===l?void 0:null===(t=l.options)||void 0===t?void 0:t.horizontalAlign)||"center");return(0,m.jsx)(nY,{className:"thumbnail-node-".concat(a.type),bg:"var(--box-background-color)",p:"var(--box-padding)",css:i,children:o})},Wrapper:e=>{let{children:t}=e;return(0,m.jsx)(eN.s,{gap:"var(--block-spacing)",children:t})}},stats:{Cell:e=>{var t,l,a;let{children:n,node:o,parent:i}=e,r=oe((null==i?void 0:null===(l=i.attrs)||void 0===l?void 0:null===(t=l.options)||void 0===t?void 0:t.horizontalAlign)||"center");return(0,m.jsxs)(n$,{className:"thumbnail-node-".concat(o.type),align:"center",justify:"start",children:[(0,m.jsx)(z.E,{color:"var(--accent-color)",fontSize:"1.5em",children:(null===(a=o.attrs)||void 0===a?void 0:a.label)||"X%"}),(0,m.jsx)(n$,{w:"100%",css:r,children:n})]})},Wrapper:e=>{let{children:t,parent:l}=e,a=(null==l?void 0:l.type)==="gridCell"?1:3;return(0,m.jsx)(tf.r,{columns:a,columnGap:"1.5em",rowGap:"1.5em",children:t})}},barStats:{Cell:e=>{var t,l,a;let{node:n,parent:o,children:i}=e,r=(0,ol.dD)({label:(null===(t=n.attrs)||void 0===t?void 0:t.label)||null}),s=oe((null==o?void 0:null===(a=o.attrs)||void 0===a?void 0:null===(l=a.options)||void 0===l?void 0:l.horizontalAlign)||"center");return(0,m.jsxs)(n$,{className:"thumbnail-node-".concat(n.type),align:"center",justify:"start",children:[(0,m.jsxs)(n$,{borderRadius:"calc(var(--box-border-radius) / 2)",overflow:"hidden",orientation:"horizontal",flex:1,w:"100%",bg:"var(--main-color)",children:[(0,m.jsx)(f.az,{w:"100%",bg:"var(--accent-color)",pos:"relative",h:"1.25em",children:(0,m.jsx)(f.az,{pos:"absolute",inset:0})}),(0,m.jsx)(f.az,{w:"".concat(100*r,"%"),pos:"relative"})]}),(0,m.jsx)(n$,{w:"100%",css:s,children:i})]})},Wrapper:e=>{let{children:t,parent:l}=e,a=(null==l?void 0:l.type)==="gridCell"?1:2;return(0,m.jsx)(tf.r,{columns:a,columnGap:"1.5em",rowGap:"1em",children:t})}},staircase:{Cell:e=>{var t,l;let{node:a,parent:n,index:o}=e,i=om(o,null!==(l=null==n?void 0:null===(t=n.content)||void 0===t?void 0:t.length)&&void 0!==l?l:1);return(0,m.jsx)(eN.s,{className:"thumbnail-node-".concat(a.type),borderRadius:"2px",bg:"var(--main-color)",h:"1.25em",w:"".concat(i,"%")})},Wrapper:e=>{var t,l,a;let{node:n,children:o}=e,i=null!==(a=null==n?void 0:null===(l=n.attrs)||void 0===l?void 0:null===(t=l.options)||void 0===t?void 0:t.horizontalAlign)&&void 0!==a?a:"center",r=(0,n9.lI)(i);return(0,m.jsx)(n$,{align:r,gap:od,mx:"auto",w:"min(100%, calc((var(--card-template-width) * 0.5) / ".concat(.375,"))"),children:o})}},pyramid:{Cell:ou,Wrapper:oc},funnel:{Cell:e=>(0,m.jsx)(ou,{...e}),Wrapper:e=>{let{children:t,...l}=e;return(0,m.jsx)(oc,{isFunnel:!0,...l,children:t})}},circleStats:{Cell:e=>{var t,l,a,n;let{node:o,parent:i,children:r}=e,s=(0,n9.lI)((null==i?void 0:null===(l=i.attrs)||void 0===l?void 0:null===(t=l.options)||void 0===t?void 0:t.horizontalAlign)||"center"),d=(0,ol.dD)({label:null!==(n=null===(a=o.attrs)||void 0===a?void 0:a.label)&&void 0!==n?n:"50"});return(0,m.jsxs)(eN.s,{className:"thumbnail-node-".concat(o.type),gap:"var(--block-spacing)",flexDirection:"column",children:[(0,m.jsx)(f.az,{display:"flex",justifyContent:"center",alignItems:"center",position:"relative",w:"80%",alignSelf:"center",aspectRatio:"1 / 1",_before:{content:'""',position:"absolute",top:"0",left:"0",right:"0",bottom:"0",borderRadius:"50%",background:"conic-gradient(var(--accent-color) ".concat(100*d,"%, var(--main-color) 0 ").concat((100-d)*100,"%)"),zIndex:1},_after:{content:'""',position:"absolute",top:on,left:on,right:on,bottom:on,background:"var(--card-background)",borderRadius:"50%",zIndex:2},children:(0,m.jsx)(f.az,{zIndex:"100",bg:"var(--main-color)",h:"0.5em",pos:"absolute",borderRadius:"var(--text-border-radius)",w:"40%"})}),(0,m.jsx)(n$,{css:s,children:r})]})},Wrapper:e=>{let{children:t}=e;return(0,m.jsx)(tf.r,{gap:"1.5em",columns:3,children:t})}},arrows:{Cell:e=>{var t,l,a,n;let{node:o,parent:i,children:r}=e,s=oe((null==i?void 0:null===(l=i.attrs)||void 0===l?void 0:null===(t=l.options)||void 0===t?void 0:t.horizontalAlign)||"left"),d=(null==i?void 0:null===(n=i.attrs)||void 0===n?void 0:null===(a=n.options)||void 0===a?void 0:a.orientation)==="vertical";return(0,m.jsxs)(eN.s,{className:"thumbnail-node-".concat(o.type),gap:"var(--block-spacing)",flexDirection:d?"row":"column",children:[(0,m.jsx)(f.az,{width:d?"1.5em":"100%",height:d?"100%":"1.25em",bg:"var(--accent-color)",clipPath:d?"polygon(50% 10%, 100% 0, 100% 90%, 50% 100%, 0 90%, 0% 0%)":"polygon(90% 0, 100% 50%, 90% 100%, 0% 100%, 10% 50%, 0% 0%)"}),(0,m.jsx)(n$,{flex:1,css:s,p:"0.5em",px:d?0:"0.5em",pt:d?void 0:0,children:r})]})},Wrapper:e=>{var t,l;let{node:a,children:n}=e,o=(null===(l=a.attrs)||void 0===l?void 0:null===(t=l.options)||void 0===t?void 0:t.orientation)==="vertical";return(0,m.jsx)(tf.r,{columns:o?1:3,rowGap:o?void 0:"1.5em",children:n})}},iconsText:{Cell:or,Wrapper:os}},op=e=>{let{children:t}=e;return(0,m.jsx)(nY,{p:"var(--box-padding)",bg:"var(--box-background-color)",w:"100%",children:t})},og=e=>{let{children:t}=e;return(0,m.jsx)(nY,{p:"var(--box-padding)",bg:"var(--box-background-color)",w:"100%",children:t})},oh={nodes:{card:{type:"card",component:e=>{let{depth:t,...l}=e;return t>2?(0,m.jsx)(m.Fragment,{}):t>1?(0,m.jsx)(n5,{...l,isCollapsed:!0}):(0,m.jsx)(n5,{...l})}},cardLayoutItem:{type:"cardLayoutItem",component:n2},cardAccentLayoutItem:{type:"cardAccentLayoutItem",component:n2},title:{type:"title",component:e=>{let{node:t}=e;return(0,m.jsx)(f.az,{className:"thumbnail-node-".concat(t.type),w:"50%",bg:"var(--main-color)",h:"".concat((0,n8.o)("title").size/2,"em"),borderRadius:"var(--text-border-radius)"})}},paragraph:{type:"paragraph",component:e=>{let{node:t}=e;return(0,m.jsxs)(eX.B,{className:"thumbnail-node-".concat(t.type),"data-testid":"paragraph-thumbnail",spacing:"var(--line-spacing)",align:"var(--flex-align)",children:[(0,m.jsx)(nQ,{}),(0,m.jsx)(nQ,{}),(0,m.jsx)(nQ,{w:"85%"})]})}},heading:{type:"heading",component:e=>{var t;let{node:l}=e;return(0,m.jsx)(f.az,{className:"thumbnail-node-".concat(l.type),"data-testid":"heading-thumbnail",bg:"var(--main-color)",h:"".concat((0,n8.o)((0,n8.bZ)(null===(t=l.attrs)||void 0===t?void 0:t.level)).size/2,"em"),borderRadius:"var(--text-border-radius)"})}},bullet:{type:"bullet",component:e=>{let{node:t}=e;return(0,m.jsxs)(n$,{className:"thumbnail-node-".concat(t.type),orientation:"horizontal",align:"start",pl:"0.5em",color:"var(--main-color)",children:[(0,m.jsx)(f.jl,{size:"var(--block-spacing)",bg:"var(--main-color)"}),(0,m.jsx)(n$,{orientation:"horizontal",flex:"1",children:(0,m.jsx)(nQ,{w:"75%"})})]})}},gridLayout:{type:"gridLayout",component:e=>{var t,l;let{node:a,children:n}=e;return(0,m.jsx)(nH.x,{className:"thumbnail-node-".concat(a.type),templateColumns:"repeat(".concat((null===(l=a.attrs)||void 0===l?void 0:null===(t=l.colWidths)||void 0===t?void 0:t.length)||2,", 1fr)"),gap:"var(--block-spacing)",children:n})}},gridCell:{type:"gridCell",component:e=>{var t;let{node:l,children:a}=e,n=null===(t=l.attrs)||void 0===t?void 0:t.verticalAlign;return(0,m.jsx)(n$,{className:"thumbnail-node-".concat(l.type),justifyContent:n,flex:1,children:a})}},image:{type:"image",component:e=>{let{node:t}=e;return(0,m.jsx)(nZ,{className:"thumbnail-node-".concat(t.type)})}},mediaPlaceholder:{type:"mediaPlaceholder",component:e=>{var t;let{node:l}=e,a=l.attrs,n=null==a?void 0:a.source,o=n&&(null===(t=n7.Dc[n])||void 0===t?void 0:t.icon)||null;return(0,m.jsx)(nZ,{className:"thumbnail-node-".concat(l.type),icon:o?(0,m.jsx)(j.g,{icon:o,size:"2x"}):void 0})}},buttonGroup:{type:"buttonGroup",component:e=>{let{node:t,children:l}=e;return(0,m.jsx)(n$,{className:"thumbnail-node-".concat(t.type),orientation:"horizontal",children:l})}},button:{type:"button",component:e=>{var t;let{node:l}=e,a=(null===(t=l.attrs)||void 0===t?void 0:t.variant)||"solid";return(0,m.jsx)(nY,{className:"thumbnail-node-".concat(l.type),minH:"1.5em",w:"25%",style:a})}},gallery:{type:"gallery",component:e=>{let{node:t}=e;return(0,m.jsxs)(nY,{className:"thumbnail-node-".concat(t.type),display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",bg:"var(--box-background-color)",p:"0.5em",children:[(0,m.jsx)(nZ,{flex:2,minH:"3.5em",bg:"var(--main-color)",iconSize:"xl"}),(0,m.jsx)(nZ,{flex:1,minH:"3.5em",bg:"var(--main-color)",iconSize:"xl"}),(0,m.jsx)(nZ,{flex:2,minH:"3.5em",bg:"var(--main-color)",iconSize:"xl"})]})}},toggle:{type:"toggle",component:e=>{let{node:t,children:l}=e;return(0,m.jsx)(f.az,{className:"thumbnail-node-".concat(t.type),pl:"0.5em","data-open":"false",sx:{'&[data-open="false"]':{"> :not(:first-of-type)":{display:"none"}}},children:l})}},toggleSummary:{type:"toggleSummary",component:e=>{let{node:t}=e;return(0,m.jsxs)(n$,{className:"thumbnail-node-".concat(t.type),orientation:"horizontal",color:"var(--main-color)",maxH:"1em",children:[(0,m.jsx)(j.g,{icon:lb.fU5,size:"xl"}),(0,m.jsx)(nQ,{w:"75%"})]})}},smartLayout:{type:"smartLayout",component:e=>{var t,l;let{node:a,children:n,...o}=e,i=og;if(null===(t=a.attrs)||void 0===t?void 0:t.variantKey){let e=null===(l=of[a.attrs.variantKey])||void 0===l?void 0:l.Wrapper;e&&(i=e)}return(0,m.jsx)(nH.x,{className:"thumbnail-node-".concat(a.type),gridTemplateColumns:"100%",children:(0,m.jsx)(i,{node:a,...o,children:n})})}},smartLayoutCell:{type:"smartLayoutCell",component:e=>{var t,l;let{children:a,parent:n,...o}=e,i=op;if(n&&(null===(t=n.attrs)||void 0===t?void 0:t.variantKey)){let e=null===(l=of[n.attrs.variantKey])||void 0===l?void 0:l.Cell;e&&(i=e)}return(0,m.jsx)(i,{parent:n,...o,children:a})}},diagram:{type:"diagram",component:e=>{let{node:t}=e;return(0,m.jsx)(nZ,{className:"thumbnail-node-".concat(t.type),icon:(0,m.jsx)(j.g,{icon:ec.qTS,size:"2x"})})}},chart:{type:"chart",component:e=>{var t;let{node:l}=e;return(0,m.jsx)(nZ,{className:"thumbnail-node-".concat(l.type),icon:(0,m.jsx)(j.g,{icon:n3[(null===(t=l.attrs)||void 0===t?void 0:t.chartType)||"bar"],size:"2x"})})}},table:{type:"table",component:e=>{let{node:t,children:l}=e;return(0,m.jsx)(f.az,{flex:1,className:"thumbnail-node-".concat(t.type),bg:"var(--box-background-color)",borderRadius:"var(--text-border-radius)",p:"0.25em",children:(0,m.jsx)(f.az,{border:"1px solid var(--main-color)",borderRadius:"var(--text-border-radius)",children:l})})}},tableRow:{type:"tableRow",component:e=>{let{node:t,children:l}=e;return(0,m.jsx)(eN.s,{className:"thumbnail-node-".concat(t.type),borderBottom:"1px solid var(--main-color)",sx:{"&:last-of-type ":{borderBottom:"none"}},children:l})}},tableCell:{type:"tableCell",component:e=>{let{node:t}=e;return(0,m.jsx)(f.az,{flex:1,className:"thumbnail-node-".concat(t.type),height:"1em",borderRight:"1px solid var(--main-color)",sx:{"&:last-of-type":{borderRight:"none"}}})}}}},ob={md:"6em",lg:"8em"},oy={md:"4em",lg:"5em"},ov=e=>{let{content:t,isDark:l,size:a="md",...n}=e;return(0,m.jsx)(f.az,{css:{"--box-background-color":l?"var(--chakra-colors-gray-600)":"var(--chakra-colors-gray-100)","--main-color":l?"var(--chakra-colors-gray-500)":"var(--chakra-colors-gray-200)","--accent-color":l?"var(--chakra-colors-gray-300)":"var(--chakra-colors-gray-400)","--box-border-radius":"0.5em","--box-padding":"0.75em","--text-border-radius":"0.25em","--block-spacing":"0.75em","--bullet-size":"1em","--line-spacing":"calc(1 / 3 * 1em)","--paragraph-height":"0.5em","--border-width":"0.25em","--card-template-width":ob[a],"--card-template-min-height":oy[a],"--card-background":l?"var(--chakra-colors-gray-700)":"white"},bg:"var(--card-background)",h:"auto",...n,children:nJ(oh,t)})};var ok=l(14e3);let ow=e=>{let{item:t}=e,{name:l,image:a,icon:n,key:o,previewImage:i,shortcut:r,badge:s}=t,d=(0,nL.iT)(),{colorMode:u}=(0,ng.G6)(),c={iconColor:(0,ng.dU)("trueblue.600","trueblue.100"),bgColor:(0,ng.dU)("white","gray.900"),textColor:(0,ng.dU)("gray.800","gray.100"),borderColor:(0,ng.dU)("gray.200","gray.700"),invertFilter:(0,ng.dU)("invert(0)","invert(.7) brightness(1.2)"),iconBgColor:(0,ng.dU)("white","gray.800"),gripDotsColor:(0,ng.dU)("gray.500","gray.500")};return(0,m.jsxs)(eX.B,{h:"100%",bg:c.bgColor,p:2.5,pt:2,spacing:1.5,alignItems:"center",shadow:"sm",borderRadius:"xl",border:"1px",borderColor:c.borderColor,role:"group",children:[(0,m.jsx)(eN.s,{justifyContent:"center",alignItems:"center",minH:"7",w:"100%",children:"cardTemplate"===t.type&&d[o]?(0,m.jsx)(ov,{content:d[o].jsonContent,isDark:"dark"===u}):i?(0,m.jsx)(eN.s,{bg:c.iconBgColor,borderRadius:"md",children:(0,m.jsx)(nq._,{filter:c.invertFilter,src:i.src,w:"100%",maxW:"100%",alt:l(),pointerEvents:"none"})}):a?(0,m.jsx)(nq._,{src:a.src,borderRadius:"sm",h:"1.5em",w:"1.5em",objectFit:"contain",pointerEvents:"none"}):(0,m.jsx)(f.az,{color:c.iconColor,fontSize:"xl",children:n&&(0,m.jsx)(j.g,{icon:n})})}),s&&(0,m.jsx)(nK.E,{position:"absolute",top:"1",insetEnd:"2",colorScheme:"green",children:s()}),(0,m.jsxs)(eX.B,{spacing:0,whiteSpace:"break-spaces",flex:"1",textAlign:"center",children:[(0,m.jsx)(z.E,{color:c.textColor,fontWeight:"600",fontSize:"xs",lineHeight:1.2,noOfLines:2,children:l()}),r&&(0,m.jsx)(z.E,{fontSize:"xs",color:"gray.500",fontWeight:"500",children:r})]})]})},ox=(0,F.memo)(function(e){let{editor:t,appendCard:l}=e,{isInOfflineMode:a}=(0,t9.u)(),n={bgColor:(0,ng.dU)("gray.50","blackAlpha.900")};return(0,m.jsx)(eX.B,{p:2,bg:n.bgColor,children:nG().map(e=>{let{subcategory:n,items:o}=e,i=o.filter(e=>!(0,nV.gT)(t,e,!1,a));if(0!==i.length)return(0,m.jsxs)(eX.B,{spacing:1,children:[(0,m.jsx)(eI._x,{flex:"1",textAlign:"left",children:n}),(0,m.jsx)(nH.x,{gap:"1.5",gridTemplateColumns:"1fr 1fr 1fr",children:i.map(e=>(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(em.x6,{id:"BPbkIF"}),placement:"top",children:(0,m.jsx)(f.az,{cursor:"pointer",onClick:()=>{l(e.key)},borderRadius:"xl",_hover:{boxShadow:"lg"},transitionProperty:"box-shadow",transitionDuration:"normal",children:(0,m.jsx)(ow,{item:e})})},e.key))})]},n)})})}),oS=(0,F.memo)(function(e){let{editor:t,getPos:l,display:a,isNested:n}=e,o=(0,nR.fW)(),{isInOfflineMode:i}=(0,t9.u)(),r=(0,nN.FX)(),s=(0,ej.u)("aiRewrite")&&!r,d=(0,F.useCallback)(e=>{let a=nU(),n=l(),o=t.view.state.doc.nodeAt(n);if(!o){console.error("[CardDivider] Cannot append card. Node unknown");return}let i=n+o.nodeSize,r=(0,nM.G)().blankCard;e&&(r=(0,nM.G)()[e]);let s="aiCardAfter"===e?tE.oU.CARD_DIVIDER_AI:e?tE.oU.CARD_DIVIDER_DROPDOWN:tE.oU.CARD_DIVIDER,d="aiCardAfter"===e?{key:"aiCardAfter",nodeName:"card"}:e?a[e]:a.blankCard;(0,n_.Jb)(d,s),t.chain().insertContentAt(i,ar(r)).command(e=>{let{tr:t}=e;return t.setMeta(nP,!0),!0}).focus().selectInsertedNode().run()},[t,l]),u=(0,ng.dU)("gray.100","gray.700"),c=(0,ng.dU)(!1,!0),f=(0,ej.u)("addCard2");return(0,m.jsx)(tr.W,{isLazy:!0,children:e=>{let{isOpen:l}=e;return(0,m.jsx)(eN.s,{contentEditable:!1,suppressContentEditableWarning:!0,className:"card-divider","data-is-nested-card":String(n),position:"absolute",zIndex:eO.cardDivider,bottom:-4,w:"100%",justify:"center",align:"center",display:a,opacity:l?1:0,transitionProperty:"opacity",transitionDuration:"normal","data-print-hidden":!0,"data-id":"card-divider",children:(0,m.jsxs)(ed.e,{size:"sm",isAttached:!0,"data-guider-highlight":"add-card-button",className:"card-divider-button-group",variant:"plain",shadow:"md",borderRadius:"md",opacity:"1",transitionProperty:"opacity",transitionDuration:"normal",dir:o?"rtl":"ltr",children:[(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(em.x6,{id:"7iE+3N"}),children:(0,m.jsx)(e9.K,{className:"insert-card-button",variant:"plain","aria-label":ef.Ru._({id:"g+7nXG"}),icon:(0,m.jsx)(j.g,{icon:lb.QLR}),onClick:()=>d(),onMouseDown:e3.JL,size:"sm",shadow:"none",borderRadius:"md",minW:12,transitionProperty:"none",borderColor:u})}),s&&(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(em.x6,{id:"kLZLXX"}),children:(0,m.jsx)(e9.K,{className:"insert-ai-card-button",variant:"plain","aria-label":ef.Ru._({id:"g+7nXG"}),icon:(0,m.jsx)(C.z,{spacing:0,opacity:i?.3:1,children:(0,m.jsx)(j.g,{icon:lb.p7g})}),onClick:()=>{if(!i){if(f){d("aiCardAfter");return}e4.LF.emit("queueDesignPartnerTask",{message:ef.Ru._({id:"JoMQgx",values:{placeholder:""}}),submit:!1})}},onMouseDown:e3.JL,size:"sm",shadow:"none",minW:12,transitionProperty:"none",borderColor:u,borderRadius:"md",borderInlineStart:"none",borderInlineEndRadius:"none",tabIndex:i?-1:void 0,pointerEvents:i?"none":"auto"})}),(0,m.jsxs)(eq.A,{placement:"end",isLazy:!0,closeOnBlur:!0,closeOnEsc:!0,children:[(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(em.x6,{id:"UgOs5x"}),shouldWrapChildren:!0,children:(0,m.jsx)(eK.W,{children:(0,m.jsx)(e9.K,{"aria-label":"Add from template",size:"sm",shadow:"none",borderColor:u,icon:(0,m.jsx)(eH.D,{}),fontSize:"lg",fontWeight:"500",borderRadius:"md",borderInlineStart:"none",borderInlineStartRadius:"none","data-guider-highlight":"add-card-template-button",transitionProperty:"none",onMouseDown:e3.JL})})}),(0,m.jsx)(eJ.Z,{children:(0,m.jsx)(e$.h,{shadow:"xl",maxH:"90vh",overflowY:"scroll",w:"400px",p:"0",borderColor:c?u:void 0,children:(0,m.jsx)(ox,{editor:t,appendCard:d})})})]})]})})}})});var oA=l(28997),oC=l(43421),oz=l(17228),oI=l.n(oz);let oj=()=>{let e=(0,J.GV)(es.wC)===ok.w.SLIDE_VIEW,{src:t,width:l,height:a,paddingY:n,paddingX:o}=oT();if(!t)return null;let i=(0,ty.Ub)(t,ty.oc),r=e?{position:"absolute",right:"".concat(o,"px"),top:"".concat(n,"px"),justify:"end",align:"start",width:"".concat(l,"px"),height:"".concat(a,"px")}:{position:"sticky",left:"".concat(o,"px"),top:"calc(100% - ".concat(a,"px - ").concat(n,"px)"),justify:"start",width:"".concat(l,"px"),height:"".concat(a,"px")};return(0,m.jsx)(eN.s,{...r,className:"logo",zIndex:eO.customerLogo,borderRadius:"md",contentEditable:!1,userSelect:"none",children:(0,m.jsx)(nq._,{src:i,maxH:"100%",maxW:"100%",transitionProperty:"width, height",transitionDuration:"normal",pointerEvents:"none","data-testid":"customer-logo","data-customer-logo-image":!0,objectFit:"contain",objectPosition:e?"top right":"bottom left"})})},oF=()=>{let{src:e,width:t,height:l}=oB((0,J.GV)(es.SJ),oE);if(!e)return null;let a=(0,ty.Ub)(e,ty.oc);return(0,m.jsx)(eN.s,{w:"100%",justify:"center",align:"center",mt:6,mb:8,"data-id":"customer-logo-wrapper",children:(0,m.jsx)(nq._,{src:a,w:"".concat(t,"px"),zIndex:eO.customerLogo,h:"".concat(l,"px"),transitionProperty:"width, height",transitionDuration:"normal",pointerEvents:"none",objectFit:"contain",objectPosition:"bottom"})})},oB=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:oM,l=1,a=e.logoUrl,{logoImage:n}=e.config;if(n&&n.meta){var o;l=oI()(n.meta.aspect_ratio||n.meta.width/n.meta.height,.5,3),a=null!==(o=n.src)&&void 0!==o?o:a}if(!a)return{width:0,height:0,paddingY:0,paddingX:0};let i=Math.sqrt(t/l),r=t>8e3?30:t>5e3?24:18;return{width:Math.round(i*l),height:Math.round(i),paddingY:r,paddingX:r,src:a}},oR={base:900,lg:2500,xl:4900,"2xl":8100,"3xl":1e4},o_={base:1600,md:2500,lg:4225,xl:7225,"2xl":9025,"4xl":12100},oM=4900,oE=5625,oT=()=>{let e=(0,J.GV)(es.wC)===ok.w.SLIDE_VIEW,t=(0,oC.A)(e?o_:oR),l=nI.rS?oM:nI.hQ?8100:t,a=(0,J.GV)(es.SJ),n=(0,nN.FX)();return{...oB(a,l),position:e?"top-right":n?"bottom":"bottom-left"}},oO=e=>{let{isFocused:t}=e;return(0,m.jsx)(f.az,{position:"absolute",inset:"0",pointerEvents:"none",overflow:"hidden",display:{base:"none",lg:"block"},opacity:t?1:0,className:"card-height-guide",children:(0,m.jsxs)(f.az,{position:"absolute",top:"var(--card-min-height)",insetStart:"0",w:"100%",h:"1px",borderBottom:"2px dashed",borderBottomColor:"var(--body-color)",opacity:"0.25",children:[(0,m.jsx)(oP,{insetStart:0}),(0,m.jsx)(oP,{insetEnd:0})]})})},oP=e=>{let{cardDimensions:t}=(0,J.GV)(es.Uu),{label:l}=(0,at.iI)(t);return(0,m.jsx)(eI.Tz,{placement:"top",w:"250px",label:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(z.E,{children:["Your content is too tall to fit the ",l()," size, so it may shrink or overflow when presenting or exporting."]}),(0,m.jsx)(z.E,{color:"gray.500",children:(0,m.jsx)(em.x6,{id:"yrOr7z"})})]}),children:(0,m.jsx)(f.az,{position:"absolute",w:"var(--card-inner-padding-x)",h:"".concat(20,"px"),top:"-".concat(10,"px"),pointerEvents:"auto",cursor:"help",...e})})};var oN=l(62230),oD=l(22938),oL=l(27559),oW=l(70403),oU=l(44507);let oG=(0,F.memo)(e=>{let{children:t,...l}=e,a=(0,J.GV)((0,lK.lp)("right"));return(0,oU.Xb)()?null:(0,m.jsx)(f.az,{position:"fixed",bottom:4,insetInlineEnd:a+4,zIndex:"overlay","data-print-hidden":!0,...l,children:t})});oG.displayName="HelpWidgetWrapper";var oH=l(81575),oV=l(32133);let oq=new eD.b,oK=(e,t)=>{let l=(0,J.KA)().getState(),a=(0,es.sX)(l);null===tE.zS||void 0===tE.zS||tE.zS.track(e,{docId:a,...t})};var oJ=l(23071),o$=l(7908);let oQ=e=>{let{selectedLocale:t,onLocaleSelect:l,buttonProps:a,menuListProps:n,matchWidth:o=!0,hideLabel:i=!1}=e,r=(0,ej.u)("i18nEnabled");return(0,em.uB)(),(0,m.jsx)(eN.s,{direction:"column",children:(0,m.jsxs)(tr.W,{matchWidth:o,children:[(0,m.jsx)(ts.I,{as:eu.$,rightIcon:i?null:(0,m.jsx)(j.g,{size:"xs",icon:ec.Jt$}),textAlign:"left",w:"100%",...a,children:i?null:(null==t?void 0:t.displayName)||"Unknown"}),(0,m.jsx)(td.c,{minWidth:"240px",maxH:"500px",overflowY:"auto",overflowX:"hidden",...n,children:(0,m.jsx)(tu.i,{value:(null==t?void 0:t.key)||"unknown",type:"radio",onChange:e=>{l(e)},children:(0,o$.qm)().map(e=>{let t=new Date(lI.zd[e.key].launchDate),l=!r&&"private_beta"===lI.AT[e.key],a=r&&"private_beta"===lI.AT[e.key],n="public_beta"===lI.AT[e.key]&&Date.now()-t.getTime()<2592e6;return(0,m.jsx)(tc.k,{value:e.key,isDisabled:l,children:(0,m.jsxs)(eN.s,{flex:1,alignItems:"center",children:[(0,m.jsxs)(eX.B,{spacing:0,children:[(0,m.jsx)(z.E,{fontWeight:"600",children:e.displayName}),(0,m.jsx)(z.E,{fontSize:"sm",color:"gray.500",children:e.displayNameLocalized(ef.Ru._.bind(ef.Ru))})]})," ",(0,m.jsx)(ez.h,{}),l?(0,m.jsx)(nK.E,{ml:2,fontSize:"0.75em",colorScheme:"blue",children:(0,m.jsx)(em.x6,{id:"VZeG/A"})}):a?(0,m.jsx)(nK.E,{ml:2,fontSize:"0.75em",colorScheme:"trueblue",children:(0,m.jsx)(em.x6,{id:"YBt9YP"})}):n?(0,m.jsx)(nK.E,{ml:2,fontSize:"0.75em",colorScheme:"green",children:(0,m.jsx)(em.x6,{id:"isRobC"})}):null]})},e.key)})})})]})})};var oY=l(83073),oX=l(67359);let oZ=e=>{var t;let{onClose:l}=e,a=(0,eQ.d)(),{user:n}=(0,ac.ur)(),[o,i]=(0,F.useState)(!1),{setSettings:r}=(0,ac.ur)(),s=(0,oY.O)(),d=(0,F.useMemo)(()=>s,[]),[u,c]=(0,F.useState)(d);(0,oX.O)(u);let f=(0,F.useCallback)(async()=>{i(!0);try{await (null==r?void 0:r({set:{locale:u}})),a({title:(0,m.jsx)(em.x6,{id:"RRo9kN"}),position:"top",status:"success",isClosable:!0,duration:3e3}),l()}catch(e){console.error('[StandaloneLocaleModal.onSave] Error updating language for user with id "'.concat(null==n?void 0:n.id,'"'),e.message)}i(!1)},[u,l,r,a,null==n?void 0:n.id]),p=u!==(null==n?void 0:null===(t=n.settings)||void 0===t?void 0:t.locale);return(0,m.jsx)(eI.L8,{isDark:!1,children:(0,m.jsxs)(lk.aF,{isOpen:!0,onClose:l,children:[(0,m.jsx)(tq.m,{}),(0,m.jsxs)(lw.$,{children:[(0,m.jsx)(t$.r,{children:(0,m.jsx)(em.x6,{id:"+DEogc"})}),(0,m.jsx)(tJ.s,{}),(0,m.jsx)(tQ.c,{children:(0,m.jsxs)(lx.MJ,{children:[(0,m.jsx)(lS.l,{children:(0,m.jsx)(em.x6,{id:"M3JKNC"})}),(0,m.jsx)(oQ,{selectedLocale:lI.zd[u],onLocaleSelect:c})]})}),(0,m.jsx)(lA.j,{children:p?(0,m.jsxs)(ed.e,{children:[(0,m.jsx)(eu.$,{variant:"ghost",onClick:l,children:(0,m.jsx)(em.x6,{id:"dEgA5A"})}),(0,m.jsx)(eu.$,{variant:"solid",onClick:f,isLoading:o,children:(0,m.jsx)(em.x6,{id:"tfDRzk"})})]}):(0,m.jsx)(eu.$,{variant:"plain",onClick:l,children:(0,m.jsx)(em.x6,{id:"yz7wBu"})})})]})]})})};var o0=l(43006),o1=l(39698),o2=l(78776),o6=l(87747),o4=l(54268),o5=l(92405),o3=l(28710),o8=l(33639);let o7=function(){let{initializeViaQuery:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{initializeViaQuery:!1},t=(0,J.jL)(),l=(0,F.useCallback)(()=>{let e=window.zE;e&&(e("messenger","open"),t((0,o8.nF)({isOpen:!0})))},[t]);return(0,F.useEffect)(()=>{e&&"true"===(0,o5.sF)()["get-support"]&&l()},[e,l]),(0,F.useEffect)(()=>{let e=o4.yb(()=>{window.zE&&(0,o3.J)()},27e6);return(0,o3.J)(),()=>{o4.vG(e)}},[]),l};var o9=l(62849),ie=l(30504);let it=e=>(0,o9.En)()?(0,m.jsx)(ia,{...e}):null,il=(0,F.memo)(e=>{var t;let{showShortcuts:l=!0,showOnboardingChecklist:a=!1}=e,n=(0,oV.wA)(),{isConnected:o}=(0,t9.u)(),i=(0,ej.u)("intercom"),r=(0,ej.u)("zendesk"),s=(0,ej.u)("shareFeedback"),d=(0,o0.k)(),u=o7(),c=(0,oY.O)(),{isOpen:p,onOpen:g,onClose:h}=(0,tH.j)(),{isOpen:b,onOpen:y,onClose:v}=(0,tH.j)({id:"locale-modal"}),{onOpen:k}=(0,tH.j)({id:"help-menu"}),[w,x]=(0,lF.M)("hasUnreadIntercom",!1),S=window.Intercom,A=window.zE,C=(0,F.useCallback)(()=>{x(!1),r?u():i?d():console.error("No help widget is enabled")},[i,r,d,u,x]),z=(0,o6.rd)();return(0,F.useEffect)(()=>{A&&(A("messenger:on","unreadMessages",e=>{x(e>0)}),A("messenger:on","close",()=>{n((0,o8.nF)({isOpen:!1}))}))},[A,n,x]),(0,F.useEffect)(()=>{if(!S)return;S("onHide",()=>{n((0,o1.YN)({isOpen:!1}))});let e=setInterval(()=>{document.querySelector("iframe.intercom-borderless-frame")&&x(!0)},1e3);return()=>{S("hide"),clearInterval(e)}},[n,S,x]),(0,m.jsxs)(eI.L8,{isDark:z,children:[(0,m.jsxs)(tr.W,{children:[(0,m.jsx)(ts.I,{"data-guider-highlight":"default-help-widget-activator",as:e9.K,onClick:()=>{k(),oq.emit("toggleOpen",{behavior:"close",skipTracking:!0})},isRound:!0,position:"relative",size:"md","aria-label":ef.Ru._({id:"c3XJ18"}),icon:w?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(f.jl,{position:"absolute",size:2.5,bg:"red.400",top:0,right:0}),(0,m.jsx)(j.g,{icon:ec.z$e,className:"fa-beat-fade"})]}):(0,m.jsx)(j.g,{icon:ec.EvL})}),(0,m.jsxs)(td.c,{children:[(0,m.jsxs)(lm.r,{children:[l&&(0,m.jsx)(lg.D,{onClick:g,icon:(0,m.jsx)(j.g,{fixedWidth:!0,icon:ec.Lhe}),children:(0,m.jsx)(em.x6,{id:"77Emn0"})}),a&&(0,m.jsx)(lg.D,{as:eY.N,_hover:{textDecoration:"none",shadow:"none"},onClick:()=>{oK(tE.VV.ONBOARDING_CHECKLIST_WIDGET_CHECKLIST_MANUAL_OPENED),oq.emit("toggleOpen",{behavior:"open"})},icon:(0,m.jsx)(j.g,{fixedWidth:!0,icon:ec.S3S}),"data-guider-highlight":"onboarding-checklist",children:(0,m.jsx)(em.x6,{id:"BOFovM"})}),(0,m.jsx)(lg.D,{as:eY.N,_hover:{textDecoration:"none",shadow:"none"},href:"https://ideas.gamma.app/changelog",target:"_blank",icon:(0,m.jsx)(j.g,{fixedWidth:!0,icon:ec.kLe}),children:(0,m.jsx)(em.x6,{id:"PbLEFQ",values:{GAMMA_PROPER_NOUN:lG.On}})})]}),(0,m.jsx)(oH.N,{}),(0,m.jsxs)(lm.r,{children:[(0,m.jsx)(lg.D,{as:eY.N,_hover:{textDecoration:"none",shadow:"none"},href:"https://help.gamma.app",target:"_blank",icon:(0,m.jsx)(j.g,{fixedWidth:!0,icon:ec.$UM}),children:(0,m.jsx)(em.x6,{id:"CRzGla"})}),i&&o?(0,m.jsx)(lg.D,{icon:w?(0,m.jsxs)(f.az,{position:"relative",children:[(0,m.jsx)(f.jl,{position:"absolute",size:1.5,bg:"red.400",top:0,right:-1}),(0,m.jsx)(j.g,{fixedWidth:!0,icon:ec.z$e,className:"fa-beat-fade"})]}):(0,m.jsx)(j.g,{fixedWidth:!0,icon:ec.gSF}),onClick:C,children:(0,m.jsx)(em.x6,{id:"mpby9d"})}):(0,m.jsx)(lg.D,{icon:(0,m.jsx)(j.g,{fixedWidth:!0,icon:ec.y_8}),as:eY.N,_hover:{textDecoration:"none",shadow:"none"},href:"mailto:".concat(oJ.J),children:(0,m.jsx)(em.x6,{id:"A0C9La"})}),s&&(0,m.jsx)(lg.D,{as:eY.N,_hover:{textDecoration:"none",shadow:"none"},href:"https://ideas.gamma.app/ideas",target:"_blank",icon:(0,m.jsx)(j.g,{fixedWidth:!0,icon:ec.O3E}),children:(0,m.jsx)(em.x6,{id:"u5hSeG"})})]}),(0,m.jsx)(oH.N,{}),(0,m.jsx)(lm.r,{children:(0,m.jsx)(lg.D,{icon:(0,m.jsx)(j.g,{fixedWidth:!0,icon:ec.Bwz}),onClick:y,children:(null===(t=lI.zd[c])||void 0===t?void 0:t.displayName)||"Unknown"})})]}),(0,m.jsx)(ie.a,{isOpen:p,onClose:h})]}),b&&(0,m.jsx)(oZ,{onClose:v})]})}),ia=(0,o2.A)(il);it.displayName="DefaultHelpWidget";let io={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/Stars-2.48f5ca51.svg"},ii={background:"linear-gradient(170deg, var(--chakra-colors-pink-100) 0%, var(--chakra-colors-salmon-100) 30% , var(--chakra-colors-orange-50) 100%)"},ir={background:"linear-gradient(170deg, var(--chakra-colors-pink-900) 0%, var(--chakra-colors-salmon-900) 30% , var(--chakra-colors-purple-900) 100%)"},is=(0,nC.i7)({"0%":{maskPosition:"0% 50%"},"50%":{maskPosition:"100% 50%"},"100%":{maskPosition:"0% 50%"}});(0,F.memo)(e=>{let{children:t,...l}=e;return(0,o9.En)()?(0,m.jsxs)(eN.s,{w:"100%",minH:"100%",bgSize:"cover",bgPosition:"center center",...ii,position:"relative",pt:4,className:"ai-page-wrapper",flex:"1",...l,children:[(0,m.jsx)(f.az,{position:"fixed",zIndex:0,pointerEvents:"none",top:"0",width:"0",w:"100vw",minH:"var(--100vh)",bg:"url(".concat(io.src,")"),bgRepeat:"repeat",bgPosition:"center center",sx:{animation:"".concat(is," 180s linear infinite"),maskImage:"linear-gradient(to left, rgba(0,0,0,.75), transparent, rgba(0,0,0,.75))",maskRepeat:"repeat",maskSize:"140px"}}),(0,m.jsx)(f.az,{zIndex:1,w:"100%",flex:"1",children:t}),(0,m.jsx)(oG,{children:(0,m.jsx)(it,{showShortcuts:!1})})]}):null}).displayName="AIPageWrapper";var id=l(79574);let iu=e=>{let{isDark:t,templateIcon:l,tooltip:a,label:n,isSelected:o,onClick:i,...r}=e;return(0,m.jsx)(eI.Tz,{label:a,placement:"top",children:(0,m.jsx)(e9.K,{onClick:i,icon:(0,m.jsxs)(eX.B,{maxW:"100%",alignItems:"center",children:[l,n&&(0,m.jsx)(z.E,{maxW:"100%",w:"100%",fontSize:"xs",overflow:"hidden",textOverflow:"ellipsis",overflowX:"hidden",whiteSpace:"nowrap",textAlign:"left",children:n})]}),h:"auto",textShadow:"none",variant:"plain",p:2,flex:"1",w:"100%",cursor:"pointer",textAlign:"center",transition:"all 300ms ease",border:"1px solid",bg:t?o?"trueblue.900":"whiteAlpha.50":o?"trueblue.50":"blackAlpha.50",borderRadius:"md",boxShadow:"sm",borderColor:t?o?"trueblue.300":"whiteAlpha.100":o?"trueblue.500":"blackAlpha.100",color:t?o?"trueblue.200":"gray.400":o?"trueblue.500":"gray.500",_hover:{bg:t?o?"whiteAlpha.100":"whiteAlpha.200":o?"trueblue.100":"trueblue.50",borderColor:t?"trueblue.200":o?"trueblue.500":"trueblue.200"},position:"relative","aria-label":a,...r})})},ic=e=>{let{isDark:t,selectedTemplate:l,setSelectedTemplate:a,isDisabled:n}=e,o=nl(),i=t?"invert(.8) brightness(1.2)":"invert(0)",r=t?"invert(.8) brightness(2)":"invert(0)";return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(z.E,{color:"var(--body-color-muted)",fontSize:"sm",fontFamily:"Inter",fontWeight:"normal",children:(0,m.jsx)(em.x6,{id:"hQDrYd"})}),(0,m.jsxs)(tf.r,{spacing:2,columns:[2,3,5,o.length+1],children:[(0,m.jsx)(iu,{isDark:t,templateIcon:(0,m.jsx)(j.g,{icon:lh.swh,fixedWidth:!0,size:"lg"}),label:(0,m.jsx)(em.x6,{id:"wtGmzA"}),tooltip:ef.Ru._({id:"ERTBmO"}),isSelected:null===l,onClick:()=>a(null),isDisabled:n}),o.map(e=>{let{key:o,image:s,name:d}=e,u=o===l;return(0,m.jsx)(iu,{isDark:t,templateIcon:(0,m.jsx)(nq._,{src:s.src,filter:u?r:i,bg:"white"}),tooltip:d,isSelected:u,onClick:()=>a(o),isDisabled:n},o)})]})]})},im=e=>{let{theme:t,handle:l,editor:a,getPos:n,input:o,displayFullBleed:i,isFocused:r}=e,{isInOfflineMode:s}=(0,t9.u)(),{isGenerating:d,getContextAndGenerate:c,updateInput:p,locale:g}=no({theme:t,editor:a,getPos:n,input:o}),h=(0,o9.lW)(p,500),{prompt:b,template:y}=o,[v,k]=(0,F.useState)(b),w=(0,lq.tO)(()=>{p({prompt:v}),c(v)},"generateCard",tE.VV.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GENERATE_CARD),x=(0,ng.dU)(!1,!0),S=(0,F.useRef)(null),{suggestions:A,generateSuggestionsStatus:I}=ni(a,r);if((0,F.useEffect)(()=>{r&&S.current&&setTimeout(()=>{var e;null===(e=S.current)||void 0===e||e.focus()})},[r]),d)return(0,m.jsxs)(eN.s,{position:"relative",maxW:"100%",w:"var(--card-width)",minH:32,contentEditable:"false",justify:"center",direction:"column",p:"var(--card-inner-padding)",children:[l,(0,m.jsxs)(eX.B,{zIndex:1,w:"100%",children:[(0,m.jsx)(oN.E,{height:"3em",w:"33%",mb:4}),(0,m.jsx)(oN.E,{height:"1.5em"}),(0,m.jsx)(oN.E,{height:"1.5em"}),(0,m.jsx)(oN.E,{height:"1.5em"}),(0,m.jsx)(oN.E,{height:"1.5em",w:"75%"})]})]});let B=x?ir:ii;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(u.$p,{style:{position:"absolute",opacity:0}}),(0,m.jsxs)(eN.s,{contentEditable:"false",w:"var(--card-width)",maxW:"100%",minH:32,position:"relative",borderRadius:i?"none":"var(--card-border-radius)",p:"var(--card-inner-padding)",direction:"column",justify:"center",m:"-1px",fontFamily:"Inter, sans-serif",onMouseDown:e=>{!(e.target instanceof HTMLElement&&e.target.closest(".drag-handle"))&&(e.preventDefault(),S.current&&S.current===document.activeElement?S.current.blur():a.view.hasFocus()&&a.commands.blur())},children:[(0,m.jsx)(f.az,{...B,bgSize:"cover",bgPosition:"center center",borderRadius:"inherit",pos:"absolute",inset:0,pointerEvents:"none",w:i?"var(--editor-width)":void 0,left:i?"calc(50% - var(--doc-padding-left, 0px) / 2 + var(--doc-padding-right, 0px) / 2)":void 0,transform:i?"translateX(-50%)":void 0}),l,(0,m.jsx)(f.az,{position:"absolute",zIndex:0,pointerEvents:"none",inset:0,bgImage:"url(".concat(io.src,")"),bgRepeat:"repeat",bgPosition:"center center",sx:{animation:"".concat(is," 180s linear infinite"),maskImage:"linear-gradient(to left, rgba(0,0,0,.75), transparent, rgba(0,0,0,.75))",maskRepeat:"repeat",maskSize:"140px"},opacity:x?.2:1}),(0,m.jsx)(e9.K,{position:"absolute",top:2,right:2,variant:"ghost",colorScheme:x?"gray":"blackAlpha",isRound:!0,size:"sm","aria-label":ef.Ru._({id:"DIQZR1"}),icon:(0,m.jsx)(j.g,{fixedWidth:!0,icon:ec.GRI}),onClick:()=>{h.cancel(),a.commands.deleteCard(n())}}),(0,m.jsxs)(eX.B,{spacing:4,pos:"relative",zIndex:1,maxWidth:"100%",children:[(0,m.jsxs)(C.z,{justify:"end",flexWrap:"wrap",children:[(0,m.jsx)(z.E,{fontFamily:"p22-mackinac-pro, sans-serif",fontWeight:700,fontSize:"2xl",color:x?"white":"gray.800",children:(0,m.jsx)(em.x6,{id:"8e1wQN"})}),(0,m.jsx)(nK.E,{colorScheme:"green",children:"Beta"}),(0,m.jsx)(ez.h,{}),(0,m.jsx)(id.f,{modalId:"ai-credits-modal-generate-card",variant:"ghost",isDark:x,justify:"flex-end",segmentEvent:tE.VV.GAMMA_UPSELL_CALLOUT_AI_CREDITS_GENERATE_CARD}),(0,m.jsx)(lU,{locale:g,setLocale:e=>p({settings:{locale:e}}),buttonProps:{variant:"plain",size:"sm",textAlign:"left",w:["100%","100%","auto"],isDisabled:s}})]}),(0,m.jsxs)(lf.M,{color:x?"white":"gray.800",bg:x?"blackAlpha.900":"white",boxShadow:"sm",border:"none",borderRadius:"md",display:"flex",alignItems:"start",gap:"0",onMouseDown:e3.dG,_focusWithin:{boxShadow:"var(--chakra-shadows-sm), var(--chakra-shadows-outline)"},transitionProperty:"box-shadow",transitionDuration:"normal",children:[(0,m.jsx)(ly._,{ref:S,"data-in-editor-focus":!0,fontWeight:"500",border:"none",fontSize:"lg",initialHeight:"4rem",placeholder:ef.Ru._({id:"BiLwIi"}),value:v,isDisabled:s,onChange:e=>{k(e.target.value),h({prompt:e.target.value})},onKeyDown:e=>{e.shiftKey||("Enter"===e.key?w():"ArrowDown"!==e.key||v?"ArrowUp"!==e.key||v||a.chain().focus(n()).selectInsideNextCard(!1).run():a.chain().focus(n()).selectInsideNextCard(!0).run())},_focus:{boxShadow:"none"},_focusVisible:{boxShadow:"none"},p:5}),(0,m.jsx)(oD.r0,{h:"100%",border:"none",color:x?"white":"gray.800",bg:x?"blackAlpha.900":"white",p:3,pl:0,alignItems:"end",display:["none","none","flex"],children:(0,m.jsxs)(eu.$,{variant:"solid","aria-label":"Generate card",isDisabled:!v||s,onClick:w,onMouseDown:e3.Fw,children:[(0,m.jsx)(lV.G,{type:"generateCard",ml:0,mr:2}),(0,m.jsx)(j.g,{icon:lb.isI})]})})]}),(0,m.jsxs)(eu.$,{variant:"solid","aria-label":"Generate card",isDisabled:!v,onClick:w,onMouseDown:e3.Fw,display:["flex","flex","none"],leftIcon:(0,m.jsx)(j.g,{icon:lb.isI}),children:[(0,m.jsx)(em.x6,{id:"ziAjHi"}),(0,m.jsx)(lV.G,{type:"generateCard",ml:0,mr:2})]}),(0,m.jsx)(oL.S,{in:!v&&!s&&(A.length>0||"generating"===I),children:(0,m.jsxs)(C.z,{direction:["column","row"],spacing:2,wrap:"wrap",children:[null==A?void 0:A.map((e,t)=>(0,m.jsx)(oW.vw,{as:eu.$,variant:"subtle",colorScheme:x?"whiteAlpha":"blackAlpha",color:x?"whiteAlpha.700":"blackAlpha.700",p:1,px:2,minH:"auto",h:"auto",onClick:()=>{k(e),p({prompt:e})},children:(0,m.jsx)(oW.d1,{children:e})},t)),"generating"===I&&(0,m.jsxs)(oW.vw,{variant:"subtle",colorScheme:x?"whiteAlpha":"blackAlpha",color:x?"whiteAlpha.500":"blackAlpha.500",children:[(0,m.jsx)(oW.Vz,{boxSize:"12px",as:nk.y}),(0,m.jsx)(oW.d1,{children:(0,m.jsx)(em.x6,{id:"AUV+TY"})})]})]})}),(0,m.jsx)(ic,{isDark:x,selectedTemplate:y,setSelectedTemplate:e=>p({template:e}),isDisabled:s})]})]})]})},ip=e=>{let{displayLayout:t,children:l,isExpandableSelected:a,isFocused:n,displayFullBleed:o,isPresentMode:i,isEditable:r,isNested:s,attrs:d,hasLayoutItem:u,cardAccentBackgroundMaskEffect:c,onDoubleClick:p,cardDimensions:g,theme:h,handle:b,editor:y,getPos:v,updateAttributes:k}=e;if(d.generatorInput&&"done"!==d.generatorInput.status&&r)return(0,m.jsx)(im,{theme:h,handle:b,editor:y,getPos:v,input:d.generatorInput,updateAttributes:k,displayFullBleed:o,isFocused:n});let w=(0,el.lH)(t),x=(0,el.tZ)(t),S=d.layoutTemplateColumns,A=d.layoutTemplateRows,C=(0,oA.X)(h)&&i&&!s&&"right"!==t&&"top"!==t&&!("behind"==t&&"none"===c),z=r&&g.aspectRatio&&!s&&(!d.fontScale||d.fontScale===er.o5);return(0,m.jsxs)(f.az,{className:(0,I.cx)(tG.fJ,a&&"expandable-selected"),onDoubleClick:p,w:"var(--card-width)",maxW:"100%",position:"relative",spellCheck:n,cursor:"auto",color:"var(--body-color)",sx:{["> .".concat(er._P)]:{padding:u?void 0:"var(--card-inner-padding)",counterReset:"footnote",'> [data-node-view-content-inner="card"]':{...u?{display:"grid",alignItems:"stretch",justifyContent:"stretch",minH:"100%",transitionDuration:"".concat(er.M2,"ms"),transitionProperty:"grid-template-rows, grid-template-columns, min-height",...w.grid,...S&&"top"!==t&&w.allowResizing&&{gridTemplateColumns:S},...A&&"top"===t&&w.allowResizing&&{gridTemplateRows:A},...x}:{display:"block",mx:"auto",maxW:"var(--max-content-width)",width:"100%",boxSizing:"border-box",minW:0},"> .node-cardLayoutItem":{"> [data-node-view-wrapper]":{"> .card-layout-cell-bg":{"> [data-node-view-content]":{"> [data-node-view-content-inner]":{maxWidth:"var(--max-content-width)",margin:"auto",paddingRight:C?ig:void 0},padding:"var(--card-inner-padding)"}}}}}},_hover:{"> .card-height-guide":{opacity:1}}},children:[b,l,z&&(0,m.jsx)(oO,{isFocused:n}),C&&(0,m.jsx)(oj,{})]})},ig="\n max(\n 0px,\n calc(\n var(--logo-push-x) - \n max(\n calc((var(--card-width) - var(--max-content-width)) / 2),\n var(--card-inner-padding-x)\n )\n )\n )\n",ih=new eD.b;var ib=l(94445),iy=l(12554);let iv=e=>{let{hasNotes:t,isReadonly:l}=e;return t?l?(0,m.jsx)(em.x6,{id:"nqt+Fj"}):(0,m.jsx)(em.x6,{id:"+kQy/G"}):l?null:(0,m.jsx)(em.x6,{id:"GquPwe"})},ik=e=>{let{cardId:t,decorations:l,editor:a,getPos:n,hasNonEmptyCardNotes:o,isReadonly:i,...r}=e,s=(0,F.useCallback)(()=>{let e=n();if(!i){let{hasCardNotesNode:t}=(0,ei.tg)(l);t||(0,iy.ni)(a,e)}let o=(0,J.KA)(),r=(0,ib.Ix)(o.getState());ih.emit("toggle",{clickedCardId:t,activeNotesCardId:r}),(0,iy.I5)(a,e)||a.commands.selectInsideNodeAtPos(e)},[t,l,i,a,n]),{color:d,bg:u,hoverColor:c,hoverBg:p,borderColor:g}=(0,e8.Nb)();return(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(iv,{hasNotes:o,isReadonly:i}),placement:"top",children:(0,m.jsx)(eu.$,{height:tG.PN,fontWeight:"900",alignItems:"center",fontFamily:"Inter, sans-serif",display:"flex",backdropFilter:"blur(8px)",borderRadius:"sm",borderColor:g,color:d,boxShadow:"sm",cursor:"pointer",pointerEvents:"auto",fontSize:"14px",bg:u,minW:"auto",px:2,_hover:{color:c,background:p},onMouseDown:e3.Fw,onClick:s,...r,children:(0,m.jsx)(f.az,{as:"span",display:"inline-flex",children:(0,m.jsx)(j.g,{icon:o?lb.hZM:ec.hZM})})})})};var iw=l(85888),ix=l(63751),iS=l(1667);let iA=e=>{let t,{isPresentMode:l,isNested:a,isFullBleed:n,displayFullBleed:o,isThumbnail:i,isMobileDevice:r,attrs:s,fontSize:d,nestedDepth:u}=e,{outerPaddingX:c,outerPaddingY:m,outerPaddingLeft:f,outerPaddingRight:p}=(0,iS.ng)({isPresentMode:l,isNested:a,isFullBleed:n,displayFullBleed:o,isThumbnail:i,isMobileDevice:r,attrs:s}),g=(0,iS.Qo)(d||"md"),h=(0,iS.mn)({isMobileDevice:r,numericFontSize:g}),b=h+(0,iS._F)(u);return t=l||i?ix.cK:r?a?ix.rN:ix.HY+(n?ix._0:0):ix.cK+(n?ix.Ri:0),(0,F.useMemo)(()=>({"--card-inner-padding-x":"calc(".concat(h,"em / var(--card-font-scale, 1))"),"--card-inner-padding-y":"calc(".concat(t,"em / var(--card-font-scale, 1))"),"--card-inner-padding":"var(--card-inner-padding-y) var(--card-inner-padding-x)","--card-outer-padding-left":f,"--card-outer-padding-right":p,"--card-outer-padding-x":c,"--card-outer-padding-y":m,"--comment-padding":"".concat(b,"em"),"--nested-card-margin":"calc(-1 * var(--comment-padding))"}),[b,h,t,f,p,c,m])},iC=e=>{let{attrs:t,children:l,presentVariant:a,isPresentMode:n,isDark:o,isNested:i,isThumbnail:r,isFullBleed:s,displayFullBleed:d,isMobileDevice:u,fontSize:c,nestedDepth:f,theme:p,cardDimensions:g,showPresentBackdrop:h,userZoomLevel:b,verticalAlign:y,defaultContentWidth:v,contentWidth:k,docZoomLevel:w}=e,x=iA({isPresentMode:n,isNested:i,isFullBleed:s,displayFullBleed:d,isThumbnail:r,isMobileDevice:u,attrs:t,fontSize:c,nestedDepth:f}),S=(0,iS.X6)(u),A=(0,iw.P)({isPresentMode:n,isNested:i,nestedDepth:f,isFullBleed:s,isThumbnail:r,theme:p,cardDimensions:g,defaultContentWidth:v,contentWidth:k,showPresentBackdrop:h,isMobileDevice:u,fontSize:c,docZoomLevel:w,cardFontScale:t.fontScale}),{background:C,id:z}=t,j=(0,J.GV)(es.b6),F=i||r?void 0:(0,tb.FD)(C,o);return(0,m.jsx)(eN.s,{onDragOver:e3.JO,top:0,left:0,position:"relative",width:"100%",height:"100%",alignItems:"center",justifyContent:"center",cursor:"default","data-animate-value":a,fontSize:"var(--editor-font-size, 1rem)",py:"var(--card-outer-padding-y)",pl:"var(--card-outer-padding-left)",pr:"var(--card-outer-padding-right)","data-card-id":z,"data-card-scroll-element":!0,overflow:n&&!i?"hidden auto":void 0,sx:{scrollbarGutter:!n||i||nI.D1?void 0:"stable"},margin:"0 auto",className:(0,I.cx)(er.QJ,"card-expanded",n&&er.WZ,n&&"card-present-mode card-present-mode--".concat(a)),transitionProperty:"transform, padding",transitionDuration:"".concat(j?er.y0:0,"ms"),...F,css:{...x,...S,...A,"--zoom-level":b,"--card-vertical-align":y},children:l})};iC.displayName="CardContainer";var iz=l(35015);let iI=(0,m.jsx)(j.g,{icon:ec.rMD}),ij=(0,F.memo)(function(e){let{cardId:t,getPos:l,editor:a,isNested:n,isCollapsed:o,isPresentMode:i,isEditable:s,isDark:d,top:u}=e,c=(0,tE.st)(),f=(0,F.useCallback)(()=>{if(i&&!s)a.commands.spotlightCollapseCard(l());else{(0,et.wE)(t,!0);let{selection:e}=a.state,n=(0,r.KP)($.jg)(e);n&&n.node.attrs.id===t&&a.commands.selectNodeAtPos(l())}null==c||c.track(tE.VV.CARD_COLLAPSED,{method:"collapse_button",is_present_mode:!1})},[a,l,c,t,s,i]),p=(0,iz.EC)(),g=(0,F.useMemo)(()=>(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(em.x6,{id:"kBUgVh"}),placement:"top",portalProps:{containerRef:p},children:(0,m.jsx)(e9.K,{variant:"ghost",size:"sm",paddingInlineStart:(0,oU.Xb)()?6:0,paddingInlineEnd:(0,oU.Xb)()?2:0,onClick:f,onMouseDown:e3.Fw,colorScheme:"gray",isRound:!0,"aria-label":ef.Ru._({id:"H86f9p"}),"data-collapse-card-button":!0,icon:iI,color:d?"gray.300":"gray.600"})}),[f,p,d]),h=(0,F.useMemo)(()=>(0,m.jsx)(eu.$,{size:"sm",variant:"ghost",position:"absolute",zIndex:2,bottom:[1,3],right:[2,4],rightIcon:(0,m.jsx)(j.g,{icon:ec.w2A}),colorScheme:"gray","data-collapse-card-button":!0,onMouseDown:e3.Fw,onClick:f,fontWeight:"normal",color:d?"gray.300":"gray.600",children:(0,m.jsx)(em.x6,{id:"H86f9p"})}),[f,d]);return(0,m.jsxs)(eN.s,{contentEditable:!1,onClick:e3.dG,className:"manage-card-controls","data-print-hidden":!0,transitionProperty:"common",transitionDuration:"normal",display:"inherit",fontFamily:"Inter, sans-serif",sx:{"[data-collapse-card-button]":{visibility:n&&!o?"visible":"hidden"}},children:[(0,m.jsx)(C.z,{spacing:1,position:"absolute",top:u||[1,3],insetInlineEnd:[2,4],zIndex:2,children:g}),n&&!o&&h]})}),iF=()=>{let e=(0,eQ.d)(),[t,l]=(0,lF.M)(lB.E.hasSeenPresentModeDblClickNotification,!1),a=(0,J.GV)(es.VJ);return{onDoubleClick:(0,F.useCallback)(()=>{if(!a||t)return;let n=new Date,o=new Date("2024-08-15");n.getTime()>o.getTime()||(l(!0),e({title:(0,m.jsx)(em.x6,{id:"xtaPrg"}),status:"info",position:"bottom",duration:3e3,isClosable:!0}))},[a,t,l,e])}},iB=e=>{let{getPos:t,editor:l,decorations:a}=e,n=(0,ew.f)(e),{isPresentMode:o,isNested:i,isFocused:r,isEditable:s,isMobileDevice:d,cardAccentBackgroundMaskEffect:c,cardId:f,isFullBleed:g,hasNonEmptyCardNotes:h}=n,b=(0,ej.u)("realUserMetrics");(0,eF.XX)(b,f,n.presentVariant,n.prevPresentVariant);let y=(0,eT.JL)(a),v=(0,eP.b0)(a),k=(0,J.GV)((0,tU.C_)(f,"styling")),w=(0,J.GV)((0,tU.C_)(f,"editWithAI")),x=y||v||r,S=s&&(x||w||k),A=(0,ej.u)("cardNotes")&&!i&&!l.isThumbnail&&!l.isStatic&&!d&&!l.shouldUsePublishedVersion&&!o&&(h||s&&x),j=(0,J.GV)((0,q.qw)(f)),{onDoubleClick:F}=iF();return(0,m.jsx)(p.u,{as:"div",style:{minHeight:o&&!i?"100vh":0},hideComments:!0,...e,children:(0,m.jsxs)(iC,{...n,children:[(0,m.jsx)(nB,{...n,children:(0,m.jsxs)(ip,{...n,...e,onDoubleClick:F,handle:(0,m.jsx)(E.A,{...e,"data-testid":"card-drag-handle",zIndex:eO.cardButtons,insetInlineStart:2,top:3,width:"18px",height:tG.PN,label:(0,m.jsxs)(eC.T,{spacing:0,children:[(0,m.jsx)(z.E,{color:"gray.400",children:(0,m.jsx)(em.x6,{id:"63lY3K",components:{0:(0,m.jsx)(z.E,{color:"white",as:"span"})}})}),(0,m.jsx)(z.E,{color:"gray.400",children:(0,m.jsx)(em.x6,{id:"COhrZ5",components:{0:(0,m.jsx)(z.E,{color:"white",as:"span"})}})})]})}),children:[(0,m.jsx)(eG,{...e}),(0,m.jsxs)(C.z,{pos:"absolute",insetInlineStart:8,insetInlineEnd:2.5,zIndex:eO.cardButtons,top:3,align:"start",contentEditable:!1,pointerEvents:"none",spacing:1.5,children:[S&&(0,m.jsx)(lc,{editor:l,getPos:t,...n,accentBackgroundMaskEffect:c}),S&&(0,m.jsx)(nf,{...e,...n}),(0,m.jsx)(ez.h,{}),s?j?(0,m.jsx)(nv,{...e,...n,isDark:n.isDark,isInteracting:x,suggestions:j}):n.attrs.generatorInput?(0,m.jsx)(nS,{...e,...n,isDark:n.isDark,input:n.attrs.generatorInput,isInteracting:x}):null:null,(0,m.jsx)(ez.h,{}),A&&(0,m.jsx)(ik,{editor:l,cardId:f,decorations:a,getPos:t,hasNonEmptyCardNotes:h,isReadonly:!s})]}),(0,m.jsx)(u.$p,{dir:"ltr",className:(0,I.cx)(er._P,r&&"is-focused",i&&"is-nested",(o||g)&&"is-full-width",g&&!i&&!o&&"is-borderless",n.isDark&&"is-dark")}),i&&(0,m.jsx)(ij,{top:[1,3],...n,...e})]})}),(0,m.jsx)(eE,{children:(0,m.jsx)(eI.L8,{isDark:(0,R.Mw)(n.theme),children:(0,m.jsx)(oS,{display:!s||i||o?"none":"flex",editor:l,getPos:t,isNested:i})})})]})})},iR=e=>{let{node:t}=e,{id:l}=t.attrs;return(0,J.GV)((0,es.WS)(l))?(0,m.jsx)(ex,{...e}):(0,m.jsx)(iB,{...e})};(()=>{if(eo)return;let e=ea.n.valid;ea.n.valid=t=>{if(!(0,en.e)(t.doc).cardLayoutsEnabled)return e(t);let l=e(t);return!(l&&(t.nodeAfter&&(0,$.sw)(t.nodeAfter)||t.nodeBefore&&(0,$.sw)(t.nodeBefore)))&&l},eo=!0})();let i_=e=>{if((0,Y.Op)(e)||1===e.childCount&&(0,Y.Op)(e.firstChild))return!0;if("blank"!==e.attrs.layout)return!1;let t=(0,$.dT)(e);if(0===t.length)return!1;let l=t.find(e=>"body"===e.attrs.itemId);return!!l&&1===l.childCount&&(0,Y.Op)(l.firstChild)},iM=e=>{let{newNode:t,newDecorations:l,oldNode:a,oldDecorations:n,updateProps:o}=e,i=JSON.stringify(t.attrs)!==JSON.stringify(a.attrs),r=(0,c.w_)(n,l),s=i_(t)!==i_(a);return(i||r||s)&&(console.debug("[cardUpdateFn] Card ".concat(t.attrs.id," updateProps will be called:"),{oldDecorations:n,newDecorations:l,decorationsChanged:r}),o()),!0},iE=r.bP.create({name:er.Qs,content:"(block | cardBlock)+ | cardLayoutItemGroup{1,2} cardNotes?",group:"cardBlock",defining:!1,isolating:!0,selectable:!1,draggable:!0,priority:Z.y.Card,containerHandle:!0,imageKeyPath:"background.image",expandable:!0,addNodeView(){return(0,u.gu)(iR,{update:iM,ignoreMutation:e=>{let{mutation:t}=e,l=this.editor.state.selection,a=t.target instanceof HTMLElement?t.target:t.target.parentElement,n="selection"!==t.type&&iT(a),o="selection"===t.type&&l instanceof V.nh&&(0,ee.Bv)(l.node);return!!n||!!o}})},addProseMirrorPlugins(){return[(0,ei.qc)(this.editor)]},addOptions:()=>({isStatic:!1}),addAttributes:()=>({id:{},previewContent:{default:null},background:{default:Q.SS,...(0,Y.tb)("background")},container:{default:{},...(0,Y.tb)("container")},cardSize:{default:"default"},layout:{default:"blank",parseHTML:e=>e.getAttribute("image-layout")||e.getAttribute("layout")||"blank"},layoutTemplateColumns:{default:null},layoutTemplateRows:{default:null},verticalAlign:{default:null},generatorInput:{default:null,...(0,Y.tb)("generatorInput")},fontScale:{default:null}}),addExtensions(){return[as.configure({callback:(e,t,l)=>{0!==t.length&&t.forEach(e=>{let{val:t}=e;console.debug("[Card.UniqueCardId] New card id(".concat(t,") created. Will be created in postgres through content service.")),(0,et.wV)(t)})},types:[this.name]})]},addCommands:()=>({}),parseHTML(){return[{tag:"div[class=gamma-card]"},{tag:"section"},{tag:"card[bookmark]",getAttrs:(0,X.Ll)(this.storage),getContent:(0,X.cn)(this.storage)}]},renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,r.KV)(t,{class:"gamma-card"}),0]},addStorage:X.xu,renderHTMLforAI(e){let{node:t}=e,l=(0,et.Wq)(t.attrs.id),a=(0,q.hn)((0,J.KA)().getState());if(!1===l||a)return["section",{"image-layout":t.attrs.layout},0];let n=(0,X.vL)(this.storage,t),o=(0,H.getCardTitle)(t.toJSON()),i=(0,el.o_)(t);return["card",{bookmark:n,title:o,accentPosition:t.attrs.layout,accentImage:(null==i?void 0:i.image)?(0,K.ve)(i.image):void 0}]}}),iT=e=>{var t;return(null==e?void 0:e.parentElement)&&(e.classList.contains(er.QJ)||(null===(t=e.parentElement.closest(".".concat(er._P,", .").concat(er.QJ)))||void 0===t?void 0:t.classList.contains(er.QJ)))};var iO=l(46108),iP=l.n(iO),iN=l(46343),iD=l.n(iN),iL=l(25715),iW=l(20277),iU=l(68566),iG=l(19534);l(93584),l(70734),l(3668),l(56848);let iH=e=>{"card"===e.type&&e.attrs&&delete e.attrs.id},iV=e=>{let t=e=>{var l;return null===(l=e.content)||void 0===l?void 0:l.map(e=>{if(!e.content)return e;let l={...e,attrs:{...e.attrs}};return iH(l),l.content=t(l),l})};return iH(e),Object.assign({},e,{content:t(e)})};var iq=l(17119);let iK=(e,t,l)=>{let a=t.doc.resolve(e),n=t.doc.nodeAt(e),o=e+a.nodeAfter.nodeSize,i=t.doc.resolve(o),r=t.doc.nodeAt(o);if(!r||!(0,$.jg)(r))return!1;let s=n&&(0,iy.eh)(n),d=(0,iy.eh)(r),u=null;d&&(u=s?iX(t.doc,a.pos,!0):n?a.pos+n.nodeSize-1:null);let c=i$(t,o);if(!c)return!1;t.delete(o,o+r.nodeSize);let m=iY(t,e,!0);if(u&&d){let e=(0,iy.PD)(i);if(e){let l=s?e.node.content:e.node;t.insert(u,l),t.setMeta("cardNotesHandled",!0)}}t.insert(m,c.node.content);let f={type:"merge-cards",contentPos:c.pos,insertPos:m};if(t.setMeta("annotationEvent",f),l.selection instanceof ea.n){let e=(0,iU.n)(t.doc.resolve(m));e&&t.setSelection(e)}return!0},iJ=(e,t)=>{let l=t.doc.resolve(e);if(!l.nodeBefore)return!1;let a=e-l.nodeBefore.nodeSize,n=t.doc.nodeAt(a);if(!n||!(0,$.jg)(n))return!1;let o=(0,iy.eh)(n),i=l.nodeAfter&&(0,iy.eh)(l.nodeAfter),r=null;i&&(r=o?iX(t.doc,a,!0):a+n.nodeSize-1);let s=i$(t,e);if(!s)return!1;t.delete(e,e+l.nodeAfter.nodeSize);let d=iY(t,a,!0);if(r&&i){let e=(0,iy.PD)(l);if(e){let l=o?e.node.content:e.node;t.insert(r,l),t.setMeta("cardNotesHandled",!0)}}t.insert(d,s.node.content);let u=(0,iU.n)(t.doc.resolve(d));u&&t.setSelection(u);let c={type:"merge-cards",contentPos:s.pos,insertPos:d};return t.setMeta("annotationEvent",c),!0},i$=(e,t)=>{let l=(0,el.dg)(e,t);return 0===Object.entries(l).length?{node:e.doc.nodeAt(t),pos:t}:l.body||null},iQ=e=>{let t=(0,Y.IV)(e,e=>"cardLayoutItem"===e.type.name&&"body"===e.attrs.itemId||"card"===e.type.name);return 0===t.length?null:t[0]},iY=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=(0,el.dg)(e,t),n=e.doc.resolve(t);if(0===Object.entries(a).length)return l?n.doc.resolve(n.start(n.depth+1)).end():t+1;if(!a.body)throw Error("Could not find card body at cardPos=".concat(t));let o=e.doc.resolve(a.body.pos);return l?o.doc.resolve(o.start(o.depth+1)).end():o.pos+1},iX=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=e.resolve(t),n=(0,iy.PD)(a);if(!n)return null;let o=e.resolve(n.pos);return l?o.doc.resolve(o.start(o.depth+1)).end():o.pos+1},iZ=(e,t)=>{if(!e.empty)return!1;let l=e instanceof ea.n;if(!(0,r.eE)(e)&&!l)return!1;let{from:a,$from:n}=e;if(!t&&0!==n.parentOffset||t&&n.parentOffset!==n.parent.content.size)return!1;let o=iQ(n);if(!o)return!1;if(l)return t?a===o.pos+o.node.nodeSize-1:a===o.pos+1;let i=["paragraph","heading","title"],s=!0;for(let e=n.depth;e>0;e--){let t=n.node(e);if("card"===t.type.name||(0,$.sw)(t))break;if(!i.includes(t.type.name)){s=!1;break}}return!!s&&(t?a===o.pos+o.node.nodeSize-2:a===o.pos+2)},i0=/^(\*\*\*)/,i1=r.YY.create({name:"cardCommands",addCommands:()=>({resetCardSettings:e=>t=>{let{state:l,dispatch:a,chain:n}=t;if(!a)return!0;let o=n();return l.doc.descendants((t,l)=>{(0,iG.jg)(t)&&o.updateNestedAttributesAtPos(l,e)}),!0},splitCardAtSelection:()=>e=>(i2(e),!0),insertNestedCard:()=>e=>{let{state:t,chain:l,dispatch:a,editor:n}=e;if(!a)return!0;let{from:o,$from:i}=t.selection;return l().insertContentAndSelect((0,nM.G)().insertCardInside).command(e=>{let{tr:t}=e,l=(0,iq.ek)({editor:n,pos:o-i.parentOffset-1,tr:t});return l.length&&requestAnimationFrame(()=>{var e,t;null===(e=(t=n.commands).moveAnnotations)||void 0===e||e.call(t,l)}),!0}).run(),!0},convertToNestedCard:()=>e=>{let{state:t,dispatch:l,commands:a}=e;if(!l)return!0;let n=(0,iL.Im)(t.schema.nodes[iE.name])(t,l);return a.selectInsertedNode(),n},unnestCard:e=>t=>{let{state:l,dispatch:a,chain:n,tr:o}=t,i=l.doc.nodeAt(e);if(!i||!(0,iG.jg)(i))return!1;if(!a)return!0;let s=i$(o,e);if(!s)return!1;let d=o.doc.resolve(e),u=(0,r.eL)(d,iG.jg),c=(0,iy.PD)(d),m=null;c&&(m=u?iX(l.doc,u.pos,!0):null);let f=e+i.nodeSize,p=n();if(m&&c&&u){let e=(0,iy.eh)(u.node)?c.node.content:c.node;p.insertContentAt(m,e.toJSON()).setMeta("cardNotesHandled",!0)}return p.insertContentAt({from:e,to:f},s.node.toJSON().content).selectInsertedNode().command(t=>{let{tr:l}=t;return l.setMeta("annotationEvent",{type:"merge-cards",contentPos:s.pos,insertPos:e}),!0}).run(),!0},mergeCardsAtPos:e=>t=>{let{tr:l}=t,a=l.doc.nodeAt(e);return!!(a&&(0,iG.jg)(a))&&iJ(e,l)},mergeCardsOnDelete:e=>t=>{let{tr:l,state:a,dispatch:n}=t;if(!n)return!0;let{selection:o}=a,i=(0,r.KP)(iG.jg)(o);if(!i||!o.empty)return!1;try{if(!iZ(o,e))return!1;return e?iK(i.pos,l,a):iJ(i.pos,l)}catch(e){return console.debug("[CardCommands] mergeCardsOnDelete failed",e),!1}},insertCardAfter:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,nM.G)().insertCardInside;return t=>{let{state:l,chain:a,dispatch:n}=t;if(!n)return!0;let{selection:o}=l,i=(0,r.KP)(iG.jg)(o);if(!i)return!0;let{pos:s,node:d}=i,u=s+d.nodeSize;return a().insertContentAt(u,e).selectInsertedNode().scrollIntoView().run(),!0}},deleteCardIfEmpty:e=>t=>{let{tr:l,dispatch:a,state:n}=t;if(!a)return!0;let o=!1,{from:i,to:r}=n.selection;return n.doc.nodesBetween(i,r,(t,a)=>{if((0,iG.jg)(t)&&i_(t)&&a>er.$x){let n=l.doc.resolve(a).depth>1;l.deleteRange(a,a+t.nodeSize);let i=(0,iU.n)(l.doc.resolve(a+(n?0:e?1:-1)),e?1:-1);i&&l.setSelection(i),o=!0}}),o},deleteCard:e=>t=>{let{state:l,dispatch:a,tr:n}=t;if(!a)return!0;let o=l.doc.resolve(e),i=o.depth>1,r=o.nodeAfter;if(!r||!(0,iG.jg)(r))return console.error("[CardExtension.deleteCard] Cannot delete card. Node unknown"),!1;n.delete(e,e+r.nodeSize);let s=(0,iU.n)(n.doc.resolve(e-(i?0:1)),-1);return s&&n.setSelection(s),!0},duplicateCard:e=>t=>{let{state:l,chain:a,editor:n}=t,o=l.doc.nodeAt(e);if(!o||!(0,iG.jg)(o))return console.error("[CardExtension.duplicateCard] Cannot duplicate card. Node unknown"),!1;let i=e+o.nodeSize,r=iV(iP()(o.toJSON()));return a().insertContentAt(i,r,{updateSelection:!1}).command(e=>{let{tr:t}=e;return t.setMeta(an._,!0),!0}).run(),setTimeout(()=>{n.chain().selectInsideNodeAtPos(i).focus().run()},200),!0},rearrangeCards:e=>{let{from:t,to:l,position:a}=e;return e=>{let n,{view:o,state:i,tr:r}=e,s=i.doc.resolve(l),d=i.doc.resolve(t),u=d.pos+d.nodeAfter.nodeSize,c=new V.nh(d),m=c.content();if((n="below"===a?s.pos+s.nodeAfter.nodeSize:"above"===a?s.pos:s.pos+s.nodeAfter.nodeSize-1)===d.pos)return r.setMeta("preventDispatch",!0),!0;r.delete(c.from,c.to);let f=r.mapping.map(n);r.replaceRangeWith(f,f,m.content.firstChild);let p=r.doc.resolve(f+1);r.setSelection(new V.nh(p));let g={type:"move",insertPos:f,insertPosRaw:n,pos:d.pos,end:u};return r.setMeta("annotationEvent",g).setMeta("rearrangeCards",!0),o.focus(),!0}},rearrangeCardsById:(e,t,l)=>a=>{var n;let{dispatch:o,tr:i,editor:r}=a;if(!o)return!0;let s=(0,$.aJ)(r.state.doc);if(!s)return!1;let d=s.map(e=>e.node.attrs.id),u=t.filter(e=>d.includes(e)).map(e=>s.find(t=>t.node.attrs.id===e)).filter(e=>!!e),c=u.map(e=>({pos:e.pos,id:e.node.attrs.id})).filter(e=>{let{id:t}=e;return t&&"string"==typeof t}),m=null===(n=u[0])||void 0===n?void 0:n.node.attrs.id;if(!m)return!0;let f=Math.max(e.findIndex(e=>e===m),0),p=e[f-1],g=s.find(e=>e.node.attrs.id===p),h=f>0&&g?g.pos+g.node.nodeSize:s[f].pos;if(void 0===h)return!0;[...u].reverse().forEach(e=>{e&&i.replaceWith(h,h,e.node)}),u.forEach(e=>{if(!e)return;let t=i.mapping.map(e.pos);i.delete(t,t+e.node.nodeSize)});let b=(0,$.aJ)(i.doc);if(!b)return!0;let y=b.map(e=>({pos:e.pos,id:e.node.attrs.id})).filter(e=>{let{id:l}=e;return t.includes(l)}),v=y.map(e=>{var t;let{id:l,pos:a}=e,n=null===(t=c.find(e=>e.id===l))||void 0===t?void 0:t.pos;return n?{id:l,oldPos:n,newPos:a}:null}).filter(e=>!!e);return i.setMeta("annotationEvent",{type:"rearrange-cards",rearrangedCardPositions:v,insertPos:h}).setMeta("rearrangeCards",!0).setMeta(nP,!0),iD()(y,c)||tE.zS.trackDocEvent(tE.VV.CARDS_REORDERED,{card_count:t.length,method:(null==l?void 0:l.viewPreference)==="film"?"filmstrip":"list-view"}),!0},updateThemeAccentImages:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return l=>{let{editor:a,commands:n}=l,o=!e||0===e.length,i=0;return a.state.doc.descendants((l,a)=>{let r=(0,el.wL)(l);if(r||(0,iG.jg)(l)){let s=r&&l.attrs.background.type===e5.h.NONE;(l.attrs.background.source===t5.j||t&&r||s)&&(o?n.updateAttributesAtPos(a,{background:{type:r?e5.h.NONE:void 0}}):(n.updateNestedAttributesAtPos(a,{background:e[i%e.length]}),i++))}}),!0}},deleteCardsById:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return l=>{let{editor:a,dispatch:n,tr:o}=l;if(!n)return!0;let i=(0,r.xe)(a.state.doc,t=>(0,iG.jg)(t)&&e.includes(t.attrs.id));if(!i.length)return!1;let s=i.map((e,t)=>({pos:e.pos,cardIndex:t}));i.forEach(e=>{let{node:t,pos:l}=e;o=o.delete(o.mapping.map(l),o.mapping.map(l+t.nodeSize))});let d=i[0].pos,u=(0,iW.s)(o.doc.resolve(d));return u&&(o=o.setSelection(u)),t&&o.setMeta("annotationEvent",{type:"filmstrip-cut",deleted:s}),o.setMeta(nP,!0),!0}},deleteCardsAfter:e=>t=>{let{editor:l,dispatch:a,commands:n}=t;if(!a)return!0;let o=(0,Y.GY)(l.state.doc.firstChild,e=>(0,iG.jg)(e)).map(e=>e.node.attrs.id);if(null===e)return n.deleteCardsById(o);let i=o.indexOf(e),r=i>-1?o.slice(i+1):[];return 0===r.length||n.deleteCardsById(r)},selectInsideNextCard:e=>t=>{let{state:l,dispatch:a,commands:n}=t;if(!a)return!0;let{selection:o}=l,i=(0,Y.IV)(o.$from,iG.jg)[0];if(!i||!o.empty)return!1;let r=l.doc.resolve(i.pos),s=r.index();if(e){if(s===r.parent.childCount-1)return!1;n.selectInsideNodeAtPos(i.pos+i.node.nodeSize)}else{if(0===s)return!1;let e=r.posAtIndex(s-1);n.selectInsideNodeAtPos(e,-1)}return!0}}),addInputRules:()=>[new r.fV({find:i0,handler:e=>{let{state:t,range:l}=e,{tr:a}=t;i2({tr:a.deleteRange(l.from,l.to),dispatch:!0})}})]}),i2=e=>{let{tr:t,dispatch:l}=e;if(!l)return;let a=(0,r.KP)(iG.jg)(t.selection);if(!a){console.error("Couldn't find parent card while splitting",t.selection);return}let{accent:n,body:o}=(0,el.dg)(t,a.pos);n&&o&&n.pos>o.pos&&(t.delete(n.pos,n.pos+n.node.nodeSize),t.insert(o.pos,n.node));let{selection:i}=t,{$from:s}=i,d=i.$from.parentOffset,u=i.from-d-1,c=i.$from.node().content.size-i.$from.parentOffset;t.setMeta(an._,!0),t.setMeta("annotationEvent",{type:"split-card",splitPos:s.before()});let{node:m,depth:f}=a,{type:p,attrs:g}=m,h=s.depth-f+1,b=(0,iy.PD)(t.doc.resolve(a.pos));t.split(s.pos,h,[{type:p,attrs:{...g,layout:"blank"}}]);let y=(0,iW.t)(t,er.Qs).pos,v=t.doc.nodeAt(y).childCount;if(0===d&&(t.delete(u,u+t.doc.nodeAt(u).nodeSize),y=t.steps[t.steps.length-1].getMap().map(y)),0===c&&v>1){let e=y+1,l=t.doc.nodeAt(e);l&&!("cardNotes"===l.type.name||"cardLayoutItem"===l.type.name)&&t.delete(e,e+l.nodeSize)}let k=(0,iy.PD)(t.doc.resolve(y));k&&t.delete(k.pos,k.pos+k.node.nodeSize);let w=(0,iU.n)(t.doc.resolve(y+1)),x=t.doc.nodeAt(a.pos),S=x&&a.pos+x.nodeSize-1;if(S&&b){let e=b.node;t.insert(S,e),t.setMeta("cardNotesHandled",!0)}w&&t.setSelection(w).scrollIntoView()};var i6=l(44428),i4=l(60953),i5=l(82451),i3=l.n(i5),i8=l(71096),i7=l(802),i9=l(63822),re=l(27930),rt=l(74336),rl=l(87835),ra=l.n(rl),rn=l(80917);let ro=(0,F.memo)(e=>{let{editor:t,onClose:l,handleAddCard:a,recentlyUsedTemplates:n}=e,o=(0,eQ.d)(),i=(0,nL.wz)("modal"),r=(0,F.useCallback)(e=>{o({status:"success",title:ef.Ru._({id:"WJGAWS"}),duration:1300,isClosable:!1,position:"top"}),l(),a(e,"modal")},[l,a,o]),s=n.filter(e=>!(0,nL.l2)(t,e)).slice(0,10);return(0,m.jsx)(eI.L8,{isDark:!1,children:(0,m.jsxs)(lk.aF,{isOpen:!0,onClose:l,size:{base:"5xl","2xl":"6xl"},children:[(0,m.jsx)(tq.m,{}),(0,m.jsxs)(lw.$,{children:[(0,m.jsx)(tJ.s,{}),(0,m.jsx)(t$.r,{children:(0,m.jsx)(em.x6,{id:"HNcS3K"})}),(0,m.jsx)(tQ.c,{pb:6,children:(0,m.jsxs)(eX.B,{spacing:6,children:[!!s.length&&(0,m.jsxs)(eX.B,{children:[(0,m.jsxs)(z.E,{color:"gray.700",children:[(0,m.jsx)(j.g,{icon:ec.a$,fixedWidth:!0})," ",(0,m.jsx)(em.x6,{id:"uabU9X"})]}),(0,m.jsx)(nH.x,{templateColumns:"repeat(auto-fill, minmax(calc(".concat(ob.lg," + 0.4em), 1fr))"),gap:3,children:s.map(e=>{let{jsonContent:t,id:l,name:a}=e;return(0,m.jsx)(iu,{isDark:!1,isSelected:!1,tooltip:a(),label:a(),onClick:()=>r(l),w:"auto",templateIcon:(0,m.jsx)(ov,{content:t,isDark:!1,borderRadius:"base",size:"lg"})},l)})})]}),i.map(e=>{let{subcategory:l,items:a}=e;return(0,m.jsxs)(eX.B,{children:[(0,m.jsx)(z.E,{color:"gray.700",children:l}),(0,m.jsx)(nH.x,{templateColumns:"repeat(auto-fill, minmax(calc(".concat(ob.lg," + 0.4em), 1fr))"),gap:3,children:a.filter(e=>!(0,nL.l2)(t,e)).map(e=>{let{id:t,name:l,jsonContent:a}=e,o=!!n.find(e=>{let{id:l}=e;return l===t});return(0,m.jsx)(iu,{isDark:!1,isSelected:!1,tooltip:"".concat(l()," ").concat(o?ef.Ru._({id:"uabU9X"}):""),label:l(),onClick:()=>r(t),w:"auto",templateIcon:(0,m.jsx)(ov,{content:a,isDark:!1,borderRadius:"base",size:"lg"}),boxShadow:"none"},t)})})]},l)})]})})]})]})})});var ri=l(82438),rr=l.n(ri);l(72239);let rs=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;return rr()([e,...t]).slice(0,l)},rd=(0,F.memo)(e=>{let{setCardContent:t,editor:l,isFocused:a,edgeLayoutsDisabled:n,isNested:o}=e,{isInOfflineMode:i}=(0,t9.u)(),r=(0,o6.rd)(),{isOpen:s,onClose:d,onOpen:u}=(0,aL.E)({id:"cardTemplatesModal"}),[c,f]=(0,lF.M)(lB.E.recentlyUsedCardTemplateIds,[]),p=(0,F.useCallback)(function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"placeholder";t(e),"aiCardAfter"!==e&&f(rs(e,c));let a="placeholder"===l?eh.oU.CARD_TEMPLATE_PLACEHOLDER:eh.oU.CARD_TEMPLATE_MODAL;(0,rn.J)({nodeName:"card",key:e},a)},[t,c,f]),[g,h]=(0,F.useMemo)(()=>{let e=c.map(e=>(0,nL.iT)()[e]).filter(e=>!!e),t=(0,nL.wz)("placeholder").flatMap(e=>{let{items:t}=e;return t});return[ra()([...e,...t],"id").filter(e=>!!e).filter(e=>!(0,nL.l2)(l,e,e=>{var t;let{jsonContent:l}=e;return n&&(0,el.sP)(null===(t=l.attrs)||void 0===t?void 0:t.layout)})),e]},[n,l,c]);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(eI.L8,{isDark:r,children:(0,m.jsx)(oL.S,{in:a||s,onAnimationComplete:()=>{var e,t;null===(e=(t=l.commands).refreshBubbleMenu)||void 0===e||e.call(t)},children:(0,m.jsxs)(eX.B,{overflow:"hidden",mx:16,mb:12,contentEditable:!1,onMouseDown:e3.Fw,cursor:"default",fontFamily:"Inter, sans-serif",color:"var(--body-color-muted)",children:[(0,m.jsx)(z.E,{fontSize:"sm",fontWeight:"normal",children:(0,m.jsx)(em.x6,{id:"3h21H3"})}),(0,m.jsxs)(nH.x,{templateColumns:"repeat(auto-fill, minmax(calc(".concat(ob.md," + var(--chakra-space-1-5)), 1fr))"),fontSize:"1rem",gap:2,children:[g.slice(0,o?2:4).map(e=>{let{id:t,jsonContent:l,name:a}=e;return(0,m.jsx)(iu,{tooltip:a(),isDark:r,templateIcon:(0,m.jsx)(ov,{content:l,isDark:r,borderRadius:"base",maxH:"5em",overflow:"hidden"}),isSelected:!1,onClick:()=>p(t),w:"auto",minW:"auto",fontSize:"1em"},t)}),(0,m.jsx)(iu,{tooltip:ef.Ru._({id:"bHT6mZ"}),label:(0,m.jsx)(em.x6,{id:"iTylMl"}),isDark:r,templateIcon:(0,m.jsx)(j.g,{icon:lb.Qyz,fixedWidth:!0}),isSelected:!1,onClick:u,fontSize:"1em"}),!i&&(0,m.jsx)(iu,{isDark:r,templateIcon:(0,m.jsx)(j.g,{icon:lb.p7g,fixedWidth:!0}),label:(0,m.jsx)(em.x6,{id:"ziAjHi"}),tooltip:ef.Ru._({id:"tkZYgO"}),isSelected:!1,onClick:()=>{p("aiCardAfter")},fontSize:"1em"})]})]})})}),s&&(0,m.jsx)(ro,{editor:l,onClose:d,handleAddCard:p,recentlyUsedTemplates:h})]})});rd.displayName="ChooseCardTemplatePlaceholder";var ru=l(70395),rc=l(31485);let rm={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/layout-behind.f3d267a6.svg"},rf={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/layout-left.deebff4d.svg"},rp={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/layout-right.af6aebc7.svg"},rg={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/layout-top.bb63e01e.svg"},rh=e=>{let{isVisible:t,setLayout:l,editor:a}=e,n=(0,o6.rd)(),o=n?"invert(.8) brightness(1.2)":"invert(0)";return(0,m.jsx)(eI.L8,{isDark:n,children:(0,m.jsx)(oL.S,{in:t,onAnimationComplete:()=>{var e,t;null===(e=(t=a.commands).refreshBubbleMenu)||void 0===e||e.call(t)},children:(0,m.jsxs)(eX.B,{overflow:"hidden",mx:16,mb:12,contentEditable:!1,onMouseDown:e3.Fw,cursor:"default",children:[(0,m.jsx)(z.E,{color:"var(--body-color-muted)",fontSize:"sm",fontFamily:"Inter",fontWeight:"normal",children:(0,m.jsx)(em.x6,{id:"q+/7Td"})}),(0,m.jsxs)(ed.e,{spacing:1,children:[(0,m.jsx)(e9.K,{"aria-label":ef.Ru._({id:"loNm+3"}),h:"auto",p:1,variant:"ghost",onClick:()=>l("top"),icon:(0,m.jsx)(nq._,{src:rg.src,filter:o})}),(0,m.jsx)(e9.K,{"aria-label":ef.Ru._({id:"dL4qXb"}),h:"auto",p:1,variant:"ghost",onClick:()=>l("left"),icon:(0,m.jsx)(nq._,{src:rf.src,filter:o})}),(0,m.jsx)(e9.K,{"aria-label":ef.Ru._({id:"kVQU97"}),h:"auto",p:1,variant:"ghost",onClick:()=>l("right"),icon:(0,m.jsx)(nq._,{src:rp.src,filter:o})}),(0,m.jsx)(e9.K,{"aria-label":ef.Ru._({id:"3eqz61"}),h:"auto",p:1,variant:"ghost",onClick:()=>l("behind"),icon:(0,m.jsx)(nq._,{src:rm.src,filter:o})})]})]})})})},rb=(e,t,l)=>{if(l)return{};if("behind"===e||"blank"===e)return{borderRadius:"var(--card-border-radius)"};if("left"===e)return"accent"===t?{borderLeftRadius:"var(--card-border-radius)"}:"body"===t?{borderRightRadius:"var(--card-border-radius)"}:{};if("right"===e)return"body"===t?{borderLeftRadius:"var(--card-border-radius)"}:"accent"===t?{borderRightRadius:"var(--card-border-radius)"}:{};if("top"===e||"mobileLeft"===e)return"body"===t?{borderBottomRadius:"var(--card-border-radius)"}:"accent"===t?{borderTopRadius:"var(--card-border-radius)"}:{};if("mobileRight"===e){if("accent"===t)return{borderBottomRadius:"var(--card-border-radius)"};if("body"===t)return{borderTopRadius:"var(--card-border-radius)"}}return{}},ry=e=>{let{node:t,getPos:l,decorations:a,editor:n}=e,o=t.attrs,i=(0,nR.fW)(),r=(0,rc.Bn)(a),{isNested:s,insideSideLayout:d}=(0,ei.tg)(a),c=(null==r?void 0:r.layout)==="blank",f=rb(r.layout,o.itemId,"full"===r.cardSize),p={flexDirection:"column",justifyContent:o.verticalAlign||"var(--card-vertical-align)"},g=(0,el.lH)(null==r?void 0:r.layout),h=g&&!g.items[o.itemId],[b]=(0,ru.E)(r.cardId),y=(0,rt.v)(a),v=(0,J.GV)(es.nD),k=(0,eP.DM)(a),w=tP(),x=(0,ej.u)("cardTemplatesPlaceholder"),S=(0,tE.st)(),A=v&&y&&c,C=(0,F.useCallback)(e=>{let t=(0,Y.TK)(n.state.doc.resolve(l()),$.jg),a=t.length>0?t[0].pos:null;a&&(null==S||S.track(tE.VV.CARD_LAYOUT_UPDATED,{source:"empty-card-placeholder",layout:e}),n.chain().setCardLayout(a,e,w).selectInsideCardBody(a).focus().run())},[n,l,w,S]),z=(0,F.useCallback)(e=>{if(!x)return;let t=(0,Y.TK)(n.state.doc.resolve(l()),$.jg),a=t.length>0?t[0]:null;if(!a)return;let o=(0,n_.GO)()[e]||(0,n_.GO)().blankCard,{layoutTemplateColumns:i,...r}=a.node.attrs;o.attrs={...r,...o.attrs};let s=a.pos,d=a.pos+a.node.nodeSize;n.chain().insertContentAt({from:s,to:d},o,{updateSelection:!1}).selectInsertedNode().run()},[x,n,l]);return(0,m.jsx)(u.VR,{dir:i?"rtl":"ltr",as:"div",style:{...h?{display:"none"}:{}},children:(0,m.jsxs)(eN.s,{"data-content-reference":!0,className:"card-layout-cell-bg",w:"100%",h:"100%",position:"relative","data-selection-ring":!0,"data-selection-background":!0,..."presentCurrent"!==b&&f,...p,children:[(0,m.jsx)(u.$p,{as:"div",style:{width:"100%"}}),A&&x&&(0,m.jsx)(rd,{isFocused:k,editor:n,setCardContent:z,edgeLayoutsDisabled:d,isNested:s}),A&&!s&&!x&&(0,m.jsx)(rh,{isVisible:k,setLayout:C,editor:n})]})})},rv=e=>{var t;let{hasImage:l,onEditImage:a,image:n,editor:o,isLoading:i,openEditBackgroundDrawer:r,borderProps:s,accentLayout:d,...u}=e,c=!!a;return l?null:(0,m.jsx)(eN.s,{align:"center",justify:"center",pos:"absolute",inset:0,role:"group",cursor:"default","data-layout-cut":"mobileLeft"===d?"top":d,...l?{}:{bgColor:"gray.200"},...u,children:!o.isThumbnail&&(0,m.jsx)(eN.s,{pos:"absolute",inset:0,justify:"center",align:"center",cursor:c?"default":void 0,onClick:a,children:(0,m.jsx)(f.az,{color:"gray.400",h:"100%",w:"100%",children:(0,m.jsx)(re.Pf,{icon:t3.Fn[t5.j].icon,isUploading:!1,isLoading:i,loadingProvider:null==n?void 0:null===(t=n.loadImageParams)||void 0===t?void 0:t.provider,onSelectAndFocus:a,hasUploadError:!1,isAccentImageDrawer:!0,openEditBackgroundDrawer:r,h:"100%",w:"100%",hasQuickActions:"behind"!==d,...s})})})})},rk=e=>{let{background:t,rounded:l,resizeParams:a,cutLayout:n,isDark:o,bodyColor:i}=e,r=(0,tb.FD)(t,o,a,i);return(0,m.jsx)(f.az,{position:"absolute",inset:"0",overflow:"hidden",borderRadius:l?"var(--box-border-radius)":"inherit","data-layout-cut":n,...r})},rw=e=>{var t,l;let{background:a,rounded:n,cutLayout:o}=e,i=a.image&&!(0,ee.XJ)(a.image.src)&&!(null===(t=a.image.meta)||void 0===t?void 0:t.has_transparency),r=i?(0,tb.FD)(a,!1,{width:400,blur:50}):void 0;return(0,m.jsx)(f.az,{position:"absolute",inset:"0","data-image-fit-bg":!0,overflow:"hidden",...r,borderRadius:n?"var(--box-border-radius)":"inherit",marginY:n?"1em":void 0,bgPosition:"center","data-layout-cut":o,children:i&&!(0,ty.md)((null===(l=a.image)||void 0===l?void 0:l.src)||void 0)&&(0,m.jsx)(f.az,{backdropFilter:"blur(6em)",inset:0,position:"absolute",borderRadius:"inherit","data-selection-ring":"inside"})})},rx=e=>{let{image:t,resizeParams:l,cutLayout:a,bodyColor:n}=e,{tempUrl:o,meta:i}=t,r=t.src?(0,ty.pO)(t.src,n):void 0,s=(null==i?void 0:i.frame_count)&&i.frame_count>1,d=r&&!s&&l?(0,ty.Ub)(r,l,i):r;return(0,m.jsx)(nq._,{src:d||void 0,fallbackSrc:o||void 0,borderRadius:"var(--box-border-radius)",pos:"relative",flex:"0 1 auto",minH:0,minW:0,width:"auto",maxW:"100%","data-layout-cut-fg":a,className:"reset-max-width-with-margins"})};var rS=l(12253);let rA=e=>{var t;let{editor:l,node:a,decorations:n,getPos:o}=e,i=(0,J.jL)(),{fullWidthBlock:s}=a.attrs,d=(0,rc.Bn)(n),u=(0,tM.jh)(a.attrs,null==d?void 0:d.layout),{startRemoveBg:c,isRemovingBg:f}=(0,i7.D9)({editor:l,id:null==d?void 0:d.cardId}),p=(0,r.eL)(l.state.doc.resolve(o()),iG.jg),g=(null===(t=a.attrs.background)||void 0===t?void 0:t.type)===e5.h.IMAGE,{displayLayout:h}=(0,ei.tg)(n),b=tN(l,(null==p?void 0:p.pos)||0);return{contextMenuItems:[...g?[{key:"copy",label:ef.Ru._({id:"he3ygx"}),icon:ec.jPR,onClick:()=>{let e=o();l.commands.copy({from:e,to:e+a.nodeSize})}},{key:"divider",divider:!0},{key:"fit-image",label:"fit"===u?ef.Ru._({id:"2Ivw1n"}):ef.Ru._({id:"VPxUGR"}),icon:ec.GZ1,onClick:()=>{l.commands.updateAttributesAtPos(o(),{fitType:"fit"===u?"fill":"fit"})}},{key:"remove-background",label:f?ef.Ru._({id:"RdqLb7"}):ef.Ru._({id:"ylbfBl"}),icon:f?ec.z1G:ec.sAw,rightIcon:f?void 0:(0,m.jsx)(lV.G,{type:"removeBackground",ms:2,color:"gray.400"}),disabled:f,onClick:c},{key:"change-focus-point",label:ef.Ru._({id:"BmxaoW"}),icon:ec.xD0,onClick:()=>{l.commands.selectNodeAtPos(o());let e=(0,au.um)(a);(null==e?void 0:e.id)&&i((0,rS.sI)({id:e.id}))},disabled:"fit"===u}]:[],{key:"edit-image",label:g?ef.Ru._({id:"9IrgTy"}):ef.Ru._({id:"pVb3uA"}),icon:ec.MT7,onClick:()=>{let e=null==p?void 0:p.node.attrs.id;e&&ta.R.emit("toggleEditBackgroundDrawer",{openDrawer:!0,cardId:e})}},{key:"divider",divider:!0},{key:"layout",label:ef.Ru._({id:"vR68Ol"}),icon:ec.swh,disabled:s,items:tD.map(e=>({key:e,label:(0,tM.Nu)(e),icon:(0,m.jsx)(tW,{layout:e,isSelected:h===e}),onClick:()=>b(e)}))},{key:"divider",divider:!0},{key:"remove-accent-image",label:g?ef.Ru._({id:"sGYCGx"}):ef.Ru._({id:"6vLq+T"}),icon:g?ec.K3F:ec.yLS,onClick:()=>(0,tM.kB)(l,o(),g),color:"red.500"}]}},rC={width:1200},rz=e=>{var t,l,a;let n=(0,J.GV)(es.SJ),o=(null===(t=n.config)||void 0===t?void 0:t.accentBackgrounds)&&(null===(l=n.config)||void 0===l?void 0:l.accentBackgrounds.length)>0;return e.source||(null===(a=e.image)||void 0===a?void 0:a.source)||o?t5.j:e2.L},rI=e=>{let{editor:t,node:l,getPos:a}=e;(0,F.useEffect)(()=>{"cardLayoutItem"===l.type.name&&"accent"===l.attrs.itemId&&setTimeout(()=>{t.commands.command(e=>{let{tr:n}=e;return(0,el.OH)(n,a(),l,t.schema),!0})})},[t,a,l])},rj=e=>{var t,l,a,n,o;let{node:i,decorations:r,editor:s,getPos:d}=e,c=i.attrs,{background:f}=c;rI(e);let{openBackgroundTab:p,...g}=ls(),h=rz(f),b=(0,F.useCallback)(e=>{s.commands.updateNestedAttributesAtPos(d(),e)},[s,d]),y=(0,F.useCallback)(e=>{s.commands.updateNestedAttributesAtPos(d(),{background:i3()({},f,{image:{...e,meta:{has_transparency:!0}}})})},[s,d,f]),{onCloseContextMenu:v,onOpenContextMenu:k,menuProps:w}=(0,i9.$)({editor:s,getPos:d}),{contextMenuItems:x}=rA({editor:s,node:i,decorations:r,getPos:d}),{defaultFullBleed:S}=(0,J.GV)(es.Uu),A=(0,rc.Bn)(r),{isDark:C,bodyColor:z}=(0,M.a)(r),I=(0,J.GV)(es.wC)!==ok.w.SLIDE_VIEW&&((null==A?void 0:A.cardSize)==="default"?"full"===S:(null==A?void 0:A.cardSize)==="full"),j=null==A?void 0:A.cardId,B=null==A?void 0:A.layout,R="behind"===B,_=s.isThumbnail?ty.p7:"right"===B||"left"===B||"top"===B||"mobileLeft"===B||"mobileRight"===B?rC:void 0,{bgRemovalInProgress:E}=(0,i7._A)({editor:s,id:j,src:null===(t=f.image)||void 0===t?void 0:t.src,updateAttributes:y}),T=(0,tM.jh)(c,B),O=!!(0,el.lH)(B).items[c.itemId],P=rb(A.layout,c.itemId,"full"===A.cardSize),N="none"===f.type||f.type===e5.h.IMAGE&&!f.image||f.type===e5.h.IMAGE&&!(null===(l=f.image)||void 0===l?void 0:l.src)&&!(null===(a=f.image)||void 0===a?void 0:a.tempUrl),D="fit"===T&&f.image&&!N,L=(0,t8.j8)(s,d),{setBackgroundDrawerSourceKeyAction:W}=(0,t8.Bz)(),U=(null===(n=f.image)||void 0===n?void 0:n.loadImageStatus)==="queued",G=(0,J.GV)(es.nD);(0,F.useEffect)(()=>ta.R.on("toggleEditBackgroundDrawer",e=>{let{openDrawer:t,cardId:l}=e;t&&l===j&&(W(h),p(!1))}),[h,j,p,W]);let H=null===(o=f.image)||void 0===o?void 0:o.uploadStatus,V=(0,nN.FX)(),q=!I||"fit"===T||V?void 0:"left"===B||"right"===B?{borderRadius:"var(--box-border-radius)",marginY:"1em",height:"auto"}:"top"===B||"behind"===B?{width:"var(--editor-width)",position:"absolute",transform:"translateX(-50%)",left:"calc(50% - var(--doc-padding-left, 0px) / 2 + var(--doc-padding-right, 0px) / 2)"}:void 0,K=(0,F.useCallback)(e=>{(!(e.target instanceof Element)||e.target.closest("[data-card-layout]"))&&(L(),W(h),p(!1))},[h,L,p,W]);if(!O)return null;let $="mobileLeft"===B?"top":B;return(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(u.VR,{as:"div",style:{display:I?"flex":void 0},children:[(0,m.jsxs)(eN.s,{"data-content-reference":!0,"data-change-focus-point-el":!0,className:"card-layout-cell-bg",w:"100%",h:"100%",onContextMenu:k,"data-selection-ring":"inside","data-selection-background":!0,"data-card-layout":null==A?void 0:A.layout,"data-testid":"card-accent-layout-item","data-fit-type":T,position:"relative","data-drag-handle":!0,...P,flexDirection:"column",justifyContent:"center",onClick:L,onDoubleClick:K,...q,bgSize:"fill"===T||R?"cover":"contain",p:"fill"===T||R?0:I?"1.5em":"1.25em",objectFit:"contain",css:{containerType:"size"},align:"center",justify:"center",children:[!D&&(0,m.jsx)(rk,{background:f,rounded:I&&!V,resizeParams:_,cutLayout:$,isDark:C,bodyColor:z}),D&&(0,m.jsx)(rw,{background:f,rounded:I&&!V,cutLayout:$}),D&&(0,m.jsx)(rx,{image:f.image,resizeParams:_,cutLayout:$,bodyColor:z}),R&&(0,m.jsx)(tl.TH,{background:f}),G&&(0,m.jsx)(ld,{editor:s,updateNestedAttributes:b,background:null==c?void 0:c.background,enableMask:R,isAccentImageDrawer:!0,...g}),(0,m.jsx)(rv,{isLoading:U,editor:s,hasImage:!N,image:f.image,onEditImage:G?L:void 0,openEditBackgroundDrawer:p,borderProps:P,accentLayout:null==A?void 0:A.layout,...P}),(H==aT.A.Uploading||E)&&G&&(0,m.jsx)(re.Td,{removeBackground:E,scootRight:E&&("top"===B||"left"===B)}),H==aT.A.Error&&(0,m.jsx)(re.Hy,{})]}),(0,m.jsx)(i8.t,{menuItems:x,isOpen:w.isOpen,position:w.position,onClose:v,size:"small"})]})})},rF=e=>{let{node:t}=e;return"accent"===t.attrs.itemId?(0,m.jsx)(rj,{...e}):(0,m.jsx)(ry,{...e})},rB=r.bP.create({name:"cardAccentLayoutItem",group:"cardLayoutItemGroup",priority:Z.y.CardAccentLayoutItem,selectable:!1,atom:!0,draggable:!0,imageKeyPath:"background.image",addAttributes:()=>({itemId:{default:"accent"},fitType:{},background:{default:{type:e5.h.NONE},...(0,Y.tb)("background")}}),addNodeView:()=>(0,u.gu)(rF,{update:c.z0}),addStorage:X.xu,parseHTML(){return[{tag:"img[class=accent-image][bookmark]",getAttrs:(0,X.Ll)(this.storage)},{tag:"img[class=accent-image][".concat(i4.A,"]"),getAttrs:e=>{let t=(0,ak.D)(e);return{background:{type:e5.h.IMAGE,image:t}}}},{tag:"img[class=accent-image][src]",getAttrs:e=>({fitType:e.getAttribute("fitType")||"fill",background:{type:e5.h.IMAGE,image:{src:e.getAttribute("src")||"",source:"image.custom"}}})},{tag:"img[class=accent-image]"},{tag:"div[class=card-accent-layout-item]",context:"card/"}]},renderHTMLforAI(e){let{node:t}=e,l=(0,X.vL)(this.storage,t),a=t.attrs.background;return["img",{bookmark:l,class:"accent-image",alt:a.image&&(0,K.ve)(a.image)}]},renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,r.KV)(t,{class:"card-accent-layout-item"})]}});var rR=l(3756),r_=l(73686),rM=l(96712);let rE=new V.hs("cardLayoutResizing");class rT{getActiveHandleAbs(e){return this.activeHandle?(0,rM.d_)(e,this.activeHandle):null}reset(){return this.activeHandle=null,this.side=null,this.dragging=null,this}setHandle(e,t){return null===t.setHandle?(this.activeHandle=null,this.side=null):(this.activeHandle=(0,rM.JO)(e,t.setHandle.pos),this.side=t.setHandle.side),this}setDragging(e){return this.dragging=e.setDragging,this}apply(e,t){let l=e.getMeta(rE);return l&&"setHandle"in l?this.setHandle(t,l):l&&"setDragging"in l?this.setDragging(l):l&&"reset"in l?this.reset():this}constructor(){this.activeHandle=null,this.dragging=null}}var rO=l(119),rP=l.n(rO),rN=l(75621),rD=l(26374);let rL=e=>rE.getState(e.state),rW=(e,t)=>{e.dispatch(e.state.tr.setMeta(rE,{setHandle:t}))},rU=(e,t)=>{e.dispatch(e.state.tr.setMeta(rE,{setDragging:t}))},rG=e=>{e.dispatch(e.state.tr.setMeta(rE,{reset:!0}))},rH=(e,t)=>{if(!e.editable||!t.target||t.target.closest(".column-resize-handle"))return;let l=rL(e);if(l.dragging)return;let a=function(e,t){let l=e.posAtCoords({left:t.clientX,top:t.clientY});if(!l||-1===l.inside)return null;let a=e.domAtPos(l.inside);if(!a)return null;let n=a.node.childNodes[a.offset];if(!n)return null;let o=e.state.doc.resolve(l.inside);if(!o.nodeAfter||!(0,$.sw)(o.nodeAfter))return null;let i=(0,Y.TK)(o,$.jg)[0];if(!i)return null;let r=i.node.attrs.layout;if(!(0,el.lH)(r).allowResizing)return null;let s="top"===r,{left:d,right:u,bottom:c,top:m}=n.getBoundingClientRect();if(t.clientX-d<=5&&!s){let l=e.posAtCoords({left:t.clientX-10,top:t.clientY});if(!l)return null;let a=e.state.doc.nodeAt(l.inside);return a&&(0,$.sw)(a)?"cardLayoutItem"===a.type.name?{pos:l.inside,side:"right"}:{pos:o.pos,side:"left"}:null}if(u-t.clientX<=5&&!s){let l=e.posAtCoords({left:t.clientX+10,top:t.clientY});if(!l)return null;let a=e.state.doc.nodeAt(l.inside);return a&&(0,$.sw)(a)?"cardLayoutItem"===a.type.name?{pos:l.inside,side:"left"}:{pos:o.pos,side:"right"}:null}if(c-t.clientY<=5&&s){let l=e.posAtCoords({left:t.clientX,top:t.clientY+10});if(!l)return null;let a=e.state.doc.nodeAt(l.inside);return a&&(0,$.sw)(a)&&"cardLayoutItem"===a.type.name?{pos:l.inside,side:"top"}:null}if(t.clientY-m<=5&&s){let l=e.posAtCoords({left:t.clientX,top:t.clientY+10});if(!l)return null;let a=e.state.doc.nodeAt(l.inside);if(!a||!(0,$.sw)(a)||"cardLayoutItem"!==a.type.name)return null;let n=e.state.doc.resolve(l.inside).parent;return n&&"card"===n.type.name&&"top"===n.attrs.layout?{pos:l.inside,side:"top"}:null}return null}(e,t),n=l.getActiveHandleAbs(e.state),o=l.side;null===n&&null===a||a&&a.side===o&&a.pos===n||rW(e,a)},rV=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"x",a=e.domAtPos(t),n=a.node.childNodes[a.offset];return"x"===l?n.offsetWidth:n.offsetHeight},rq=(e,t)=>{let{node:l,offset:a}=e.domAtPos(t.start()),n=l.childNodes[a];do if(n&&n.classList&&n.classList.contains("node-card"))break;while(n=n.parentNode);return n},rK=(e,t,l)=>{let a=(0,el.lH)(l),n=t.querySelector('[data-node-view-content-inner="card"]');if("top"===l)return r$(e,n,l);let o=e.attrs,i=(null==n?void 0:n.style.gridTemplateColumns)||o.layoutTemplateColumns||a.grid.gridTemplateColumns;if(!i)return null;let r=i.split(" ");if(!r.length)return null;let s=r[0].includes("fr"),d=[];if(s){let e=r.map(e=>+e.replace("fr","")),t=e.reduce((e,t)=>e+t,0);d=e.map(e=>e/t*100)}else d=r.map(e=>+e.replace("%",""));return d},rJ={sm:100,md:200,lg:300},r$=(e,t,l)=>{let a=(0,el.lH)(l),n=e.attrs,o=(null==t?void 0:t.style.gridTemplateRows)||n.layoutTemplateRows||a.grid.gridTemplateRows;if(!o)return null;let i=o.split(" ");if(!i.length)return null;let r=i[0],s=r.includes("var"),d=[];if(s){var u;let e=null===(u=r.split("-").at(-1))||void 0===u?void 0:u.slice(0,-1);e&&e in rJ||(e="md"),d=[rJ[e],0]}else d=i.map(e=>"auto"===e?0:Number.parseInt(e));return d},rQ=r.bP.create({name:"cardLayoutItem",group:"cardLayoutItemGroup",content:"(block | cardBlock)+",selectable:!1,draggable:!1,isolating:!0,containerHandle:!0,priority:Z.y.CardLayoutItem,addAttributes:()=>({itemId:{default:"body"}}),addNodeView:()=>(0,u.gu)(rF,{update:c.z0}),addCommands:()=>({handleCardAccentDelete:()=>e=>{let{state:t,commands:l}=e;if(!(0,r.BQ)(t.selection))return!1;let{node:a}=t.selection;if(!(0,el.wL)(a))return!1;let n=(0,r.KP)($.jg)(t.selection);return!!n&&l.setCardLayout(n.pos,"blank")},selectInsideCardBody:e=>t=>{let{state:l,tr:a,commands:n}=t,o=l.doc.nodeAt(e);if(!o||!(0,$.jg)(o))return!1;let i=(0,el.dg)(a,e);if(0===Object.entries(i).length)return n.selectInsideNodeAtPos(e);let r=i.body;return!!r&&n.selectInsideNodeAtPos(r.pos)},setCardLayout:(e,t,l)=>a=>{let{tr:n,editor:o}=a;return(0,rR.c)(o,n,e,t,l)},removeCardLayout:e=>t=>{let{tr:l,editor:a}=t,n=(0,$.W0)(a,e);return!!n&&(0,rR.c)(a,l,n.pos,"blank")}}),parseHTML:()=>[{tag:"div[class=card-layout-item]"},{tag:"div[class=body]",context:"card/"}],addProseMirrorPlugins(){return[(0,rc.OX)(this.editor),new V.k_({key:rE,state:{init:()=>new rT,apply:(e,t,l,a)=>t.apply(e,a)},props:{attributes:e=>null!==rE.getState(e).getActiveHandleAbs(e)?{class:"resize-cursor"}:{class:""},handleDOMEvents:{mousemove:(e,t)=>(rH(e,t),!1),mouseleave:e=>(!function(e){let t=rL(e);null===t.getActiveHandleAbs(e.state)||t.dragging||rW(e,null)}(e),!1),mousedown:(e,t)=>(!function(e,t){if(!e.editable)return;let l=rL(e),a=l.getActiveHandleAbs(e.state);if(null===a||l.dragging)return;let n=e.state.doc.resolve(a),o=n.node(),i=rq(e,n),r=i.querySelector('[data-node-view-content-inner="card"]');if(!r)return;let s=l.side,d=s&&["top","bottom"].includes(s)?"y":"x",u="x"===d?r.offsetWidth:r.offsetHeight,c=rV(e,a),m=rK(o,i,o.attrs.layout);if(!m)return;rU(e,{startX:t.clientX,startY:t.clientY,dragDirection:s&&["top","bottom"].includes(s)?"y":"x",startSize:c,colWidths:m,totalSize:u,colIndex:0});let f=null;function p(){window.removeEventListener("mouseup",p),window.removeEventListener("mousemove",g);let t=rL(e);if(t.dragging){if(null===f){rU(e,null);return}if(t.dragging)try{(function(e,t,l){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"x",n=e.state.doc.resolve(t).before(),o=l.join(" "),i=e.state.tr.setNodeAttribute(n,"x"===a?"layoutTemplateColumns":"layoutTemplateRows",o);e.dispatch(i),function(e,t){let l=e.state.doc.resolve(t),a=rq(e,l).querySelector('[data-node-view-content-inner="card"]');a&&(a.style.gridTemplateColumns="",a.style.gridTemplateRows="")}(e,t)})(e,t.getActiveHandleAbs(e.state),f,t.dragging.dragDirection),rU(e,null)}catch(t){rG(e)}f=null}}function g(t){if(!t.which)return p();let l=rL(e),a=l.getActiveHandleAbs(e.state);if(!l.dragging||null===a)return;let{colWidths:n}=l.dragging,o=n[0],r={left:[10,25,37.5,50],right:[50,62.5,75,90],top:Object.values(rJ)}[null!=s?s:"left"];if("top"===s){let e=o+(t.clientY-l.dragging.startY),a=r.findIndex((t,l,a)=>l===a.length-1||e<=(a[l+1]+t)/2),n=Object.keys(rJ)[a];f=["var(--top-accent-height-".concat(n,")"),"auto"]}else{let e=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,{totalSize:a}=e,n="x"===e.dragDirection?t.clientX-e.startX:t.clientY-e.startY;return rP()(100*n/a/l,0)*l}(l.dragging,t,.1),a=o+er[r.length-1]?r[r.length-1]:r.find(t=>6.25>=Math.abs(t-o-e));f=(0,rN.H0)(n,0,a-o,10).map(e=>"".concat(e,"%"))}(function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"x",a=e.querySelector('[data-node-view-content-inner="card"]');a&&(a.style["y"===l?"gridTemplateRows":"gridTemplateColumns"]=t.join(" "))})(i,f,d),(0,rD.i$)(i)}window.addEventListener("mouseup",p),window.addEventListener("mousemove",g),t.preventDefault()}(e,t),!1)},decorations(e){let t=rE.getState(e),l=t.getActiveHandleAbs(e);if(null!==l){let a=[];try{let n=document.createElement("div");n.className="column-resize-handle ".concat(t.side),a.push(r_.NZ.widget(l+1,n));let o=e.doc.nodeAt(l);return a.push(r_.NZ.node(l,l+o.nodeSize,{class:"has-column-resize-handle"})),r_.zF.create(e.doc,a)}catch(e){return console.error("(caught) cardLayoutResizing error: ".concat(e.message)),r_.zF.empty}}},nodeViews:{}}})]},renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,r.KV)(t,{class:"card-layout-item"}),0]},renderHTMLforAI(e){let{node:t}=e;return["div",{class:"body"},0]}});var rY=l(20392),rX=l(65056),rZ=l(46291),r0=l(7263),r1=l(92448),r2=l(38234);let r6=new V.hs("SlashMenu"),r4=(0,r2.e$)({name:"slashMenu",char:"/",pluginKey:r6,MenuComponent:r1.a,priority:Z.y.SlashMenu});var r5=l(5628);class r3 extends u.Lz{updateProps(e){this.isDestroyed||this.renderer.updateProps(e)}mountEditor(){let e=this.editor,{nodeName:t,preventNodeOrExtensionTypes:l}=this.editorOptions,a=[...pg({isInnerEditor:!0}),r4,rZ.mk,eP.bU,au.Q8,r7.configure({outerEditor:e,getPos:this.getPos}),r0.c,rX.mM].filter(e=>!l||!l.includes(e.name)).map(e=>e.name===t?e.extend({topNode:!0}):e);return this.innerEditor=new rY.K({extensions:a,content:{type:t,content:this.node.content.toJSON(),attrs:iP()(this.node.attrs)},onBeforeCreate(a){let{editor:n}=a;n.schema.nodes={...e.schema.nodes},null==l||l.forEach(e=>{n.schema.nodes[e]&&delete n.schema.nodes[e]}),n.schema.marks={...e.schema.marks},n.schema.topNodeType=e.schema.nodes[t],n.extensionManager.schema=n.schema}}),this.innerEditor.gammaOrgId=e.gammaOrgId,this.innerEditor.gammaDocId=e.gammaDocId,this.innerEditor.parentEditor=e,this.innerEditor.view.updateState=function(e){if(!this.docView){this.state=e;return}this.updateStateInner(e,this.state.plugins!=e.plugins)},this.innerEditor.view.update=function(e){this.docView&&r_.Lz.prototype.update.call(this,e)},this.updateProps({innerEditor:this.innerEditor}),this.innerEditor}destroy(){var e;this.isDestroyed=!0,null===(e=this.innerEditor)||void 0===e||e.destroy(),super.destroy()}update(e,t){var l;if(!e.sameMarkup(this.node))return!1;this.node=e;let a=null===(l=this.innerEditor)||void 0===l?void 0:l.view;if(!a)return!0;let n=a.state,o=e.content.findDiffStart(n.doc.content);if(null!=o){let{a:t,b:l}=e.content.findDiffEnd(n.doc.content),i=o-Math.min(t,l);i>0&&(t+=i,l+=i),a.dispatch(n.tr.replace(o,l,e.slice(o,t)).setMeta(r5.k,!0).setMeta("preventAutolink",!0))}return super.update(e,t)}stopEvent(e){return!!this.innerEditor&&this.innerEditor.view.dom.contains(e.target)}ignoreMutation(){return!0}get contentDOM(){return null}constructor(e,t,l){super(e,t,l),this.isDestroyed=!1,this.editorOptions=l,this.updateProps({mountEditor:()=>this.mountEditor(),destroyEditor:()=>{var e,t,l;null===(e=this.innerEditor)||void 0===e||e.destroy(),null===(t=(l=this.editor.commands).forceHideBubbleMenu)||void 0===t||t.call(l,!1),setTimeout(()=>{this.updateProps({innerEditor:void 0})})}})}}function r8(e,t){return l=>new r3(e,l,t)}let r7=r.YY.create({name:"innerEditorExtension",addOptions:()=>({outerEditor:null,getPos:null}),addProseMirrorPlugins(){let{outerEditor:e,getPos:t}=this.options;return[new V.k_({appendTransaction:l=>{let a=l[0];if(!a)return null;if(!a.getMeta(r5.k)){let a=e.state.tr,n=d.Lm.offset(t()+1);for(let e=0;ee.commands.undo(),"Mod-y":()=>e.commands.redo()}}}),r9=(e,t)=>{let l=t.mapResult(e.from,1),a=t.mapResult(e.to,-1),n=t.map(e.gapFrom,1),o=t.map(e.gapTo,1);return l.deletedAcross&&a.deletedAcross||na.pos?null:new d.Wg(l.pos,a.pos,n,o,e.slice,e.insert,e.structure)},se=e=>{let[t,l]=(0,F.useState)(null);return(0,F.useEffect)(()=>{if(!e)return;let t=e=>{let{editor:t}=e;l(t.state.selection)};t({editor:e});let a=nT()(t,200,{leading:!0});return e.on("selectionUpdate",a),()=>{e.off("selectionUpdate",a)}},[e]),{selection:t}},st=e=>{let{decorations:t,editor:l,getPos:a,destroyEditor:n,mountEditor:o}=e,i=(0,J.jL)();se(l);let{mountEditor:r,activeNoteCardId:s}=(0,J.GV)(ib.rd),{parentCardId:d,isNested:u}=(0,ei.tg)(t),c=!u&&(0,iy.I5)(l,a(),d),m=s===d&&"function"==typeof o&&r===o,f=c&&!m&&!!o&&!u&&!l.isThumbnail;(0,F.useEffect)(()=>{f&&requestAnimationFrame(()=>{i((0,ib.Lz)({activeNoteCardId:d,mountEditor:o,destroyEditor:n}))})},[f,n,i,o,d])};var sl=l(49572);let sa=new V.hs("cardNotesPlugin"),sn=(e,t)=>new V.k_({key:sa,props:{attributes:()=>{let l=t.getState();return(0,ib.Iw)(l)&&(0,iy.x8)()&&!(0,iy.NO)(e)&&(0,es.nD)(l)&&!e.isStatic?{class:"card-notes-active"}:{class:""}},decorations:l=>{let{doc:a,selection:n}=l,o=t.getState();if(!(0,ib.Iw)(o)||!(0,iy.x8)()||(0,iy.NO)(e)||!(0,es.nD)(o)||e.isStatic)return;let i=(0,aH.hT)(e.state.doc,n.from);if(i)return r_.zF.create(a,[r_.NZ.node(i.pos,i.pos+i.node.nodeSize,{class:"card-notes-active-parent-card"})])}},appendTransaction:(t,l,a)=>{if(!(0,iy.x8)()||(0,iy.NO)(e)||e.isThumbnail||e.isStatic)return;let n=a.tr;return((0,sl.z)(t,l,a,n,"cardNotes"),si(t,l,a,n),n.docChanged)?n:null}}),so=e=>e.map(e=>{let t=0===e.slice.content.size;return e.from!==e.to&&t?{type:"delete",step:e}:e.from!==e.to||t?e.from===e.to||t?null:{type:"replace",step:e}:{type:"insert",step:e}}).filter(e=>!!e),si=(e,t,l,a)=>{e.forEach(e=>{let n=e.steps.filter(e=>e instanceof d.Ln||e instanceof d.Wg);1!==n.length||(0,aa.he)(e)||e.getMeta(r5.R)||e.getMeta("appendedTransaction")||e.getMeta("cardNotesHandled")||e.getMeta("rearrangeCards")||so(n).filter(e=>"delete"===e.type||"replace"===e.type).forEach(e=>{let{step:n}=e,{from:o,to:i}=n;t.doc.nodesBetween(o,i,(e,n)=>{if("cardNotes"===e.type.name){var i;let s=t.doc.resolve(n),d=(0,r.eL)(s,$.jg),u=(0,r.xe)(l.doc,e=>(0,$.jg)(e)&&e.attrs.id===(null==d?void 0:d.node.attrs.id));if(!u[0])return;let c=(0,r.xe)(u[0].node,e=>"cardNotes"===e.type.name);if(c.length>0&&(null===(i=c[0])||void 0===i?void 0:i.node.content.eq(e.content))&&u[0].pos===(null==d?void 0:d.pos))return;let m=(0,aH.hT)(l.doc,o);if(!m){console.warn("[preventNotesDelete] parentCard not found");return}let f=l.doc.resolve(m.pos);if((0,iy.PD)(f)){let t=iX(l.doc,m.pos,!1);if(null===t){console.warn("[preventNotesDelete] insertPos not found");return}a.insert(t,e.content)}else{let t=m.pos+m.node.nodeSize-1;a.insert(t,e)}}})})})},sr=r.bP.create({name:"cardNotes",content:"cardNotesBlock+",selectable:!1,atom:!0,parseHTML:()=>[{tag:"div[class=card-notes]"},{tag:"notes"}],renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,r.KV)(t,{class:"card-notes"}),0]},renderHTMLforAI:()=>["notes",0],renderText:()=>"",addProseMirrorPlugins(){let e=(0,J.KA)();return[sn(this.editor,e)]},addNodeView(){return this.editor.shouldUsePublishedVersion?(0,u.gu)(()=>null):r8(st,{nodeName:this.name,preventNodeOrExtensionTypes:["dropCursor","smartLayout","doc","document","card","embed","slashMenu","mediaUpload","GammaMention"]})}});var ss=l(84607),sd=l(39761);let su=e=>(0,m.jsx)(f.az,{bg:"var(--body-color)",opacity:"0.4",borderRadius:"sm",...e});var sc=l(87487),sm=l(85146),sf=l(82257),sp=l(50201),sg=l(38888),sh=l(30503);let sb=(0,F.memo)(e=>{let{cardId:t,docId:l,editor:a,cards:n,level:o,showNested:i,isPresentMode:r}=e,s=(0,ep.d)({cardId:t,editor:a}),d=(0,J.GV)(es.Jo),u=(0,F.useCallback)(e=>{(0,sp.T)(a,e,t)},[a,t]),c=(0,sf.oR)(),p=(0,F.useMemo)(()=>{let e=(0,o5.Io)({cardId:t,docId:l,isPresentMode:r});return c?(0,sh.M7)({url:e,doc:d}):e},[t,l,d,r,c]),{listStyle:g,paddingStart:h,marginStart:b}=(0,sg.WI)(o);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(sm.B8,{mb:"0.5em",children:(0,m.jsx)(sm.ck,{listStyleType:g,ps:h,ms:b,children:(0,m.jsx)(f.az,{display:"inline",children:(0,m.jsx)(eY.N,{href:p,className:"link",role:"link",isExternal:!c,noOfLines:1,wordBreak:"break-word",onClick:u,display:"-webkit-inline-box",verticalAlign:"top",children:(null==s?void 0:s.title)||(0,m.jsx)(em.x6,{id:"wja8aL"})})})})}),i&&n.map(e=>(0,m.jsx)(sb,{cardId:e.id,cards:e.children,editor:a,level:o+1,showNested:i,docId:l,isPresentMode:r},e.id))]})});sb.displayName="CardTOCItem";let sy=e=>{let{node:t,editor:l,getPos:a}=e,{nested:n}=t.attrs,o=a(),i=(0,aH.hT)(l.state.doc,o),r=(0,J.GV)((0,es.xO)({cardId:null==i?void 0:i.node.attrs.id,showAll:nI.LD})),s=(0,J.GV)(es.Jo),d=(0,J.GV)(es.wC),u=(0,J.GV)(es.jO),c=d===ok.w.SLIDE_VIEW;return(0,m.jsx)(p.u,{...e,as:"div",children:(0,m.jsxs)(f.az,{cursor:"default",pointerEvents:u?"none":void 0,borderRadius:"var(--box-border-radius)","data-selection-ring":!0,className:"card-toc",children:[0===r.length&&(0,m.jsxs)(t2.F,{colorScheme:"gray",color:"gray.800",fontFamily:"Inter, sans-serif",fontSize:"1em",py:"0.75em",px:"1em",children:[(0,m.jsx)(t6._,{w:"1em",h:"1em",alignSelf:"center",mr:"0.75em"}),(0,m.jsxs)(f.az,{children:[(0,m.jsx)(ss.X,{fontSize:"1em",lineHeight:"1.5em",children:(0,m.jsx)(em.x6,{id:"519v/x"})}),(0,m.jsx)(sd.T,{fontSize:"0.75em",lineHeight:"1.5em",children:(0,m.jsx)(em.x6,{id:"HmhQ3B"})})]})]}),r.map(e=>(0,m.jsx)(sb,{cardId:e.id,cards:e.children,editor:l,level:0,showNested:n,docId:(null==s?void 0:s.id)||"",isPresentMode:c},e.id))]})})},sv=e=>(0,m.jsx)(sc.V,{children:(0,m.jsxs)(eC.T,{spacing:"0.5em",align:"start",children:[(0,m.jsx)(su,{h:"1em",w:"14em",bg:"var(--link-color)"}),(0,m.jsx)(su,{h:"1em",w:"14em",bg:"var(--link-color)"}),(0,m.jsx)(su,{h:"1em",w:"14em",bg:"var(--link-color)"}),(0,m.jsx)(su,{h:"1em",w:"14em",bg:"var(--link-color)"})]})}),sk=r.bP.create({name:"tableOfContents",group:"block",atom:!0,selectable:!0,dynamic:!0,addAttributes:()=>({nested:{default:!1}}),parseHTML:()=>[{tag:"div[class=toc]"}],renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,r.KV)(t,{class:"toc"})]},addNodeView(){return this.editor.isThumbnail?(0,u.gu)(sv,{update:c.z0}):(0,u.gu)(sy,{update:c.z0})}});var sw=l(50885),sx=l(919),sS=l(83377),sA=l(74207),sC=l(10541),sz=l(25841);let sI={serialize(e){let{omitIds:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=["colgroup",{}],a=["tbody",{}],n=["table",{},l,a];return e.rows.forEach((n,o)=>{let i=["tr",{}];t||(i[1].id=n.id),a.push(i),e.columns.forEach(a=>{if(0===o){let{type:e,label:n,format:o,id:i,fixedType:r}=a,s=["col",{type:e,label:n,format:o,"fixed-type":r}];t||(s[1].id=i),l.push(s)}let r=e.getCell({column:a.id,row:n.id});i.push(["td",{type:r.type},["value",{},r.textValue]])})}),n},parse(e){let t=[],l=[],a=[];for(let n of e.children)switch(n.tagName){case"COLGROUP":t=[...n.children].filter(e=>"COL"===e.nodeName).map(e=>{var t;return new sA.n({id:e.getAttribute("id")||void 0,type:e.getAttribute("type")||"label",label:e.getAttribute("label")||"",format:e.getAttribute("format")||"raw",fixedType:(null===(t=e.getAttribute("fixed-type"))||void 0===t?void 0:t.toLowerCase())==="true"})});break;case"TBODY":if(!t.length)throw Error("No columns defined before tbody");l=[...n.children].filter(e=>"TR"===e.nodeName).map(e=>{let l=new sz.N({id:e.getAttribute("id")||void 0});return!function(e,l){[...e.children].filter(e=>"TD"===e.nodeName).forEach((e,n)=>{let o=e.getElementsByTagName("value").item(0),i=t[n],r={row:l,column:i},s="data"===i.type?new sx.T(r):new sS.l(r);s.textValue=(null==o?void 0:o.textContent)?o.textContent:"",a.push(s)})}(e,l),l})}return new sC.h({columns:t,rows:l,cells:a})}};var sj=l(39933),sF=l(77447),sB=l(4300),sR=l(21404),s_=l(36227),sM=l(16130);function sE(e){for(let t of e.columns)if(!t.isEmpty(e)&&"data"===t.type)return t;return null}function sT(e){for(let t of e.columns)if(!t.isEmpty(e)&&"label"===t.type)return t;return null}var sO=l(96362),sP=l(84511),sN=l(98736),sD=l(28423);let sL=e=>{let{direction:t="vertical",definition:l,textValue:a,x:n,y:o,width:i,height:r,bounds:s,offset:d={x:0,y:0},onPositionChange:u,invertColorOfInsideText:c}=e,f=(()=>{if(!l)return!1;let e=l.getDimensions(a),u=e.width+d.x,c=e.height+d.y;return"vertical"===t?l.inside?(l.rotate?u:c)+l.margin=s.width})(),p=(0,F.useMemo)(()=>({x:"vertical"===t?n+i/2+d.x:n+i+(l.margin+d.x)*(f?-1:1),y:"vertical"===t?o+(d.y+l.margin)*(f?1:-1):o+r/2+d.y}),[n,i,d.x,o,r,d.y,f,t,l.margin]);return((0,F.useEffect)(()=>{null==u||u(p)},[p]),l.hide)?null:(0,m.jsx)(sD.A,{pointerEvents:"none",...p,textAnchor:l.rotate?f?"end":"start":"vertical"===t?"middle":f?"end":"start",verticalAnchor:"vertical"===t?l.rotate?"middle":f?"start":"end":"middle",style:{...l.textStyles,userSelect:"none",filter:f&&c?"invert(1)":void 0},angle:l.rotate?270:0,children:a})};var sW=l(32598),sU=l(33780),sG=l(28466),sH=l(34992),sV=l(69651),sq=l(14356),sK=l(20685),sJ=l.n(sK),s$=l(77936);let sQ={top:8,bottom:2,right:1,left:4},sY=e=>{let{color:t,labelCells:l,dataCells:a,height:n,children:o,textColor:i,tickColor:r,tiny:s=!1,width:d,fontFamily:u="var(--body-font)",fontSize:c="var(--chakra-fontSizes-sm)",fontWeight:f="var(--body-font-weight)",margin:p=sP.PH,direction:g="vertical",hideLabels:h=!1,padding:b=0,labelPadding:y=.3,pullToZero:v=!0,onMouseMove:k,onMouseLeave:w,onMouseMoveInside:x,onMouseLeaveInside:S}=e,A=s?2:14,C=s?{top:1,right:0,bottom:2,left:0}:sQ,z=s?{top:0,right:0,bottom:0,left:0}:p,I=!!s||h;s&&(c="2px",b=0);let j=s?.5:2,B=s?1:6,R=a.map(e=>e.data),_=a.reduce((e,t)=>{if("mixed"===e)return e;let l=t.getFormatter().type;return""===e||e===l?l:"mixed"},""),M=Math.max(...R),E=Math.min(...R),T=l.length?l:a.map(e=>({position:{row:e.position.row},textValue:""})),O=(0,F.useMemo)(()=>{let e="percentage"===_&&M<=100?100:null;return function(e,t,l,a){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;if(null!==n&&t>n&&(console.error("`capAt` MUST be larger than `max`",{capAt:n,max:t}),n=null),!a){let l=(0,sH.A)({range:[0,1],domain:[e,Math.max(t,0)]}).ticks();a=l.length<2?1:Math.abs(l[1]-l[0])}let o=(0,s$.yw)(Math.max(t,0),a,1),i=(0,s$.yw)(e,a,-1),r=(0,s$.yw)((o-i)/(l-1),a,1);r&&r!==a&&(i=(0,s$.yw)(i,r,-1));let s=[i];for(;s[s.length-1]2*l)););return null!==n&&s[s.length-1]>=n?Array.from({length:l+1}).map((e,t)=>(i+(o-i)/l)*t):s}(v?Math.min(E,0):E,M,4,void 0,e)},[E,M,v,_]),P=a[0].getFormatter(),N="vertical"===g?O.map(e=>P.format(e)):T.map(e=>sJ()(e.textValue,{length:25,separator:" "})),D=(0,s$.Vr)(N,{fontFamily:u,fontSize:c,fontWeight:f}),L=I?0:D.maxWidth,W={top:z.top+C.top,right:z.right+C.right,bottom:z.bottom+j+(I?0:B+C.bottom),left:z.left+L+j+(I?0:B+C.left)},U=("vertical"===g?T:a).map(e=>{let{textValue:t}=e;return sJ()(t,{length:25,separator:" "})}),{bottomTickValues:G,bottomLabels:H,rotateLabels:V,labelsHeight:q,splitIx:K}=sX({em:A,textStyles:{fontFamily:u,fontSize:c,fontWeight:f},hideLabels:I,padding:b,height:n,width:d,margin:W,labelCells:T,labelStrings:U}),J=n-W.top-W.bottom-q,$="horizontal"===g&&J/N.length{let{position:{row:t}}=e;return t}),Q=d-W.left-W.right,Y=T.map(e=>"".concat(e.position.row,":").concat(e.textValue)).join(","),{labelScale:X,labelIndex:Z}=(0,F.useMemo)(()=>({labelScale:(0,sB.A)({range:"vertical"===g?[0,Q]:[0,J],domain:T.map(e=>e.position.row),paddingInner:y,paddingOuter:.3}),labelIndex:Object.fromEntries(T.map(e=>[e.position.row,e]))}),[Q,g,J,Y,y]),ee=(0,F.useMemo)(()=>{let e=O[0],t=O[O.length-1];return(0,sH.A)({range:"horizontal"===g?[E<0?b:0,Q]:[J-(E<0?b:0),j+b],round:!0,domain:[e,t]})},[O,J,E,Q,g,b,j]),et=(()=>{if(!x&&!S)return null;let e=e=>t=>{e(t,function(e,t){var l;let a=null!==(l=(0,sG.A)(e))&&void 0!==l?l:{x:e.clientX,y:e.clientY};return{svgCoords:a,axisCoords:{x:a.x-t.left,y:a.y-t.top}}}(t,W))};return{move:x&&e(x),leave:S&&e(S)}})();return(0,m.jsxs)("svg",{width:"100%",viewBox:"0 0 ".concat(d," ").concat(n),height:"100%",preserveAspectRatio:"none",overflow:"visible",onMouseMove:k,onMouseLeave:w,children:[O.map((e,l)=>"vertical"===g?(0,m.jsx)(sV.A,{from:{x:W.left,y:ee(e)+W.top},to:{x:d,y:ee(e)+W.top},stroke:t,opacity:0===e?.5:.2},l):(0,m.jsx)(sV.A,{from:{x:W.left+ee(e),y:W.top},to:{x:W.left+ee(e),y:J},stroke:t,opacity:0===e?.5:.2},l)),et&&(0,m.jsx)(sR.A,{fill:"transparent",opacity:.2,x:W.left,y:W.top,height:J,width:Q,onMouseMove:et.move,onMouseLeave:et.leave}),o({labelScale:X,dataScale:ee,yMax:J,xMax:Q,margin:{...W}}),(0,m.jsx)(sF.A,{children:"vertical"===g?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(sW.A,{top:W.top,left:W.left,scale:ee,stroke:t,rangePadding:E<0?-1*b:0,strokeWidth:j,tickValues:I?[]:O,tickFormat:P.format.bind(P),tickLength:B,tickStroke:r||t,tickLabelProps:()=>({fill:i||t,textAnchor:"end",fontFamily:u,fontSize:c,fontWeight:f,dy:"0.33em",dx:s?0:-4,userSelect:"none"})}),(0,m.jsx)(sU.A,{top:J+W.top,left:W.left,scale:X,stroke:t,tickValues:G,tickFormat:(e,t)=>H[t],tickStroke:r||t,tickLabelProps:(e,l)=>({fill:i||t,fontFamily:u,fontSize:c,fontWeight:f,userSelect:"none",dy:s?0:4,i:l}),strokeWidth:j,tickLength:B,tickComponent:e=>{let{x:t,y:l,i:a,dy:n,formattedValue:o,...i}=e;return(0,m.jsx)("g",{alignmentBaseline:"middle",...i,children:V||!K[a]?(0,m.jsx)("text",{x:t,y:l,dy:n,transform:V?"rotate(-45, ".concat(t,", 0)"):"",textAnchor:V?"end":"middle",children:o}):(o||"").split(" ").map((e,o)=>(0,m.jsx)("text",{x:t,y:l+A*o,dy:n,textAnchor:"middle",children:e},"".concat(a,":").concat(o)))})}})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(sW.A,{top:W.top,left:W.left,scale:X,stroke:t,strokeWidth:j,tickLength:B,tickValues:I?[]:$,tickFormat:e=>sJ()(Z[e].textValue,{length:25,separator:" "}),tickStroke:r||t,tickLabelProps:()=>({fill:i||t,textAnchor:"end",fontFamily:u,fontSize:c,fontWeight:f,dy:"0.33em",dx:s?0:-4,userSelect:"none"})}),(0,m.jsx)(sU.A,{top:J+W.top,left:W.left,scale:ee,stroke:t,rangePadding:E<0?b:0,tickValues:I?[]:O,tickFormat:P.format.bind(P),tickLength:B,tickStroke:r||t,tickLabelProps:(e,l)=>({fill:i||t,textAnchor:0===l?"end":"middle",fontFamily:u,fontSize:c,fontWeight:f,userSelect:"none",dy:s?0:4}),strokeWidth:j})]})})]})},sX=e=>{let{em:t,textStyles:l,hideLabels:a,padding:n,height:o,width:i,margin:r,labelStrings:s,labelCells:d}=e,u=s.join(","),c=(i-r.left-r.right)/s.length,{fontFamily:m,fontSize:f,fontWeight:p}=l;return(0,F.useMemo)(()=>{let e=[...s],i={bottomTickValues:[],rotateLabels:!1,labelsHeight:0,splitIx:[],sliceWidth:c,bottomLabels:[]};if(a||c<=t+3)return i;let{widths:u,maxWidth:m}=(0,s$.Vr)(s,l),f=!1,p=t,g=d.map(e=>{let{position:{row:t}}=e;return t}),h=s.map((e,a)=>{if(f||u[a]c-n)return f=!0,!0;let r=o.length*t;return r>p&&(p=r),!0});if(!f)return{bottomTickValues:g,rotateLabels:f,labelsHeight:p,splitIx:h,sliceWidth:c,bottomLabels:e};let b=e=>Math.cos(Math.PI/4)*e-(t+7);p=Math.sin(Math.PI/4)*m;let y=b(m);if(y>.3*o)return i;let v=e=>r.left+c*e+c/2;for(let t=0;ty)break;if(b(u[t])>a){let n=(0,s$.jp)(s[t],e=>{let t=(0,sq.A)(e,l);if(null===t)return -1;let n=b(t);return na?-1:0});if(!n)return console.log("could not truncate"),i;e[t]=n}}return{bottomTickValues:g,bottomLabels:e,rotateLabels:f,labelsHeight:p,splitIx:h,sliceWidth:c}},[t,o,u,m,f,p,a,n,c])};var sZ=l(27372);let s0=e=>{let{data:t,render:l,getColor:a,getOpacity:n,onMouseOver:o,onMouseLeave:i,onClick:r,onDoubleClick:s,textColor:d,position:u="bottom",width:c}=e,p=(0,F.useRef)(null),[g,h]=(0,F.useState)(0),[b,y]=(0,F.useState)(!1),v=["top","bottom"].includes(u)?{width:"100%",display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(".concat(g,"em, 1fr))"),justifyItems:b?"flex-start":"center",alignSelf:"stretch","& > div:first-child":{justifySelf:b?void 0:"flex-end"},"& > div:last-child":{justifySelf:b?void 0:"flex-start"}}:{height:"100%",flexDir:"column"},k=t.map(e=>l(e)).join("|");return(0,F.useEffect)(()=>{let e=0;if(!p.current)return;let t=(0,s$.us)(p.current);for(let t of p.current.querySelectorAll(":scope > div")){var l;t.style.width="min-content";let a=(null===(l=t.getClientRects()[0])||void 0===l?void 0:l.width)||0;t.style.width="",a>e&&(e=a)}h(parseFloat((e/t).toFixed(2)))},[k]),(0,F.useEffect)(()=>{y(!!p.current&&function(e){var t;let l=e.children;if(!l.length)return!1;let a=null===(t=l.item(0))||void 0===t?void 0:t.offsetTop;for(let e of l)if(e.offsetTop!==a)return!0;return!1}(p.current))},[c,g]),(0,m.jsx)(eN.s,{ref:p,sx:v,flexGrow:0,flexShrink:1,flexWrap:"wrap",alignContent:["left","top"].includes(u)?"flex-end":"flex-start",justifyContent:"center",gap:5,children:t.map((e,t)=>(0,m.jsxs)(C.z,{flexGrow:0,flexShrink:1,opacity:n?n(e,t):1,cursor:"pointer",onMouseOver:null==o?void 0:o(e,t),onMouseLeave:null==i?void 0:i(e,t),onClick:null==r?void 0:r(e,t),onDoubleClick:null==s?void 0:s(e,t),transition:"opacity ".concat(sP.UG,"s"),minW:"min-content",gap:2,alignItems:"flex-start",children:[(0,m.jsx)(f.az,{flex:"0 0 auto",as:sZ.P.div,width:"1em",height:"1em",flexShrink:0,bg:a(e,t),borderRadius:"sm",animate:{backgroundColor:a(e,t)},children:" "}),(0,m.jsx)(z.E,{flex:"0 1 auto",fontSize:"1em",lineHeight:"1em",color:d,textAlign:"left",children:sJ()(l(e),{length:30})})]},t))})};function s1(){let e=(0,F.useRef)(null);return(0,F.useEffect)(()=>()=>{e.current&&(clearTimeout(e.current),e.current=null)},[]),{clickHandler:t=>l=>{e.current||(e.current=setTimeout(()=>{e.current=null,t(l)},200))},doubleClickHandler:t=>l=>{e.current&&(clearTimeout(e.current),e.current=null),t(l)}}}let s2=e=>{let{showInlineLabels:t,dataCells:l,scale:a,textStyles:n,direction:o,labelMargin:i=5}=e,r=l.flatMap(e=>e.map(e=>e.textValue)),s=r.join("|"),d=a.bandwidth();return(0,F.useMemo)(()=>{if(!t)return;let e=l[0].length>1?(0,sB.A)({range:[0,d],domain:l[0].map(e=>e.textValue),paddingInner:.2}):a,s=(0,s$.Vr)(r,n),u="vertical"===o&&s.maxWidth+i>=e.bandwidth(),c="vertical"===o?u&&s.maxHeight+i>=e.bandwidth():s.maxHeight+i>=e.bandwidth(),m=Object.fromEntries(r.map((e,t)=>[e,t]));return{margin:i,rotate:u,hide:c,textStyles:n,getDimensions:e=>{let t=m[e];return{width:void 0===t?0:s.widths[t],height:void 0===t?0:s.heights[t]}},inside:!1}},[t,n,s,o,d,i])};var s6=l(11403),s4=l(60524),s5=l(50089),s3=l(54306);let s8=e=>{let{TooltipInner:t}=e,{showTooltip:l,tooltipOpen:a,tooltipLeft:n,tooltipTop:o,tooltipData:i,hideTooltip:r}=(0,s5.A)(),s={minW:"5rem",textAlign:"left",pointerEvents:"none",...(0,s6.Vl)("Tooltip")},d=(0,F.useRef)();return(0,F.useEffect)(()=>()=>{d.current&&clearTimeout(d.current)},[]),{mouseMoveHandler:(e,t)=>a=>{d.current&&clearTimeout(d.current);let n=t?t(e,a):(0,s$.OP)(a);l({tooltipData:{...e,position:e.position},tooltipTop:null==n?void 0:n.y,tooltipLeft:null==n?void 0:n.x})},mouseLeaveHandler:e=>e=>{d.current=window.setTimeout(()=>{r()},300)},renderTooltip:function(){return a&&i?(0,m.jsx)(s7,{style:{},top:o,left:n,sx:{...s,top:void 0,left:void 0,userSelect:"none",pointerEvents:"none"},position:"absolute",contentEditable:!1,suppressContentEditableWarning:!0,children:(0,m.jsx)(t,{...i})},Math.random()):null}}},s7=(0,s4.B)(s3.A,{shouldForwardProp:e=>["top","left","style","children"].includes(e)});var s9=l(67718);let de=e=>{let{dispatch:t}=(0,F.useContext)(s9.uR),l=e.filter(e=>e instanceof sA.n).map(e=>e.id),a=l.join(",");(0,F.useEffect)(()=>(t({type:"reportActiveColumnIds",payload:l}),()=>{t({type:"reportActiveColumnIds",payload:void 0})}),[a,t])},dt=function(){let{textColor:e="var(--body-color)",fontFamily:t="var(--body-font)",fontSize:l="var(--chakra-fontSizes-sm)",fontWeight:a="var(--body-font-weight)"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,F.useMemo)(()=>({fontFamily:t,fontSize:l,fontWeight:a,fill:e}),[e,t,l,a])},dl=e=>{let{showZero:t,data:l,dataColumns:a,animationDuration:n,barColors:o,textColor:i,direction:r,selectCell:s,tooltipEnter:d,tooltipLeave:u,dataScale:c,labelScale:f,yMax:p,xMax:g,margin:h,minValueGreaterThanZero:b,onDataClick:y,onDataDoubleClick:v,isThumbnail:k,focusedPosition:w,setFocusedPosition:x,showInlineLabels:S}=e,A=(0,sN.wQ)(a,"id"),C=dt({textColor:i}),z=l.rows.map(e=>e.getCells(l).filter(e=>!!A.get(e.position.column))),I=s2({dataCells:z,textStyles:C,scale:f,direction:r,showInlineLabels:S});return(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(sF.A,{top:h.top,left:h.left,children:l.rows.map((e,l)=>{let a="group-".concat(e.id);return(0,m.jsx)(dn,{animationDuration:n,barColors:o,data:z[l],showZero:t,yMax:p,xMax:g,dataScale:c,inlineLabels:I,labelScale:f,selectCell:s,direction:r,globalMinValueGreaterThanZero:b,tooltipEnter:d,tooltipLeave:u,onDataClick:y,onDataDoubleClick:v,borderRadius:k?1:5,focusedPosition:w,setFocusedPosition:x},a)})})})},da=e=>{var t,l;let{TooltipInner:a,showZero:n=!0,data:o,textColor:i,accentColor:r,animationDuration:s=sP.UG,isThumbnail:d=!1,width:u,height:c,chartType:p,colorScheme:g=sP.gb,hideLabels:h,showInlineLabels:b,onDataClick:y,onDataDoubleClick:v,backgroundColor:k,chartOptions:w}=e,x="horizontal-bar"===p?"horizontal":"vertical",{renderTooltip:S,mouseMoveHandler:A,mouseLeaveHandler:C}=s8({TooltipInner:a}),[z,I]=(0,F.useState)(null),j=sT(o),B=(null==j?void 0:j.getCells(o))||[],R=o.columns.filter(e=>{let{type:t}=e;return"data"===t}),_=R.map(e=>e.getCells(o)).flat(),M=R.length>1&&!h,E=Math.min(..._.map(e=>e.data).filter(e=>e>0)),T=R.map(e=>{let{id:t}=e;return t}),O=(0,sO.M)(r,T.length>1?T:[...new Set(_.map(e=>e.position.row))],g,{contrastColor:k}),P=(0,s$.jt)(d),N=null!==(t=w["vertical"===x?"bar":"horizontal-bar"])&&void 0!==t?t:{};return de([j,...R]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(f.az,{"data-test":"bar-chart-container",height:M?"calc(100% - ".concat(3,"em)"):"100%",cursor:"default",userSelect:"none",contentEditable:!1,children:[(0,m.jsx)(sY,{width:u,height:M?c-3*P:c,labelCells:B,dataCells:_,color:i,textColor:i,tiny:d,direction:x,hideLabels:h,pullToZero:null===(l=N.axisPullToZero)||void 0===l||l,children:e=>(0,m.jsx)(dl,{showZero:n,barColors:O,data:o,textColor:i,dataColumns:R,animationDuration:s,direction:x,tooltipEnter:A,tooltipLeave:C,minValueGreaterThanZero:E,onDataClick:y,onDataDoubleClick:v,isThumbnail:d,focusedPosition:z,setFocusedPosition:I,showInlineLabels:b,...e})}),M&&(0,m.jsx)(s0,{width:u,data:R,render:e=>e.label,getColor:e=>O.get(e.id),textColor:i,onMouseOver:e=>()=>I({row:"_",column:e.id}),onMouseLeave:()=>()=>I(null)})]}),S()]})},dn=e=>{var t;let{animationDuration:l,barColors:a,data:n,showZero:o,yMax:i,xMax:r,dataScale:s,inlineLabels:d,labelScale:u,direction:c,globalMinValueGreaterThanZero:f,tooltipEnter:p,tooltipLeave:g,onDataClick:h,onDataDoubleClick:b,borderRadius:y,focusedPosition:v,setFocusedPosition:k}=e,{clickHandler:w,doubleClickHandler:x}=s1(),S=u.bandwidth(),A=u(null===(t=n[0])||void 0===t?void 0:t.position.row)||0,C=(0,F.useMemo)(()=>{let e=n.map(e=>e.position.column);return(0,sB.A)({range:[A,A+S],domain:e,paddingInner:e.length>1?.2:0})},[S,n,A]),z=o?s(f):0,I=e=>{let t=p(e);return l=>{t(l),k(e.position)}},j=e=>{let t=g(e);return e=>{t(e),k(null)}},B=e=>null!==v&&(n.length>1?v.column!==e.position.column:v.row!==e.position.row);return(0,m.jsx)(sF.A,{children:n.map(e=>{let t={dataScale:s,value:e,innerScale:C,yMax:i,xMax:r,scaledMinValueGreaterThanZero:z,showZero:o},{x:u,y:f,width:p,height:g,roundedCorners:v}="vertical"===c?function(e){var t,l;let{dataScale:a,value:n,innerScale:o,showZero:i,scaledMinValueGreaterThanZero:r}=e,s=Math.min(a.range()[0],a(0)),d=s-(null!==(t=a(n.data))&&void 0!==t?t:0),u=d,c=null!==(l=o(n.position.column))&&void 0!==l?l:0,m=s-u,f=o.bandwidth(),p={topLeft:!0,topRight:!0,bottomLeft:!1,bottomRight:!1};return i&&Math.abs(s-r)>12&&6>Math.abs(d)&&(u=6,a.domain()[0]<0?(m-=3,p.bottomLeft=!0,p.bottomRight=!0):m-=6),u<0&&(m+=u,p.topLeft=!1,p.topRight=!1,p.bottomLeft=!0,p.bottomRight=!0),{x:c,y:m,height:Math.abs(u),width:f,roundedCorners:p}}(t):function(e){let{dataScale:t,value:l,innerScale:a,showZero:n,scaledMinValueGreaterThanZero:o}=e,i=Math.max(t.range()[0],t(0)),r=i,s=a(l.position.column),d=t(l.data)-i,u=a.bandwidth(),c=d,m={topLeft:!1,topRight:!0,bottomLeft:!1,bottomRight:!0};return n&&o>12&&6>Math.abs(d)&&(c=6,t.domain()[0]<0&&(r-=3,m.bottomLeft=!0,m.topLeft=!0)),c<0&&(r+=c,m.bottomLeft=!0,m.bottomRight=!1,m.topLeft=!0,m.topRight=!1),{x:r,y:s,height:u,width:Math.abs(c),roundedCorners:m}}(t);return(0,m.jsx)(di,{yMax:i,xMax:r,x:u,y:f,direction:c,width:p,height:g,radius:y,topLeft:v.topLeft,topRight:v.topRight,bottomRight:v.bottomRight,bottomLeft:v.bottomLeft,fill:a.get(n.length>1?e.position.column:e.position.row),label:d?{...d,label:e.textValue}:void 0,opacity:B(e)?.5:1,duration:l,onMouseLeave:j(e),onMouseMove:I(e),onClick:h?w(h.bind(void 0,e)):void 0,onDoubleClick:b?x(b.bind(void 0,e)):void 0,style:{cursor:"pointer",transition:"opacity .25s"}},e.key)})})},di=e=>{let{duration:t=0,y:l,x:a,height:n,width:o,yMax:i,xMax:r,innerRef:s,direction:d,label:u,opacity:c,style:f,...p}=e,[g,h]=(0,F.useState)(0),[b,y]=(0,F.useState)(o),[v,k]=(0,F.useState)(l+n),[w,x]=(0,F.useState)(a);return(0,F.useEffect)(()=>{(0,sM.i)(g,n,{duration:t,onUpdate:e=>h(e)})},[n]),(0,F.useEffect)(()=>{(0,sM.i)(b,o,{duration:t,onUpdate:e=>y(e)})},[o]),(0,F.useEffect)(()=>{(0,sM.i)(w,a,{duration:t,onUpdate:e=>x(e)})},[a]),(0,F.useEffect)(()=>{(0,sM.i)(v,l,{duration:t,onUpdate:e=>k(e)})},[l]),(0,m.jsxs)(sF.A,{children:[(0,m.jsx)(sR.A,{height:"vertical"===d?Math.max(0,i):g,width:"horizontal"===d?Math.max(0,r):b,x:"vertical"===d?w:0,y:"vertical"===d?0:v,...p,onClick:void 0,onDoubleClick:void 0,style:void 0,opacity:0}),(0,m.jsxs)("g",{opacity:c,style:f,children:[(0,m.jsx)(s_.A,{height:g,width:b,x:w,y:v,innerRef:s,...p}),u&&(0,m.jsx)(sL,{direction:d,textValue:u.label,definition:u,width:b,height:g,x:w,y:v,invertColorOfInsideText:!0,bounds:{x:0,y:0,width:r,height:i}})]})]})};var dr=l(4016),ds=l(74936);let dd=e=>{var t,l;let{data:a,TooltipInner:n,isThumbnail:o=!1,width:i,height:r,accentColor:s,textColor:d,colorScheme:u=sP.gb,hideLabels:c,backgroundColor:p,chartOptions:g,...h}=e,{renderTooltip:b,mouseMoveHandler:y,mouseLeaveHandler:v}=s8({TooltipInner:n}),[k,w]=(0,F.useState)(null),[x,S]=(0,F.useState)(null),A=sT(a),C=(null==A?void 0:A.getCells(a))||[],z=a.columns.filter(e=>{let{type:t}=e;return"data"===t}),I=z.map(e=>e.getCells(a)).flat(),j=z.map(e=>{let{id:t}=e;return t}),B=(0,sO.M)(s,j,u,{contrastColor:p}),R=(0,s$.jt)(o),_=z.length>1&&!c,M=_?r-3*R:r;return de([A,...z]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(f.az,{"data-test":"line-chart-container",height:_?"calc(100% - ".concat(3,"em)"):"100%",cursor:"default",contentEditable:!1,suppressContentEditableWarning:!0,userSelect:"none",children:[(0,m.jsx)(sY,{width:i,height:M,color:d,textColor:d,tiny:o,labelCells:C,dataCells:I,hideLabels:c,labelPadding:.6,pullToZero:null===(l=null===(t=g.line)||void 0===t?void 0:t.axisPullToZero)||void 0===l||l,onMouseMoveInside:o?void 0:(e,t)=>w(t.axisCoords),onMouseLeaveInside:o?void 0:()=>w(null),children:e=>(0,m.jsx)(du,{data:a,dataColumns:z,width:i,height:M,isThumbnail:o,getColor:B.get.bind(B),textColor:d,tooltipEnter:y,tooltipLeave:v,hoverPosition:k,highlightedColumn:x,chartOptions:g,...h,...e})}),_&&(0,m.jsx)(s0,{width:i,data:z,getColor:e=>B.get(e.id),textColor:d,render:e=>e.label,onMouseOver:e=>()=>S(e.id),onMouseLeave:()=>()=>S(null)})]}),b()]})},du=e=>{var t,l;let{labelScale:a,dataScale:n,data:o,dataColumns:i,isThumbnail:r,getColor:s,margin:d,tooltipEnter:u,tooltipLeave:c,chartOptions:{line:f={}},onDataClick:p,onDataDoubleClick:g,animationDuration:h=sP.UG,textColor:b,hoverPosition:y,highlightedColumn:v,showInlineLabels:k}=e,[w,x]=n.range(),[S,A]=(0,F.useState)(null),[C,z]=(0,F.useState)(null),I=dt({textColor:b}),j=(0,sN.wQ)(i,"id"),B=s2({dataCells:o.rows.map(e=>e.getCells(o).filter(e=>!!j.get(e.position.column))),textStyles:I,scale:a,direction:"vertical",showInlineLabels:1===i.length&&k}),R=e=>{let{data:t,position:{row:l}}=e;return{x:a(l)+a.bandwidth()/2,y:n(t)}},_=e=>{let t=u(e),l=R(e);return a=>{t(a),A(l),z(e.position.row)}},M=e=>{let t=c(e);return e=>{t(e),A(null),z(null)}};return(0,m.jsxs)(sF.A,{left:d.left,top:d.top,children:[(0,m.jsx)("line",{y1:x,y2:w,x1:0,x2:0,strokeWidth:1,stroke:b,transform:"translate(".concat(null!==(l=null!==(t=null==S?void 0:S.x)&&void 0!==t?t:null==y?void 0:y.x)&&void 0!==l?l:0,", 0)"),style:{opacity:"".concat(y||S?.8:0),pointerEvents:"none",transition:"opacity ".concat(h,"s, transform ").concat(S?.15:0,"s")}}),i[0].getCells(o).map(e=>(0,m.jsx)(sR.A,{opacity:0,height:w,width:a.bandwidth(),x:a(e.position.row),y:x,onMouseMove:_(e),onMouseLeave:M(e)},"p-".concat(e.key))),i.map(e=>{let t=e.getCells(o);return(0,m.jsx)(dc,{cells:t,isThumbnail:r,color:s(e.id),xScale:a,yScale:n,onDataClick:p,onDataDoubleClick:g,lineOptions:f,animationDuration:h,onMouseMove:_,onMouseLeave:M,highlightedRow:C,highlightedColumn:v,inlineLabels:B,height:w},e.id)})]})},dc=e=>{var t;let{cells:l,color:a,xScale:n,yScale:o,onDataClick:i,onDataDoubleClick:r,onMouseMove:s,onMouseLeave:d,lineOptions:u={},animationDuration:c,isThumbnail:f,highlightedRow:p,highlightedColumn:g,inlineLabels:h,height:b}=e,{clickHandler:y,doubleClickHandler:v}=s1(),k=n.bandwidth(),[w,x]=(0,F.useState)({}),S=dm(l,o,c),A=e=>n(e.position.row)||0,C=e=>(!!p||!!g)&&(g?g!==e.position.column:p!==e.position.row);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(ds.A,{data:l,x:e=>A(e)+k/2,y:S,stroke:a,strokeWidth:2,style:{pointerEvents:"none",transition:"opacity ".concat(c,"s")},opacity:(t=l[0],(p||g)&&(g?g!==t.position.column:!!p))?.3:1}),!f&&l.map(e=>{let t=w[e.key],l=A(e)+n.bandwidth()/2,o=S(e);return(0,m.jsxs)("g",{style:{transition:"opacity ".concat(c,"s")},opacity:u.hideMarkers?0:C(e)?.3:1,children:[h&&!h.hide&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(sL,{textValue:e.textValue,definition:h,width:k,height:b,x:A(e),y:S(e),offset:{y:Math.min(.1*b,50),x:0},onPositionChange:t=>{x(l=>({...l,[e.key]:t}))}}),t&&(0,m.jsx)("line",{x1:l,y1:o,x2:t.x,y2:t.y+5*(t.y>o?-1:1),stroke:h.textStyles.fill})]}),(0,m.jsx)(sZ.P.circle,{cx:l,cy:o,r:4,fill:a,stroke:a,style:{cursor:"pointer"},onMouseMove:s(e),onMouseLeave:d(e),onClick:i?y(i.bind(void 0,e)):void 0,onDoubleClick:r?v(r.bind(void 0,e)):void 0})]},"circle-".concat(e.key))})]})},dm=(e,t,l)=>{let a=(0,F.useRef)(Object.fromEntries(e.map(e=>[e.key,void 0]))),n=()=>e=>a.current[e.key],[o,i]=(0,F.useState)(()=>n());return(0,F.useEffect)(()=>{let o=t(0);if(0===o)return;let r=e.map(e=>{var r;let s=e.key;return(0,sM.i)(null!==(r=a.current[s])&&void 0!==r?r:o,t(e.data),{duration:l,ease:"easeOut",onUpdate:e=>{a.current[s]=e,i(()=>n())}})});return()=>{r.forEach(e=>{e.stop()})}},[e,t]),o||console.log("no getter"),o};var df=l(13643),dp=l(81003);let dg=e=>{let{targetValue:t,initialValue:l=0,duration:a=sP.UG}=e,[n,o]=(0,F.useState)(l);return(0,F.useEffect)(()=>{let{stop:e}=(0,sM.i)(n,t,{duration:a,onUpdate:e=>{o(e)}});return()=>{e()}},[t]),n};var dh=l(95197);function db(e,t){return e.x>=t.x&&e.x<=t.x+t.width&&e.y>=t.y&&e.y<=t.y+t.height}function dy(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return"number"==typeof t&&(t={x:t,y:t}),{...e,x:e.x+t.x*l,y:e.y+t.y*l}}class dv{get anchor(){return function(e){let t=360*e/(2*Math.PI);switch(!0){case t>=225&&t<=315:return{h:"middle",v:"end"};case t>=45&&t<=135:return{h:"middle",v:"start"};case t>135&&t<225:return{h:"end",v:"middle"};default:return{h:"start",v:"middle"}}}(this.angle)}get key(){return this.cell.key}get closestCorner(){let e=this.angle,t=this.rect;return{x:e>=1.5*Math.PI||e<=Math.PI/2?t.x:t.x+this.width,y:e<=Math.PI?t.y:t.y+this.height}}get furthestCorner(){let e=this.angle,t=this.rect;return{x:e>=1.5*Math.PI||e<=Math.PI/2?t.x+this.width:t.x,y:e<=Math.PI?t.y+this.height:t.y}}getConnectionPoint(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=this.rect,{x:l,y:a}=this.closestCorner,n=l/Math.cos(this.angle),o=a/Math.sin(this.angle),i=n;return db({x:o*Math.cos(this.angle),y:a},t)?i=o:db({x:l,y:n*Math.sin(this.angle)},t)||console.error("Line does not intersect rect"),{x:(i-e)*Math.cos(this.angle),y:(i-e)*Math.sin(this.angle)}}get rect(){var e,t,l;return{...dy({x:Math.cos(e=this._angle)*(t=this.radius+this.offset),y:Math.sin(e)*t},null!=(l=this.anchorPos)?l:0),width:this.width,height:this.height}}get angle(){return this._angle}set angle(e){this._angle=function(e){let t=e;for(;t<0;)t+=2*Math.PI;return t%(2*Math.PI)}(e)}getOverflowingRadius(){let e=this.boundingRect,t=this.furthestCorner;if(t.ye.x+e.width||t.y>e.y+e.height){let l=Math.min(Math.abs(e.x/Math.cos(this.angle)),Math.abs(e.y/Math.sin(this.angle)));return Math.sqrt(t.x**2+t.y**2)-l}return 0}handleIntersection(e){let t=this.rect,l=e.rect,a=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,a=dy(e,l),n=dy(t,l),o=e=>{let t={x:"width",y:"height"}[e];return n[e]>a[e]?[n[e],Math.max(a[e]+a[t]-n[e],0)]:[a[e],Math.max(n[e]+n[t]-a[e],0)]},[i,r]=o("x"),[s,d]=o("y");return 0!==r&&0!==d&&dy({x:i,y:s,width:r,height:d},-1*l)}(l,t,this.radius);if(!a)return 0;let n=(a.x>l.x?a.width:-1*a.width)*Math.sign(t.x),o=0>Math.sign(t.y)?-((a.y>l.y?l.height-a.height+t.height:a.height)*1):a.y>l.y?a.height:l.height-a.height,i=n/Math.cos(this.angle),r=o/Math.sin(this.angle),s=Math.sign(i)===Math.sign(r)?Math.min(Math.max(i,0),Math.max(r,0)):Math.max(i,r);return this.offset+=s,this.offset}get anchorPos(){var e,t;return e={w:this.width,h:this.height},{x:"start"===(t=this.anchor).h?0:"middle"===t.h?-(e.w/2):-1*e.w,y:"start"===t.v?0:"middle"===t.v?-(e.h/2):-1*e.h}}constructor(e,t,l,a,n,o,i){this.cell=e,this.radius=l,this.label=a,this.width=n,this.height=o,this.boundingRect=i,this.offset=0,this.angle=t}}let dk=e=>{let{showLabels:t,cells:l,radius:a,textStyles:n,chartWidth:o,margin:i=20,...r}=e,s=l.map(e=>e.textValue).join("|");return(0,F.useMemo)(()=>{if(!t)return{labelPad:0,labels:[]};let e={x:-(o/2),y:-(o/2),width:o,height:o},s=(0,dh.rL)({value:e=>e.data,...r})(l),d=0,u=s.map(t=>{var l;let{startAngle:o,endAngle:i}=t,r=t.data,s=r.textValue,{width:u,height:c}=null!==(l=(0,s$.Z7)(s,n))&&void 0!==l?l:{width:0,height:0},m=new dv(r,(o+i)/2-Math.PI/2,a,s,u,c,e),f=m.getOverflowingRadius();return f>d&&(d=f),m}),c=d,m=d,f=0;for(;c>0&&f++<2;){let e=d;d=0,c=0,u.forEach((t,l)=>{t.radius=t.radius-e,0!==l&&(c+=t.handleIntersection(u[l-1])),l===u.length-1&&(c+=t.handleIntersection(u[0]));let a=t.getOverflowingRadius();a>d&&(d=a)}),m+=d,c+=d}let p=i+m;return a-p{let{labels:t,radius:l,textStyles:a,colors:n,isFocused:o,explodeOffset:i,animationDuration:r=.2}=e;return(0,m.jsx)("g",{children:t.map((e,t)=>{let s=e.getConnectionPoint(5),d=o(e.cell.position),u=o(e.cell.position,!0),c="opacity ".concat(r,"s, transform ").concat(r,"s"),f=u?"translate(".concat(Math.cos(e.angle)*i,"px, ").concat(Math.sin(e.angle)*i,"px)"):"";return(0,m.jsxs)("g",{opacity:d?1:.5,style:{transition:c,transform:f},children:[(0,m.jsx)("line",{x1:Math.cos(e.angle)*l,y1:Math.sin(e.angle)*l,x2:s.x,y2:s.y,stroke:a.fill,strokeWidth:u?2:1}),(0,m.jsx)("circle",{cx:s.x,cy:s.y,r:3,fill:n[t],stroke:a.fill}),(0,m.jsx)("text",{dominantBaseline:"hanging",x:e.rect.x,y:e.rect.y+3,...a,fontWeight:u?"bold":"normal",pointerEvents:"none",style:{userSelect:"none"},children:e.label})]},e.key)})})},dx=e=>{var t;let{data:l,TooltipInner:a,colorScheme:n=sP.gb,isThumbnail:o=!1,width:i,height:r,chartType:s,textColor:d,accentColor:u,chartOptions:{donut:c,pie:f},hideLabels:p,showInlineLabels:g,onDataClick:h,onDataDoubleClick:b,animationDuration:y=sP.UG,backgroundColor:v}=e,{dispatch:k}=(0,F.useContext)(s9.uR),{renderTooltip:w,mouseMoveHandler:x,mouseLeaveHandler:S}=s8({TooltipInner:a}),A={top:15,right:15,bottom:15,left:15},C=sE(l),z=sT(l),I=C?C.getCells(l).filter(e=>!e.isEmpty):[];de([z,C]),(0,F.useEffect)(()=>{let e="pie-no-labels";return z||p||k((0,dp.TD)(ef.Ru._({id:"gMgGUM"}),{severity:"warning",id:e,dismissable:!1})),()=>{k((0,dp.sA)(e))}},[z,p,k]),(0,F.useEffect)(()=>{let e="pie-single-row";return 1===I.length&&k((0,dp.TD)(ef.Ru._({id:"uHTxZb"}),{severity:"info",id:e,dismissable:!0})),()=>{k((0,dp.sA)(e))}},[I.length,k]);let j=I.map(e=>{let{position:t}=e;return t.row}),B=(0,sO.M)(u,j,n,{contrastColor:v,minContrast:1.3}),[R,_]=(0,F.useState)(null),M=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return R?R.row===e.row&&R.column==R.column:!t};o&&(A.top=5,A.right=5,A.bottom=5,A.left=5);let E=o||p||!z,[T,O]=i(0,m.jsx)(dA,{cells:I,colors:B,donutThickness:K,duration:y,isDummy:e,isFocused:M,isThumbnail:o,onClick:h,onDoubleClick:b,radius:q,setFocus:_,tooltipEnter:x,tooltipLeave:S}),$=["top","left"].includes(U),Q=["right","left"].includes(U),Y="".concat(Q?"row":"column").concat($?"-reverse":"");return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(eN.s,{height:"100%","data-test":"pie-chart-container",cursor:"default",contentEditable:!1,suppressContentEditableWarning:!0,userSelect:"none",flexDirection:Y,gap:1,justifyContent:$?"flex-end":"flex-start",children:[(0,m.jsx)("svg",{style:{aspectRatio:"1",minHeight:"2em",overflow:"hidden"},viewBox:"0 0 ".concat(T," ").concat(O),children:(0,m.jsx)(sF.A,{top:N/2+A.top,left:L+A.left,children:(0,m.jsxs)(m.Fragment,{children:[J(!0),J(!1),(0,m.jsx)(dw,{labels:V,isFocused:M,radius:q,textStyles:G,colors:[...B.values()],explodeOffset:15})]})})}),!E&&(0,m.jsx)(s0,{width:i,position:U,data:I,getColor:e=>B.get(e.position.row),render:e=>{let{position:{row:t}}=e;return l.getCellOrThrow({row:t,column:z.id}).label},textColor:d,getOpacity:e=>M(e.position)?1:.2,onMouseOver:e=>()=>_(e.position),onMouseLeave:()=>()=>_(null)})]}),w()]})},dS=e=>{let{arc:t,duration:l=.2,path:a,getColor:n,tooltipEnter:o,tooltipLeave:i,onClick:r,onDoubleClick:s,focused:d,setFocused:u,isThumbnail:c,radius:f,isDummy:p,isDonut:g,...h}=e,{startAngle:b,endAngle:y}=t,v=n(t.data),[k,w]=(0,F.useState)(b),[x,S]=(0,F.useState)(b),[A,C]=(0,F.useState)(v),{clickHandler:z,doubleClickHandler:I}=s1();(0,F.useEffect)(()=>{(0,sM.i)(k,[k,y],{duration:l,onUpdate:e=>w(e)})},[y]),(0,F.useEffect)(()=>{(0,sM.i)(x,[x,b],{duration:l,onUpdate:e=>S(e)})},[b]),(0,F.useEffect)(()=>{(0,sM.i)(A,v,{duration:l,onUpdate:e=>C(e)})},[v]);let j=d?c?4:15:0,B=(x+k)/2,R=j>0?"translate(".concat(Math.sin(B)*j,", ").concat(-(Math.cos(B)*j*1),")"):"";return(0,m.jsx)("g",{transform:R,style:{transition:"transform ".concat(l,"s")},children:(0,m.jsx)("path",{d:a({...t,startAngle:x,endAngle:k}),fill:A,stroke:p||g?"transparent":"var(--card-color)",strokeWidth:.02*f,strokeLinecap:"round",strokeLinejoin:"round",onMouseMove:e=>{u(!0),null==o||o(t.data)(e)},onMouseLeave:e=>{u(!1),null==i||i(t.data)(e)},onClick:r?z(r.bind(void 0,t.data)):void 0,onDoubleClick:s?I(s.bind(void 0,t.data)):void 0,...h})})},dA=e=>{let{cells:t,colors:l,donutThickness:a,duration:n,isDummy:o,isFocused:i,isThumbnail:r,onClick:s,onDoubleClick:d,radius:u,setFocus:c,tooltipEnter:f,tooltipLeave:p}=e;return(0,m.jsx)(df.A,{data:t,outerRadius:u,innerRadius:o?0:u-a,pieValue:e=>{let{data:t}=e;return t},pieSort:null,pieSortValues:null,padAngle:o?0:a{let{arcs:t,...g}=e;return t.map(e=>(0,m.jsx)(dS,{arc:e,...g,radius:u,isDonut:a{c(t?e.data.position:null)},getColor:e=>o?"transparent":l.get(e.position.row),tooltipEnter:f,tooltipLeave:p,duration:o?0:n,isThumbnail:r,onClick:s,onDoubleClick:d,isDummy:!!o},e.data.key))}})};var dC=l(87071),dz=l(95994),dI=l(80916),dj=l(57569);let dF=e=>{let{isResizing:t,onResizing:l,setIsResizing:a,cloneBoxProps:n={},showResizeControls:o,disableCloning:i,children:r,...s}=e,d=(0,F.useRef)(null),u=(0,F.useRef)(null),c=(0,F.useRef)(void 0);return(0,F.useEffect)(()=>{if(!i&&(!0===t&&u.current&&c.current&&u.current.appendChild(c.current),!t&&c.current)){var e;null===(e=c.current.parentNode)||void 0===e||e.removeChild(c.current)}},[t]),(0,m.jsxs)(m.Fragment,{children:[t&&!i?(0,m.jsx)(f.az,{filter:"blur(15px)",...n,ref:u,width:"100%",height:"100%",position:"relative","data-test":"resize-placeholder"}):(0,m.jsx)(f.az,{ref:d,width:"100%",height:"100%",filter:t?"blur(4px) opacity(0.75)":void 0,children:r}),o&&(0,m.jsx)(dj.u4,{setIsResizing:e=>{if(!i&&e){var t;c.current=null===(t=d.current)||void 0===t?void 0:t.cloneNode(!0);let e=c.current;e&&(e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.width="auto",e.style.height="auto")}a(e)},onResizing:function(e){for(var t=arguments.length,a=Array(t>1?t-1:0),n=1;n{var t,l;let{state:a,dispatch:n}=(0,F.useContext)(s9.uR),[o,i]=(0,F.useState)(new Date),r=(0,F.useRef)(!1),s=a.feedback;return((0,F.useEffect)(()=>{if(!(null==s?void 0:s.length))return;let e=[],t=s.filter(t=>{let l=t.dismissable;return l instanceof Date&&(!(l<=o)||(e.push(t.id),!1))});e.length&&n((0,dp.sA)(...e)),!r.current&&t.length&&(r.current=setTimeout(()=>{r.current=!1,i(new Date)},1e3))},[s,o,n]),null===(t=a.feedback)||void 0===t?void 0:t.length)?(0,m.jsx)(eX.B,{marginY:2,...e,children:null===(l=a.feedback)||void 0===l?void 0:l.map(e=>(0,m.jsxs)(t2.F,{marginBottom:1,status:e.severity,children:[(0,m.jsx)(t6._,{}),(0,m.jsx)(sd.T,{flexGrow:1,children:e.message}),e.dismissable&&(0,m.jsx)(dR.U,{cursor:"pointer",onClick:()=>{n((0,dp.sA)(e.id))}})]},e.id))}):null};var dM=l(83272),dE=l(83894),dT=l.n(dE);let dO=dT()(async()=>(await Promise.all([l.e(7585),l.e(9835),l.e(5546)]).then(l.bind(l,45546))).DataEditor,{loadableGenerated:{webpack:()=>[45546]},ssr:!1,loading:()=>(0,m.jsx)(eN.s,{m:5,h:"100%",justifyContent:"center",children:(0,m.jsx)(nk.y,{size:"lg"})})}),dP=e=>(0,m.jsx)(dO,{...e}),dN=(0,s9.en)(e=>{let{onChange:t,onClose:l,data:a,isOpen:n,renderChart:o,attributes:i,updateAttributes:r,accentColor:s,selectedCell:d,cardColor:u}=e,c=(0,J.GV)(es.SJ),p=(0,R.Ik)((0,R.fQ)(c));return(0,m.jsxs)(tV._,{placement:"bottom",onClose:l,isOpen:n,trapFocus:!0,isFullHeight:!0,returnFocusOnClose:!1,children:[(0,m.jsx)(tq.m,{}),(0,m.jsxs)(tK.z,{borderTopRadius:"xl",h:"calc(var(--100vh) - 24px)",transitionDuration:{enter:"0.4s"},children:[(0,m.jsx)(tJ.s,{}),(0,m.jsxs)(tQ.c,{p:0,h:"100%",overflow:"auto","data-testid":"chart-editor-body",display:"flex",flexDir:"column",children:[(0,m.jsx)(t$.r,{children:(0,m.jsx)(em.x6,{id:"44wbJb"})}),(0,m.jsxs)(eN.s,{direction:{base:"column",xl:"row-reverse"},overflow:"auto",gap:5,px:5,children:[(0,m.jsxs)(eN.s,{direction:{base:"column",lg:"row",xl:"column"},width:{base:"auto",xl:"40%","2xl":"30%"},gap:5,children:[(0,m.jsx)(f.az,{flexGrow:{base:1,xl:0},flexShrink:0,flexBasis:"auto",borderRadius:"md",overflow:"hidden",children:(0,m.jsx)(f.az,{background:u,borderRadius:"md",padding:8,maxWidth:"100%",h:"xs",children:(0,m.jsx)(f.az,{as:dB.A,position:"relative",children:e=>{let{width:t,height:l}=e;return o({data:a,width:t,height:l,textColor:p})}})})}),(0,m.jsx)(f.az,{background:"gray.50",borderRadius:"md",children:(0,m.jsx)(dM.z,{attributes:i,updateAttributes:r,accentColor:s})})]}),(0,m.jsx)(eZ.c,{display:{base:"block",xl:"none"}}),(0,m.jsxs)(f.az,{flexGrow:1,zIndex:1,overflow:{xl:"auto"},children:[(0,m.jsx)(dP,{onChange:t,data:a||sC.h.createEmpty(2,3),selectedCell:d}),(0,m.jsx)(d_,{})]})]})]})]})]})}),dD=e=>{let t=(0,F.useRef)(!1),[l,a]=(0,F.useState)(!1);(0,F.useEffect)(()=>{if(t.current||null===e)return;let l=!1;e.columns.forEach((t,a)=>{let n=e.getCellAtIndex({row:0,column:a});l=(0,sN.aH)(n,e)||l}),t.current=!0,l&&a(l)},[e])},dL=e=>{let{node:t,editor:l,selected:a,updateAttributes:n,decorations:o}=e,{chartType:i,colorScheme:r,data:s,dimensions:d={ratio:.5},hideLabels:u,showInlineLabels:c,chartAttributes:g={},horizontalAlign:h}=t.attrs,b=(0,F.useMemo)(()=>{try{return s?sw.A.parse(s):null}catch(e){return console.error("[DATALOSS] Error parsing serialized chart",e),console.log(s),null}},[s]),y=(0,J.CU)(),v=(0,J.GV)(es.Cl),k=(0,nN.FX)(),w=(0,J.GV)(es.Ik),x=(0,nN.CJ)(l),S=(0,J.GV)(es.r9),A=v&&x&&w,{theme:C,cardColor:I}=(0,M.a)(o),{ref:j,isResizing:B,setIsResizing:_,resizeableSx:E}=(0,dj.Y3)(l),T=(0,F.useCallback)(e=>{n({dimensions:{width:e.width,height:e.height}})},[n]),[O,P]=(0,F.useState)(sP.UG);dD(b),(0,F.useEffect)(()=>{B?P(0):setTimeout(()=>{P(sP.UG)},1e3*sP.UG)},[B]);let N=l.isThumbnail||!1,[D,L]=(0,F.useState)(),W=!N&&S===t.attrs.id,U=e=>{if(e){y.dispatch((0,es.Jr)({chartId:t.attrs.id}));return}y.dispatch((0,es.Jr)({chartId:null}))},G=(0,F.useMemo)(()=>{switch(i){case"pie":case"donut":return dx;case"line":return dd;default:return da}},[i]),H=(0,R.Ik)((0,R.VH)(C)),V=e=>{v&&w&&(L(e),U(!0))};(0,F.useEffect)(()=>{D&&(null==b?void 0:b.getCell(D.position))!==D&&L(void 0)},[D,W]);let q=e=>{var t;let{data:l,width:a,height:n,textColor:o="var(--body-color)",showEditInPlaceholder:d=!1}=e,p=l&&(null===(t=dr.K.nonEmpty(l))||void 0===t?void 0:t.data);return!p||!sE(p)||p.isEmpty()?(0,m.jsx)(dG,{setEditing:d?U:void 0}):(0,m.jsx)(G,{animationDuration:O,data:p,colorScheme:r||void 0,width:a,height:n,accentColor:H,textColor:o,chartOptions:g,onDataDoubleClick:V,hideLabels:u,showInlineLabels:c,backgroundColor:I,TooltipInner:e=>(0,m.jsx)(m.Fragment,{children:s.columns.map(t=>{var l;return(0,m.jsxs)(f.az,{as:"p",mb:1,children:[t.label&&(0,m.jsxs)(z.E,{as:"b",children:[t.label,": "]}),(0,m.jsx)(z.E,{as:"span",children:null===(l=p.getCell({row:e.position.row,column:t.id}))||void 0===l?void 0:l.textValue},t.id)]},t.id)})}),chartType:i,isThumbnail:N})},K=dW(d),$="width"in d?d.width:dz.St;k&&($=Math.min($,dz.St/2));let Q=$*K,Y=(0,n9.yp)(h);return(0,eB.l)()?(0,m.jsx)(p.u,{as:"div",...e,children:(0,m.jsx)(eN.s,{w:"100%",dir:(0,n9.fZ)(o,h),className:dC.S,sx:E,css:Y,direction:"column",onDoubleClick:()=>{A&&U(!0)},_focusWithin:{shadow:"outline"},children:(0,m.jsxs)(f.az,{ref:j,className:"chart",borderRadius:"var(--box-border-radius)","data-content-reference":!0,"data-selection-ring":!0,"data-selection-background":!0,maxW:"100%",minW:"min(10em, 100%)",minH:"min(10em, 100%)",width:!function(e){return"width"in e&&"height"in e}(d)?"calc(100% * var(--media-scale))":dU(d.width),aspectRatio:"1/".concat(K),position:"relative","data-drag-handle":!0,"data-scale-preview":!0,children:[(0,m.jsx)(dF,{showResizeControls:A&&a,imageWrapperRef:j,isResizing:B,setIsResizing:_,updateResizeAttrs:T,refreshDeps:[t.attrs],disableCloning:!0,keepRatio:!1,children:b?q({data:b,width:$,height:Q,showEditInPlaceholder:!N&&v}):(0,m.jsx)(dG,{setEditing:N||!v?void 0:U})}),(0,m.jsx)(dN,{renderChart:q,cardColor:I,data:b,isOpen:W,onClose:()=>U(!1),onChange:e=>{n({data:sw.A.serialize(e)})},attributes:t.attrs,updateAttributes:n,accentColor:H,selectedCell:D})]})})}):(0,m.jsx)(f.az,{w:$,h:Q})},dW=e=>"ratio"in e?e.ratio:e.height/e.width,dU=e=>"calc(".concat(e," * var(--font-size) / 16)"),dG=e=>{let{setEditing:t}=e,l=(0,o6.rd)();return(0,m.jsxs)(eC.T,{spacing:3,justify:"center",contentEditable:!1,color:l?dI.N.DARK_COLOR:dI.N.LIGHT_COLOR,h:"100%",backgroundColor:l?dI.N.DARK_BG:dI.N.LIGHT_BG,borderRadius:"var(--box-border-radius)","data-testid":"chart-placeholder",children:[(0,m.jsx)(j.g,{size:"2x",icon:lh.s67}),t&&(0,m.jsx)(eu.$,{size:"xs",fontFamily:"body",onClick:()=>t(!0),children:(0,m.jsx)(em.x6,{id:"UHoZ5e"})})]})};var dH=l(98757);let dV=()=>(0,al.Ak)(5),dq=new V.hs("UniqueMediaId"),dK=an.S.extend({name:"UniqueChartId"}).configure({attributeName:"id",types:["chart"],initialValue:dV,filterTransaction:aa.kz,pluginKey:dq}),dJ=r.bP.create({name:"chart",group:"cardBlock layoutBlock",selectable:!0,draggable:!0,addNodeView:()=>(0,u.gu)(dL,{update:c.z0}),addAttributes:()=>({id:(0,sj.e)(()=>(0,al.Ak)(5)),chartType:{default:"bar"},chartAttributes:{...(0,Y.tb)("chartAttributes"),default:{}},colorScheme:{isRequired:!1},dimensions:{...(0,Y.tb)("dimensions"),default:{ratio:.56}},hideLabels:{isRequired:!1,default:!1},showInlineLabels:{isRequired:!1,default:!1},data:{...(0,Y.tb)("data")}}),addCommands:()=>({insertChart:(e,t)=>l=>{let{dispatch:a,editor:n,commands:o}=l;if(!a)return!1;let{schema:i}=n,r=i.nodes.chart,s=dV(),d=r.createChecked({id:s,chartType:e,data:t&&e?(0,dH.$)(e):void 0});return o.insertContent(d.toJSON())},editSelectedChart:()=>e=>{let{state:t}=e,l=t.selection;if(!(l instanceof V.nh)||!d$(l.node))return!1;let a=l.node;return(0,J.KA)().dispatch((0,es.Jr)({chartId:a.attrs.id})),!0}}),addExtensions:()=>[dK],parseHTML(){return[{tag:'div[data-type="'.concat(this.name,'"]')},{tag:"chart",getAttrs(e){try{if("string"==typeof e)return!1;let t=[...e.children].find(e=>"TABLE"===e.nodeName);if(!t)return null;let l=sI.parse(t);if(!l)return{};return{data:sw.A.serialize(l)}}catch(e){return console.error("[caught]",e),!1}}}]},renderHTMLforAI(e){let{node:t,HTMLAttributes:l}=e,{"data-data":a,...n}=l,o=["chart",(0,r.KV)(this.options.HTMLAttributes,n)];return t.attrs.data&&o.push(sI.serialize(sw.A.parse(t.attrs.data))),o},renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,r.KV)({"data-type":this.name},this.options.HTMLAttributes,t)]}}),d$=e=>"chart"===e.type.name;var dQ=l(40200),dY=l.n(dQ),dX=l(3968),dZ=l(65202),d0=l(1279),d1=l(95204);let d2=r.YY.create({name:"clipboard",addProseMirrorPlugins(){let e=this.editor,t=e.state.schema,l=null;return[new V.k_({key:new V.hs("clipboard"),appendTransaction(e,t,l){let a=e.find(e=>"cut"===e.getMeta("uiEvent"));if(!a)return null;let n=(0,iU.i)(a);return n?l.tr.setSelection(n):null},props:{handleDOMEvents:{drop(e){l=e.dragging,requestAnimationFrame(()=>{l=null})}},clipboardSerializer:{serializeFragment:e=>(0,aY.t8)(e,this.editor.schema)},transformPastedHTML:dX.V,transformPasted:a=>d4(e,(null==l?void 0:l.slice)?a:(0,d1.o$)(a,t)),handlePaste:(t,l,a)=>(0,aQ.Mu)(e,l,a)||aX(e,l)||(0,d0.j)(t,l,a)}})]},addCommands(){return{insertMarkdownAt:(e,t)=>l=>{let{state:a,tr:n}=l;try{let l=aZ(t,a.schema);return n.replaceRange(e.from,e.to,l),!0}catch(e){return console.warn("(caught) [Clipboard] insertMarkdownAt error",e),!1}},basicCut:e=>{let{from:t,to:l}=e;return e=>{let{state:a,tr:n}=e;return d6(a.doc.slice(t,l).content,this.editor,!0),n.deleteRange(t,l),!0}},copy:e=>{let{from:t,to:l}=e;return e=>{let{state:a}=e;return d6(a.doc.slice(t,l).content,this.editor,!1),!0}}}}}),d6=(e,t,l)=>{var a;let n=(0,aY.$R)(e,t.schema);null===(a=document.getSelection())||void 0===a||a.removeAllRanges(),dY()(n,{format:"text/html"});let o=dZ.q.getState(t.state);return o&&!l&&o.clearCutData(),n},d4=(e,t)=>{var l;let a=(0,en.e)(e.state.doc),n=null===(l=t.toJSON())||void 0===l?void 0:l.content;if(!n||"document"!==n[0].type)return t;let o=(0,en.e)(t.content.firstChild);return a.cardLayoutsEnabled&&!o.cardLayoutsEnabled?((0,Y.Sn)(n,e=>{"card"===e.type&&(e.content=[{type:"cardLayoutItem",content:e.content}])}),l0.Ji.fromJSON(e.schema,{openStart:t.openStart+1,openEnd:t.openEnd+1,content:n})):t};var d5=l(44386);let d3=l(55642).Ay.extend({priority:Z.y.Code,inclusive:!1});var d8=l(31595),d7=l(14979),d9=l(78354);let ue=e=>{let[t,l]=(0,F.useState)(new Date),a=(0,F.useRef)(!1);return(0,F.useEffect)(()=>{a.current&&l(new Date),a.current=!0;let e=setInterval(()=>{l(new Date)},6e4);return()=>{clearInterval(e)}},[e]),t},ut=e=>{var t;let l=(0,d9.h5)({base:4,md:8})||8,{node:a,decorations:n}=e,{showTime:i,hiddenContributorIds:r}=a.attrs,s=(0,J.GV)(es.zB),d=(0,F.useMemo)(()=>(s||[]).filter(e=>!r.includes(e.user.id)),[s,r]),u=(0,o9.En)(),c=(0,J.GV)(es.Jo),f=null==c?void 0:c.editedTime,g=ue(f).toISOString(),h=d.length-l,b=(0,n9.fZ)(n),y=null!==(t=e.node.attrs.horizontalAlign)&&void 0!==t?t:"rtl"===b?"right":"left",v=(0,F.useMemo)(()=>({left:"rtl"===b?"row-reverse":"row",center:"column",right:"rtl"===b?"row":"row-reverse"})[y],[b,y]);return(0,m.jsx)(m.Fragment,{children:d.length>0&&(0,m.jsx)(p.u,{...e,as:"div",children:(0,m.jsxs)(eN.s,{dir:b,userSelect:"none",contentEditable:!1,justify:"flex-start",align:"center",direction:v,borderRadius:"var(--box-border-radius)","data-selection-ring":"padded","data-selection-background":!0,children:[(0,m.jsxs)(d8.Z,{sx:{".avatar-overflow-activator":{height:"1.6em",width:"1.6em",minH:"1.6em",minW:"1.6em",fontSize:"inherit",span:{fontSize:"0.68em"}}},children:[d.slice(0,l).map(e=>(0,m.jsx)(eI.Vc,{width:"1.6em",height:"1.6em",fontSize:"inherit",size:"sm",shadow:"base",sx:{"@media print":{shadow:"none"}},borderWidth:"1px",name:e.user.displayName,label:u?ef.Ru._({id:"bxVoEp",values:{0:e.user.displayName,1:(0,d7.Gx)(e.lastEdited,g)}}):" ",src:e.user.profileImageUrl},e.user.id)),h>0&&(0,m.jsx)(eI.oQ,{tooltipLabel:ef.Ru._({id:"25VyZX"}),count:h,avatars:d.map(e=>({name:e.user.displayName||"",id:e.user.id,profileImageUrl:e.user.profileImageUrl||"",color:"white"})),disabled:!0})]}),(0,m.jsxs)(eN.s,{direction:"column",marginInline:"0.5em",lineHeight:"1.4",textAlign:y,children:[(0,m.jsx)(z.E,{className:"contributors-list",children:1===d.length?(0,m.jsx)(em.x6,{id:"t490IT",values:{0:d[0].user.displayName}}):(0,m.jsx)(em.x6,{id:"KNjuGh",values:{0:d.length}})}),!o.$.GAMMA_PUPPETEER_SERVICE&&f&&i&&(0,m.jsx)(z.E,{fontSize:"0.75em",children:u?(0,m.jsx)(em.x6,{id:"gUWkFH",values:{0:(0,d7.Gx)(f,g)}}):" "})]})]})})})},ul=e=>{var t;let l=null!==(t=e.node.attrs.horizontalAlign)&&void 0!==t?t:"left",a=(0,F.useMemo)(()=>({left:"row",center:"column",right:"row-reverse"})[l],[l]);return(0,m.jsx)(sc.V,{children:(0,m.jsxs)(eN.s,{direction:a,alignItems:"center",gap:"1em",children:[(0,m.jsx)(su,{borderRadius:"full",boxSize:"4em"}),(0,m.jsx)(su,{h:"2em",w:"14em"})]})})},ua=r.bP.create({name:"contributors",group:"block",atom:!0,selectable:!0,dynamic:!0,addAttributes:()=>({showTime:{default:!0},hiddenContributorIds:{default:[],...(0,Y.tb)("hiddenContributorIds")}}),addCommands:()=>({toggleShowTime:()=>e=>{let{commands:t,state:l}=e,{selection:a}=l;if(!(a instanceof V.nh))return!1;let{node:n}=a;return"contributors"===n.type.name&&(t.updateAttributes("contributors",{showTime:!n.attrs.showTime}),!0)},toggleOneContributorVisibility:e=>t=>{let{commands:l,state:a}=t,n=(0,J.KA)().getState(),o=(0,es.zB)(n);if(!o||1===o.length)return!1;let{selection:i}=a;if(!(i instanceof V.nh))return!1;let{hiddenContributorIds:r}=i.node.attrs,s=[];if(r.includes(e))s=r.filter(t=>t!==e);else{if(r.length+1===o.length)return!1;s=[...r,e]}return l.updateAttributes("contributors",{hiddenContributorIds:s}),!0},toggleAllContributorsVisibility:()=>e=>{let{commands:t,state:l}=e,a=(0,J.KA)().getState(),n=(0,es.zB)(a);if(!n||1===n.length)return!1;let{selection:o}=l;if(!(o instanceof V.nh))return!1;let{hiddenContributorIds:i}=o.node.attrs,r=[];if(i.length>0)r=[];else{let e=(0,es.JV)(a);r=n.filter(t=>t.user.id!==(null==e?void 0:e.id)).map(e=>e.user.id)}return t.updateAttributes("contributors",{hiddenContributorIds:r}),!0}}),parseHTML:()=>[{tag:"div[class=contributors]"}],renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,r.KV)(t,{class:"contributors"})]},addNodeView(){return this.editor.isThumbnail?(0,u.gu)(ul,{update:c.z0}):(0,u.gu)(ut,{update:c.z0})}});var un=l(47813);let uo="125em",ui=e=>{let{svg:t,theme:l}=e;if(!t)return null;let a=(0,un.k)(l);return(0,m.jsx)(f.az,{dangerouslySetInnerHTML:{__html:t},"data-testid":"diagram-svg",sx:{svg:{width:"100%",height:"auto",maxH:uo,...a}}})};var ur=l(25472),us=l(27664),ud=l(34252),uu=l(24051);let uc=dT()(async()=>(await Promise.all([l.e(8683),l.e(3852),l.e(4571),l.e(1866)]).then(l.bind(l,61866))).Tldraw,{loadableGenerated:{webpack:()=>[61866]},ssr:!1}),um=e=>{let{theme:t=uu.z}=e,l=(0,tp.ZI)(t),a=(0,un.k)(t),n=(0,ud.M)(t),o={fill:n.shapeFill,strokeWidth:n.shapeBorder};return(0,m.jsx)(eN.s,{sx:{...l,"--tl-font-draw":"var(--body-font)",fontFamily:"var(--body-font)",fontWeight:"var(--body-font-weight)",...a,"--tl-text-outline":"transparent","--color-background":"var(--card-color)"},position:"relative",h:"100%",w:"100%",className:"highlight-mask",children:(0,m.jsx)(uc,{...e,defaultStyles:o})})},uf=async e=>{let t=Array.from(e.getCurrentPageShapeIds()),l=await e.getSvg(t,{padding:8,scale:1});if(l)return console.debug("generated svg",l),l},up=(e,t,l)=>{e&&t&&(Array.from(e.getCurrentPageShapeIds()).length>0?e.updateShapes(t):e.createShapes(t),l&&e.updateAssets(l))},ug=(e,t)=>{e.user.updateUserPreferences({isDarkMode:(0,R.Mw)(t)}),setTimeout(()=>{e.zoomToFit()})},uh=e=>{let{isOpen:t,isEditable:l,onClose:a,isDrawingEditorActive:n,setDrawingEditorActive:o,editor:i,...r}=e,{node:s,updateAttributes:d}=r,{assets:u,shapes:c}=s.attrs,f=(0,J.GV)(es.SJ),[p,g]=(0,F.useState)();(0,F.useEffect)(()=>{p&&up(p,c,u)},[c,u,p,d]);let h=(0,F.useCallback)(e=>{g(e),window.tldrawEditor=e,ug(e,f)},[f]),b=(0,F.useCallback)(async()=>{if(!p)return;let e=await uf(p);e?d({svg:e.outerHTML}):d({svg:null})},[p,d]),y=(0,F.useCallback)(()=>{p&&d({shapes:p.getCurrentPageShapes(),assets:p.getAssets(),version:2})},[d,p]),v=(0,o9.lW)(y,500),k=(0,F.useCallback)(()=>{l&&b(),o(!1),a()},[a,b,o,l]);return(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(eI._s,{placement:"bottom",onClose:k,isOpen:t,trapFocus:!0,isFullHeight:!0,returnFocusOnClose:!1,children:[(0,m.jsx)(eI.QP,{}),(0,m.jsxs)(eI.zj,{dir:"ltr",borderTopRadius:"xl",h:"calc(var(--100vh) - 24px)",onAnimationComplete:e=>{"enter"==e&&o(!0)},transition:{enter:{duration:.4}},overflow:"hidden",children:[(0,m.jsx)(eI.ys,{p:0,h:"100%",overflow:"hidden","data-testid":"drawing-editor-body",children:n?(0,m.jsx)(um,{onMount:h,onChange:l?v:void 0,orgId:i.gammaOrgId,theme:f}):(0,m.jsx)(eN.s,{align:"center",justify:"center",w:"100%",h:"100%",children:(0,m.jsx)(nk.y,{size:"xl"})})}),(0,m.jsx)(eI.s1,{zIndex:400,backgroundColor:"white","data-testid":"drawing-editor-close"})]})]})})},ub=e=>{let{node:t,updateAttributes:l,selected:a,editor:n,getPos:o,decorations:i}=e,{width:r,meta:s,id:d,horizontalAlign:u,svg:c,shapes:g}=t.attrs,h=(0,J.GV)(es.Cl),b=(0,J.GV)(es.Ik),y=(0,nN.CJ)(n),v=h&&y&&b,k=(0,J.GV)(es.Xu),w=!!k&&k===d,[x,S]=(0,F.useState)(!1),A=(0,J.GV)(es.SJ),C=(0,o6.rd)(),{ref:z,setIsResizing:I,resizeableSx:B}=(0,dj.Y3)(n),R=(0,F.useCallback)(()=>{(0,us.CD)(d,!0)},[d]),_=(0,F.useCallback)(()=>{n.chain().setNodeSelection(o()).focus().run()},[n,o]),M=(0,F.useCallback)(()=>{(0,us.CD)(null,!1)},[]),E=(0,F.useCallback)((e,a)=>{l({...t.attrs,fullWidthBlock:void 0===a?t.attrs.fullWidthBlock:a,...e})},[t.attrs,l]),T=r||(null==s?void 0:s.width),O=!c,P=g&&g.length>0,{isFullWidth:N}=(0,ur.D)(i),D=(0,n9.yp)(N?"center":u);return(0,m.jsx)(p.u,{...e,as:"div",children:(0,m.jsxs)(eN.s,{dir:(0,n9.fZ)(i,u),w:"100%",className:dC.S,css:D,sx:B,direction:"column",_focusWithin:{shadow:"outline"},children:[(0,m.jsxs)(f.az,{ref:z,className:"diagram",borderRadius:"var(--box-border-radius)","data-content-reference":!0,"data-selection-ring":!0,"data-selection-background":!0,w:N?"calc(100% * var(--media-scale))":T?"calc(".concat(T," * var(--font-size) / 16)"):"100%",maxW:"100%",h:"auto",maxH:uo,position:"relative",minH:O?"6em":"auto","data-drag-handle":!0,children:[v&&a&&!N&&(0,m.jsx)(dj.u4,{imageWrapperRef:z,setIsResizing:I,updateResizeAttrs:E,refreshDeps:[t.attrs]}),(0,m.jsx)(ui,{svg:c,theme:A}),v&&!w&&!O&&(0,m.jsx)(f.az,{cursor:"default",position:"absolute",inset:"0",zIndex:"1",onClick:_,onDoubleClick:R}),O&&(0,m.jsxs)(eC.T,{spacing:3,justify:"center",contentEditable:!1,color:C?dI.N.DARK_COLOR:dI.N.LIGHT_COLOR,h:"7em",backgroundColor:C?dI.N.DARK_BG:dI.N.LIGHT_BG,borderRadius:"var(--box-border-radius)","data-testid":"drawing-placeholder",onDoubleClick:h?R:void 0,children:[(0,m.jsx)(j.g,{size:"2x",icon:lh.qTS}),h&&(0,m.jsx)(eu.$,{size:"xs",onClick:R,fontFamily:"Inter, sans-serif",children:P?(0,m.jsx)(em.x6,{id:"3IPx8n"}):(0,m.jsx)(em.x6,{id:"trQ3Gx"})})]})]}),w&&(0,m.jsx)(uh,{...e,isOpen:w,isEditable:h,onClose:M,isDrawingEditorActive:x,setDrawingEditorActive:S})]})})},uy=r.bP.create({name:"diagram",group:"block",atom:!0,selectable:!0,draggable:!0,addAttributes:()=>({id:(0,sj.e)(uk),shapes:{...(0,Y.tb)("shapes")},assets:{...(0,Y.tb)("assets"),default:{}},meta:{...(0,Y.tb)("meta"),default:{}},width:{},svg:{}}),parseHTML(){return[{tag:"div[class=diagram]"},{tag:"diagram[bookmark]",getAttrs:(0,X.Ll)(this.storage)}]},addStorage:X.xu,renderHTMLforAI(e){let{node:t}=e;return["diagram",{bookmark:(0,X.vL)(this.storage,t)}]},renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,r.KV)(t,{class:"diagram"})]},addCommands(){let e=this.name,t=t=>{let{selection:l}=t;return l instanceof V.nh&&l.node.type.name===e?l.node:void 0};return{editSelectedDiagramBlock:()=>e=>{let{state:l}=e,a=t(l);return a&&(0,J.KA)().dispatch((0,es.v5)({drawingId:a.attrs.id})),!0}}},addExtensions:()=>[uw],addNodeView:()=>(0,u.gu)(ub,{update:c.z0})}),uv=new V.hs("UniqueMediaId"),uk=()=>(0,al.Ak)(5),uw=an.S.extend({name:"UniqueDiagramId"}).configure({attributeName:"id",types:["diagram"],initialValue:uk,filterTransaction:aa.kz,pluginKey:uv});var ux=l(98380);let uS=()=>(0,m.jsx)(u.VR,{as:"div",children:(0,m.jsx)(f.az,{contentEditable:!1,borderRadius:"var(--box-border-radius)","data-selection-ring":"padded","data-selection-background":!0,"data-drag-handle":!0,py:"0.25em",position:"relative",transform:"translateY(0.25em)",children:(0,m.jsx)(eZ.c,{backgroundColor:"var(--body-color-muted)",height:"0.125em",opacity:1})})}),uA=/^(---|___|—-)/,uC=r.bP.create({name:"divider",group:"block cardNotesBlock",atom:!0,selectable:!0,draggable:!0,parseHTML:()=>[{tag:'hr[class="divider"]'}],renderHTML(e){let{HTMLAttributes:t}=e;return["hr",(0,r.KV)(t,{class:"divider"})]},addNodeView:()=>(0,u.gu)(uS),addInputRules(){return[(0,ux.wN)({find:uA,type:this.type})]}});var uz=l(63373),uI=l(12567),uj=l(38452);let uF=e=>{let{files:t}=e;return(0,m.jsx)(m.Fragment,{children:t.map(e=>(0,m.jsx)("link",{rel:"preload",href:e,as:"font",crossOrigin:""},e))})},uB=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return"@font-face {\n font-family: 'Eudoxus Sans';\n src: url('".concat(e,"/fonts/EudoxusSans-Bold.woff2') format('woff2'),\n url('").concat(e,"/fonts/EudoxusSans-Bold.woff') format('woff');\n font-weight: bold;\n font-style: normal;\n font-display: block;\n}\n@font-face {\n font-family: 'Eudoxus Sans';\n src: url('").concat(e,"/fonts/EudoxusSans-Regular.woff2') format('woff2'),\n url('").concat(e,"/fonts/EudoxusSans-Regular.woff') format('woff');\n font-weight: normal;\n font-style: normal;\n font-display: block;\n}\n@font-face {\n font-family: 'Eudoxus Sans';\n src: url('").concat(e,"/fonts/EudoxusSans-Light.woff2') format('woff2'),\n url('").concat(e,"/fonts/EudoxusSans-Light.woff') format('woff');\n font-weight: 300;\n font-style: normal;\n font-display: block;\n}\n@font-face {\n font-family: 'Eudoxus Sans';\n src: url('").concat(e,"/fonts/EudoxusSans-ExtraBold.woff2') format('woff2'),\n url('").concat(e,"/fonts/EudoxusSans-ExtraBold.woff') format('woff');\n font-weight: 800;\n font-style: normal;\n font-display: block;\n}\n@font-face {\n font-family: 'Eudoxus Sans';\n src: url('").concat(e,"/fonts/EudoxusSans-ExtraLight.woff2') format('woff2'),\n url('").concat(e,"/fonts/EudoxusSans-ExtraLight.woff') format('woff');\n font-weight: 200;\n font-style: normal;\n font-display: block;\n}\n@font-face {\n font-family: 'Eudoxus Sans';\n src: url('").concat(e,"/fonts/EudoxusSans-Medium.woff2') format('woff2'),\n url('").concat(e,"/fonts/EudoxusSans-Medium.woff') format('woff');\n font-weight: 500;\n font-style: normal;\n font-display: block;\n}\n")},uR=["/fonts/EudoxusSans-Bold.woff","/fonts/EudoxusSans-Bold.woff2","/fonts/EudoxusSans-Regular.woff","/fonts/EudoxusSans-Regular.woff2","/fonts/EudoxusSans-Light.woff","/fonts/EudoxusSans-Light.woff2","/fonts/EudoxusSans-ExtraBold.woff","/fonts/EudoxusSans-ExtraBold.woff2","/fonts/EudoxusSans-ExtraLight.woff","/fonts/EudoxusSans-ExtraLight.woff2","/fonts/EudoxusSans-Medium.woff","/fonts/EudoxusSans-Medium.woff2"],u_=uR.map(e=>"".concat(o.$.FRONTEND_URL).concat(e)),uM=e=>{let{shouldUsePublishedVersion:t}=e,l=uB(t?o.$.FRONTEND_URL:"");return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(nC.mL,{styles:l}),(0,m.jsx)(uF,{files:t?u_:uR})]})},uE=e=>{let{fonts:t}=e,l=(0,sf.oR)(),a=null==t?void 0:t.find(e=>"Eudoxus Sans"===e.id),n=(0,F.useMemo)(()=>ra()((null==t?void 0:t.filter(e=>e.url))||[],"url"),[t]);return(0,m.jsxs)(m.Fragment,{children:[a?(0,m.jsx)(uM,{shouldUsePublishedVersion:l}):null,n.map(e=>(0,m.jsx)(eY.N,{as:"link",href:e.url,rel:"stylesheet","data-gamma-font":e.id},e.url))]})},uT=e=>{let{theme:t}=e;return(0,m.jsx)(uE,{fonts:null==t?void 0:t.fonts})};var uO=l(19937),uP=l(33919),uN=l(80215);let uD=(0,F.memo)(e=>{let{theme:t}=e,l=(0,tp.ZI)(t),a=(0,R.fQ)(t),n=(0,R.VH)(t);return(0,m.jsx)(f.az,{as:"svg",width:"0",height:"0",sx:l,children:(0,m.jsxs)("defs",{children:[(0,m.jsx)(uL,{theme:t}),(0,m.jsx)(uW,{theme:t}),(0,m.jsx)(uG,{color:(0,R.Ik)(n),id:"theme-accent-color-fill"}),(0,m.jsx)(uG,{color:(0,R.Ik)(a),id:"theme-body-color-fill"}),(0,m.jsx)(uH,{theme:t})]})})});uD.displayName="ThemeSVGDefs";let uL=(0,F.memo)(e=>{let{theme:t}=e,l=(0,R.VH)(t);return"linear-gradient"!==l.type?null:(0,m.jsx)(uU,{gradient:l,id:"theme-accent-gradient-linear"})});uL.displayName="ThemeAccentGradientLinearDef";let uW=(0,F.memo)(e=>{let{theme:t}=e,l=(0,R.VH)(t),a=(0,ud.M)(t);if("linear-gradient"!==l.type)return null;let n=(0,R.Mw)(t),o=(0,R.Oq)(t),i="semi"===a.shapeFill?(0,uP.nz)(l,o,.5):l,r=(0,uP.Hh)(i,n?.25:.9);return r?(0,m.jsx)(uU,{gradient:r,id:"theme-accent-background-gradient-linear"}):null});uW.displayName="ThemeAccentBackgroundGradientLinearDef";let uU=(0,F.memo)(e=>{let{gradient:t,id:l}=e,a=t.angle*Math.PI/180,n=50+50*Math.cos(a+Math.PI),o=50+50*Math.sin(a+Math.PI),i=50+50*Math.cos(a),r=50+50*Math.sin(a);return(0,m.jsx)("linearGradient",{id:l,x1:"".concat(n,"%"),y1:"".concat(o,"%"),x2:"".concat(i,"%"),y2:"".concat(r,"%"),children:t.stops.map((e,t)=>{let{color:l,position:a}=e;return(0,m.jsx)("stop",{offset:"".concat(a,"%"),stopColor:l},t)})})});uU.displayName="LinearGradientDef";let uG=(0,F.memo)(e=>{let{color:t,id:l}=e;return t?(0,m.jsxs)("filter",{id:l,children:[(0,m.jsx)("feFlood",{floodColor:t,result:"flood"}),(0,m.jsx)("feComposite",{in:"flood",in2:"SourceAlpha",operator:"in"})]}):null});uG.displayName="ColorFillDef";let uH=(0,F.memo)(e=>{let{theme:t}=e,l=(0,ud.M)(t);return(0,m.jsx)(m.Fragment,{children:"soft3d"===l.shapeShadow&&(0,m.jsx)(uN.Y,{theme:t,id:"theme-shape-shadow"})})});uH.displayName="ThemesV3SVGDefs";let uV=()=>(0,nN.FX)()?1:1.125;var uq=l(90397);let uK=e=>{if(e.state.selection instanceof V.nh&&(0,uq.J)(e.state.selection.node)){e.chain().focus(e.state.selection.from).blur().run();return}return e.commands.blur()};var uJ=l(87825);let u$=e=>(0,J.GV)(t=>{if((0,es.wC)(t)!==ok.w.SLIDE_VIEW)return null;let l=(0,es.FI)(t);if(!l||!(null==l?void 0:l.cardId))return null;let[a]=(0,r.xe)(e.state.doc,e=>(0,$.jg)(e)&&e.attrs.id===l.cardId);if(!a)return console.warn("[usePresentingCardBackground] Unexpectedly couldnt find presentingCard ".concat(l.cardId)),null;let n=(0,Y.TK)(e.state.doc.resolve(a.pos+1),e=>(0,$.jg)(e)&&e.attrs.background&&!e.attrs.background.inside).pop();return n?n.node.attrs.background:(console.warn("[usePresentingCardBackground] Unexpectedly couldnt find card at pos ".concat(a.pos)),null)},iD());var uQ=l(39907);let uY=(0,sZ.P)(f.az),uX=(e,t)=>{let l=!!(e&&t),a=!!(e&&!t),n=!!(!e&&t),o=(0,F.useRef)(l);return(0,F.useEffect)(()=>{o.current=l},[l,!!(!e&&!t)]),[a||n?o.current:l,l]},uZ=e=>{let{editor:t,node:l,updateAttributes:a}=e,n=(0,oV.d4)(es.wC),o=(0,J.GV)(es.nD),i=(0,oV.d4)(es.cS),r=(0,oV.d4)(es.$i),s=(0,J.GV)(es.SJ),d=n===ok.w.SLIDE_VIEW,c=u$(t),{background:p}=l.attrs,g=(0,nN.FX)(),h=uV(),[b,y]=uX(d,r);(0,F.useEffect)(()=>{!l.attrs.docId&&t.gammaDocId&&a({...l.attrs,docId:t.gammaDocId})},[l.attrs,t,a]);let v=(0,uO.S)(s,o),k=(0,R.Mw)(s),w=(0,tb.fS)(s,p),x=(0,tb.FD)(w,k,t.isThumbnail?ty.p7:void 0),S=(0,tb.FD)(d&&c&&c.type!==e5.h.NONE?c:w,k,t.isThumbnail?ty.p7:void 0);console.debug("%c[DocComponent] Doc is rerendering","background-color: chartreuse",{isPresentModeReady:y,isPresentModeReadyLagging:b,presentingCardId:r});let A=oT(),C={width:"100%",'[data-animate-value="doc"]':{display:b?"none":void 0},...A.src&&d?{"--logo-push-x":"".concat(A.width+2*A.paddingX,"px"),"--logo-push-y":"".concat(A.height+2*A.paddingY,"px")}:void 0},z=(0,F.useCallback)(e=>{let l=e.target;return(!l.closest(".".concat(er.p$))||!!l.getAttribute("data-outside-card-body"))&&(uK(t),!0)},[t]);(0,F.useEffect)(()=>uj.WC.on("keydown","DOC_BLUR",e=>!!(0,uI.Ay)("Esc")(e)&&!!t.isFocused&&(t.commands.blur(),e.preventDefault(),!0)),[t]);let j=(0,nN.UT)("comment");return(0,m.jsxs)(u.VR,{as:"div","data-testid":"doc-node-root",style:{height:"100%"},children:[(0,m.jsx)(uT,{theme:s}),(0,m.jsx)(uD,{theme:s}),(0,m.jsx)(f.az,{onMouseDown:z,h:"100%",children:(0,m.jsxs)(eN.s,{className:"doc-content-wrapper",direction:"column",align:"center",pos:"relative",pb:g||d||!j?"0px":i?uJ.b:uJ.C,sx:v,onDragOver:e3.JO,minH:uQ.env.STORYBOOK?"auto":"calc(var(--100vh) - var(--editor-padding-top, 0px))",children:[(0,m.jsx)(u0,{...x}),!g&&!d&&(0,m.jsx)(eN.s,{alignSelf:"start",pos:"absolute",inset:"0",h:"100%",children:(0,m.jsx)(oj,{})}),(0,m.jsx)(uz.N,{children:(0,m.jsx)(uY,{className:"motion-present-mode-bg","data-doc-background-element-present-mode":!0,"data-export-master":!0,position:"fixed",zIndex:eO.presentBg,top:0,left:0,right:0,h:"100%",initial:{opacity:0},animate:{opacity:1},exit:{opacity:1},visibility:y?"visible":"hidden",transition:er.Dt,css:nI.D1?void 0:{scrollbarGutter:"stable",overflow:"scroll"},...S},"presenting-background-"+r)}),(0,m.jsx)(eN.s,{sx:C,justify:"center",className:(0,I.cx)("document-content",d?"is-present-mode":"is-doc-mode"),css:{"--viewport-scale-factor":"".concat(h)},pt:"var(--doc-padding-top)",children:(0,m.jsx)(u.$p,{style:{width:"100%"}})}),g&&(0,m.jsx)(oF,{})]})})]})},u0=e=>{let t=(0,nN.FX)(),l=(0,oU.mG)()||t,a=(0,oU.mG)()?{style:{touchAction:"none",display:"contents"}}:{};return(0,m.jsx)(eN.s,{"data-doc-background-element":!0,position:"absolute",w:"var(--editor-width)",h:"100%",contentEditable:!1,userSelect:"none",clipPath:"inset(0)",top:0,left:0,...a,children:(0,m.jsx)(f.az,{"data-testid":"doc-background",width:"100%",height:"100%",position:"fixed",...l?{top:"0px"}:{},...e})})};var u1=l(58335);let u2=r.bP.create({name:"doc",topNode:!0,content:"document"}),u6=r.bP.create({name:"document",content:"card+",isolating:!0,defining:!0,selectable:!1,addAttributes:()=>({aiOptions:{default:u1.C.aiOptions,...(0,Y.tb)("aiOptions")},docId:{},background:{default:u1.C.background,...(0,Y.tb)("background")},docFlags:{default:u1.C.docFlags,...(0,Y.tb)("docFlags")},format:{},customCode:{default:u1.C.customCode,...(0,Y.tb)("customCode")},settings:{default:u1.C.settings,...(0,Y.tb)("settings")},generateStatus:{default:u1.C.generateStatus},generateInfo:{default:u1.C.generateInfo,...(0,Y.tb)("generateInfo")}}),addNodeView:()=>(0,u.gu)(uZ,{update:c.z0,ignoreMutation:e=>{let{mutation:t}=e,l=t.target instanceof HTMLElement?t.target:t.target.parentElement,a="selection"!==t.type&&u4(l);return console.debug("[Document.ignoreMutation] isMutationOutsideDocContent:",a),!!a}}),parseHTML:()=>[{tag:"div[class=gamma-doc]"}],renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,r.KV)(t,{class:"gamma-doc"}),0]}}),u4=e=>{let t=null==e?void 0:e.parentElement;return!!t&&!t.closest(".document-content")};var u5=l(97331),u3=l.n(u5),u8=l(15333),u7=l(89565),u9=l(474),ce=l(17835),ct=l(63915),cl=l(48365),ca=l(57036);class cn{destroy(){this.handlers.forEach(e=>{let{name:t,handler:l}=e;return this.editorView.dom.removeEventListener(t,l)})}update(e,t){null!=this.cursor&&t.doc!=e.state.doc&&(this.cursor.pos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){var t,l,a,n,o;(((null==e?void 0:e.pos)||null)!=(null===(t=this.cursor)||void 0===t?void 0:t.pos)||(null==e?void 0:e.type)!=(null===(l=this.cursor)||void 0===l?void 0:l.type)||(null==e?void 0:e.side)!=(null===(a=this.cursor)||void 0===a?void 0:a.side))&&(this.cursor=e,null==e?(null===(o=this.element)||void 0===o||null===(n=o.parentNode)||void 0===n||n.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){var e;let t,l;if(null==this.cursor||!this.editorView)return;let a=this.editorView.state.doc.resolve(this.cursor.pos),n,o=()=>"";if("gallery"==this.cursor.type&&(null===(e=this.cursor.node)||void 0===e?void 0:e.type.name)!=="gallery")n=this.cursor.rect,o=()=>ef.Ru._({id:"pl+vw2"});else if("blankRect"==this.cursor.type)n=this.cursor.rect,o=()=>"";else if("smartLayoutVariant"==this.cursor.type)n=this.cursor.rect,o=()=>ef.Ru._({id:"hErHGD"});else if("column"==this.cursor.type||"gallery"==this.cursor.type||"smartLayout"==this.cursor.type){let e=this.cursor.rect;if(!e)return;let t="right"==this.cursor.side||"bottom"==this.cursor.side,l=t?a.nodeAfter:a.nodeBefore,o=l&&((0,u9.NJ)(l)||(0,ct.q)(l))?0:this.width;if("right"==this.cursor.side||"left"==this.cursor.side){let l=t?e.right+o:e.left-o;n={top:e.top,bottom:e.bottom,left:l-this.width/2,right:l+this.width/2}}else{let l=t?e.bottom+o:e.top-o;n={left:e.left,right:e.right,top:l-this.width/2,bottom:l+this.width/2}}}else if(!a.parent.inlineContent){let e=a.nodeBefore,t=a.nodeAfter;if(e||t){let l=this.editorView.nodeDOM(this.cursor.pos-(e?e.nodeSize:0));if(!l||!(l instanceof Element))return;let a=l.getBoundingClientRect(),o=e?a.bottom:a.top;e&&t&&(o=(o+this.editorView.nodeDOM(this.cursor.pos).getBoundingClientRect().top)/2),n={left:a.left,right:a.right,top:o-this.width/2,bottom:o+this.width/2}}}if(!n){let e=this.editorView.coordsAtPos(this.cursor.pos);n={left:e.left-this.width/2,right:e.left+this.width/2,top:e.top,bottom:e.bottom}}let i=this.editorView.dom.offsetParent;if(this.element||(this.element=i.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none; background-color: "+this.color),i&&(i!=document.body||"static"!=getComputedStyle(i).position)){let e=i.getBoundingClientRect();t=e.left-i.scrollLeft,l=e.top-i.scrollTop}else t=-pageXOffset,l=-pageYOffset;this.element.style.left=n.left-t+"px",this.element.style.top=n.top-l+"px",this.element.style.width=n.right-n.left+"px",this.element.style.height=n.bottom-n.top+"px",this.element.dataset.type=this.cursor.type,this.element.innerHTML=o()}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){var t,l,a,n,o,i,r,s,d,u;if(!this.editorView.editable)return;let c=(0,u8.nA)(this.editorView,e,null===(t=this.editorView.dragging)||void 0===t?void 0:t.slice);if(c){this.setCursor({...c,type:"blankRect"}),this.scheduleRemoval(5e3);return}let m=(0,cl.fc)(this.editorView,e,null===(l=this.editorView.dragging)||void 0===l?void 0:l.slice);if(m){this.setCursor({...m,type:"blankRect"}),this.scheduleRemoval(5e3);return}if((0,u7.Vk)(this.editorView,e,null===(a=this.editorView.dragging)||void 0===a?void 0:a.slice)){this.scheduleRemoval(20);return}let f=(0,ce.tz)(this.editorView,e,null===(n=this.editorView.dragging)||void 0===n?void 0:n.slice,!this.editorView.dragging);if(f){this.setCursor({...f,type:"gallery"}),this.scheduleRemoval(5e3);return}let p=(0,u9.ds)(this.editorView,e,null===(o=this.editorView.dragging)||void 0===o?void 0:o.slice);if(p){this.setCursor({...p,type:"column"}),this.scheduleRemoval(5e3);return}let g=(0,u8.ZL)(this.editorView,e,null===(i=this.editorView.dragging)||void 0===i?void 0:i.slice);if(g){this.setCursor({...g,type:"blankRect"}),this.scheduleRemoval(5e3);return}let h=(0,cl.TS)(this.editorView,e,null===(r=this.editorView.dragging)||void 0===r?void 0:r.slice);if(h){this.setCursor({...h,type:"smartLayoutVariant"}),this.scheduleRemoval(5e3);return}let b=(0,cl.eL)(this.editorView,e,null===(s=this.editorView.dragging)||void 0===s?void 0:s.slice);if(b){this.setCursor({...b,type:"smartLayout"}),this.scheduleRemoval(5e3);return}let y=(0,aH.M7)(this.editorView,e,null===(d=this.editorView.dragging)||void 0===d?void 0:d.slice);if(y){this.setCursor({pos:y.pos,type:"default"}),this.scheduleRemoval(5e3);return}let v=(0,ca.M)(this.editorView,e,null===(u=this.editorView.dragging)||void 0===u?void 0:u.slice);null===v?this.setCursor(null):(this.setCursor({pos:v,type:"default"}),this.scheduleRemoval(5e3))}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){e.target!=this.editorView.dom&&this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}constructor(e,t){this.cursor=null,this.element=null,this.timeout=null,this.editorView=e,this.width=t.width||1,this.color=t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(t=>{let l=e=>this[t](e);return e.dom.addEventListener(t,l),{name:t,handler:l}}),this.dragover=u3()(this.dragover,100,{trailing:!1}).bind(this)}}let co=r.YY.create({name:"dropCursor",addOptions:()=>({color:"currentColor",width:1,class:null}),addProseMirrorPlugins(){return[function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new V.k_({key:new V.hs("dropCursor"),view:t=>new cn(t,e)})}(this.options)]}}).configure({color:"var(--chakra-ring-color)",width:3,class:"ProseMirror-dropcursor"});var ci=l(45363),cr=l(45905);let cs=e=>{let{svg:t,isDark:l,font:a}=e,n=(0,F.useMemo)(()=>(0,cr.k)(l),[l]),o=(0,F.useMemo)(()=>(0,cr.I)(a),[a]);return t?(0,m.jsx)(f.az,{dangerouslySetInnerHTML:{__html:t},"data-testid":"drawing-svg",sx:{svg:{width:"100%",height:"auto",text:o,...n}}}):null};var cd=l(56632);let cu=["tl-centered-g"],cc=async e=>{let t=await e.getSvg(e.shapes.map(e=>e.id),{padding:1});if(t)return cu.forEach(e=>{var l;null===(l=t.querySelector(".".concat(e)))||void 0===l||l.classList.remove(e)}),t.querySelectorAll(":not(mask)[id]").forEach(e=>e.removeAttribute("id")),t},cm=e=>{let{isOpen:t,isEditable:l,onClose:a,font:n,isDark:o,isDrawingEditorActive:i,setDrawingEditorActive:r,...s}=e,{node:d,updateAttributes:u}=s,{page:c,assets:f}=d.attrs,[p,g]=(0,F.useState)();(0,F.useEffect)(()=>{(0,us.IN)(p,c,f)},[c,f,p,u]);let h=(0,F.useCallback)(e=>{g(e),window.tldrawEditor=e,(0,us.Wp)(e,!0)},[]),b=(0,F.useCallback)(async()=>{if(!p)return;let e=await cc(p);if(!e)return;u({svg:e.outerHTML});let t=JSON.stringify({page:p.document.pages.page,assets:p.document.assets});console.debug("[DrawingEditor] Generated SVG",{svgSize:e.outerHTML.length,jsonSize:t.length,svgEl:e})},[p,u]),y=(0,F.useCallback)(()=>{p&&u({page:p.document.pages.page,assets:p.document.assets})},[u,p]),v=(0,o9.lW)(y,500),k=(0,F.useCallback)(()=>{l&&b(),r(!1),a()},[a,b,r,l]);return(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(eI._s,{placement:"bottom",onClose:k,isOpen:t,trapFocus:!0,isFullHeight:!0,returnFocusOnClose:!1,children:[(0,m.jsx)(eI.QP,{}),(0,m.jsxs)(eI.zj,{borderTopRadius:"xl",h:"calc(var(--100vh) - 24px)",onAnimationComplete:e=>{"enter"==e&&r(!0)},transition:{enter:{duration:.4}},children:[(0,m.jsx)(eI.ys,{p:0,h:"100%",overflow:"hidden","data-testid":"drawing-editor-body",children:i?(0,m.jsx)(cd.UG,{readOnly:!l,showPages:!1,onMount:h,onChangePage:l?v:void 0,autofocus:!1,isDark:o,font:n}):(0,m.jsx)(eN.s,{align:"center",justify:"center",w:"100%",h:"100%",children:(0,m.jsx)(nk.y,{size:"xl"})})}),(0,m.jsx)(eI.s1,{zIndex:2,backgroundColor:"white","data-testid":"drawing-editor-close"})]})]})})},cf=(0,sZ.P)(f.az),cp=e=>{let{node:t,updateAttributes:l,selected:a,editor:n,getPos:o,decorations:i}=e,{width:r,meta:s,id:d,horizontalAlign:u,svg:c,page:g}=t.attrs,h=(0,J.GV)(es.Cl),b=(0,J.GV)(es.Ik),y=(0,nN.CJ)(n),v=h&&y&&b,k=(0,J.GV)(es.Xu),w=!!k&&k===d,[x,S]=(0,F.useState)(!1),A=(0,J.GV)(es.SJ),{isDark:C}=(0,tg.mm)(A),z=(0,tp.ZI)(A)["--body-font"],{ref:I,setIsResizing:B,resizeableSx:R,onLayoutAnimationStart:_,onLayoutAnimationComplete:M}=(0,dj.Y3)(n),E=(0,F.useCallback)(()=>{(0,us.CD)(d,!0)},[d]),T=(0,F.useCallback)(()=>{n.chain().setNodeSelection(o()).focus().run()},[n,o]),O=(0,F.useCallback)(()=>{(0,us.CD)(null,!1)},[]),P=(0,F.useCallback)((e,a)=>{l({...t.attrs,fullWidthBlock:void 0===a?t.attrs.fullWidthBlock:a,...e})},[t.attrs,l]),N=r||(null==s?void 0:s.width),D=!c,L=g&&Object.keys(g.shapes).length>0,{isFullWidth:W}=(0,ur.D)(i),U=(0,n9.yp)(W?"center":u);return(0,m.jsx)(p.u,{...e,as:"div",children:(0,m.jsxs)(eN.s,{w:"100%",className:dC.S,css:U,sx:R,direction:"column",_focusWithin:{shadow:"outline"},children:[(0,m.jsxs)(cf,{ref:I,className:"drawing",borderRadius:"var(--box-border-radius)","data-content-reference":!0,"data-selection-ring":!0,"data-selection-background":!0,w:W?"100%":N?"calc(".concat(N," * var(--font-size) / 16)"):"100%",maxW:"100%",h:"auto",position:"relative",layout:!0,layoutDependency:u,transition:{duration:.15},onLayoutAnimationStart:_,onLayoutAnimationComplete:M,minH:D?"6em":"auto","data-drag-handle":!0,children:[v&&a&&!W&&(0,m.jsx)(dj.u4,{imageWrapperRef:I,setIsResizing:B,updateResizeAttrs:P,refreshDeps:[t.attrs]}),!x&&(0,m.jsx)(cs,{font:z,svg:c,isDark:C}),v&&!w&&!D&&(0,m.jsx)(f.az,{cursor:"default",position:"absolute",inset:"0",zIndex:"1",onClick:T,onDoubleClick:E}),D&&(0,m.jsxs)(eC.T,{spacing:3,justify:"center",contentEditable:!1,color:"gray.400",h:32,backgroundColor:"blackAlpha.50",borderRadius:"var(--box-border-radius)","data-testid":"drawing-placeholder",children:[(0,m.jsx)(j.g,{size:"2x",icon:ec.qTS}),h&&(0,m.jsx)(eu.$,{size:"xs",onClick:E,children:L?"Open diagram":"Add diagram"})]})]}),w&&(0,m.jsx)(cm,{...e,isOpen:w,isEditable:h,onClose:O,isDark:C,font:z,isDrawingEditorActive:x,setDrawingEditorActive:S})]})})},cg=new V.hs("UniqueMediaId"),ch=an.S.extend({name:"UniqueDrawingId"}).configure({attributeName:"id",types:["drawing"],initialValue:us.rZ,filterTransaction:aa.kz,pluginKey:cg}),cb=r.bP.create({name:"drawing",group:"block",atom:!0,selectable:!0,draggable:!0,addAttributes:()=>({id:(0,sj.e)(us.rZ),page:{...(0,Y.tb)("page")},assets:{...(0,Y.tb)("assets"),default:{}},meta:{...(0,Y.tb)("meta"),default:{}},fullWidthBlock:{default:!1},width:{},svg:{}}),parseHTML(){return[{tag:"div[class=drawing]"},{tag:"tldraw",getAttrs:e=>{try{let t=new ci.mf,l=JSON.parse(e.innerHTML);return t.insertContent(l,{select:!1}),{page:t.document.pages[t.currentPageId],assets:t.assets}}catch(t){return console.error("(caught) Error parsing Tldraw paste",t,e.innerHTML),!1}}},{tag:"drawing[bookmark]",getAttrs:(0,X.Ll)(this.storage)}]},addStorage:X.xu,renderHTMLforAI(e){let{node:t}=e;return["drawing",{bookmark:(0,X.vL)(this.storage,t)}]},renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,r.KV)(t,{class:"drawing"})]},addCommands(){this.name;let e=e=>{let{selection:t}=e;return t instanceof V.nh&&("drawing"===t.node.type.name||"diagram"===t.node.type.name)?t.node:void 0};return{editSelectedDrawingBlock:()=>t=>{let{state:l}=t,a=e(l);return a&&(0,J.KA)().dispatch((0,es.v5)({drawingId:a.attrs.id})),!0}}},addExtensions:()=>[ch],addNodeView:()=>(0,u.gu)(cp,{update:c.z0})}),cy=r.YY.create({name:"dynamicNodes",extendNodeSchema(e){var t;return{dynamic:null!==(t=(0,r.gk)((0,r.iI)(e,"dynamic",e)))&&void 0!==t&&t}}}),cv=r.YY.create({name:"fixRequiredAttrs",onBeforeCreate(){Object.values(this.editor.schema.nodes).forEach(e=>{Object.values(e.attrs||{}).forEach(e=>{void 0===e.default&&(e.hasDefault=!1)})})}});var ck=l(30138),cw=l(20284),cx=l(69180);let cS=e=>{if("footnote"!==e.$anchor.doc.type.name&&!e.empty&&!(0,cx.uI)(e)&&(0,r.eE)(e)){let e=(0,cx.bk)();if(!e)return;let t=document.querySelector('[data-footnote-popover-id="'.concat(e,'"] .ProseMirror'));t&&t.contains(document.activeElement)||(0,cx.Wj)(null,!1)}},cA=(e,t,l,a)=>{if(!e.some(e=>e.docChanged))return;let{doc:n}=l,o=[],i=[];n.nodesBetween(0,l.doc.content.size,(e,t,l)=>{"footnote"===e.type.name&&o.push({from:t,to:t+e.nodeSize,node:e,parent:l}),e.marks.forEach(a=>{"footnoteLabel"===a.type.name&&i.push({from:t,to:t+e.nodeSize,mark:a,parent:l})})}),i.filter(e=>{let{mark:t,parent:l}=e;return!o.find(e=>{let{node:a,parent:n}=e;return a.attrs.noteId===t.attrs.noteId&&n===l})}).forEach(e=>{let{from:t,to:l,mark:n}=e;return a.removeMark(t,l,n)});let s=e=>(0,r.I2)("footnoteLabel",l.schema).create({noteId:e});i.filter(e=>{let{mark:t}=e;return!t.attrs.noteId}).forEach(e=>{let{mark:t,from:l,to:n}=e,r=o.find(e=>{let{node:t,from:l}=e,a=l>=n,o=!i.find(e=>{let{mark:l}=e;return l.attrs.noteId==t.attrs.noteId});return a&&o});r&&a.removeMark(l,n,t).addMark(l,n,s(r.node.attrs.noteId))}),Object.entries(lQ()(o,e=>{let{node:t}=e;return t.attrs.noteId})).forEach(e=>{let[t,l]=e;if(1==l.length||!t)return;let n=i.filter(e=>{let{mark:l}=e;return l.attrs.noteId===t});l.slice(1).forEach((e,t)=>{let{from:l}=e,o=(0,cx.pN)();a.setNodeMarkup(l,void 0,{noteId:o});let i=n[t+1];i&&(a.removeMark(i.from,i.to,i.mark),a.addMark(i.from,i.to,s(o)))})})},cC=new V.k_({key:new V.hs("footnote"),appendTransaction:(e,t,l)=>{let{selection:a}=l;a.eq(t.selection)||cS(a);let n=l.tr;return((0,sl.z)(e,t,l,n),cA(e,t,l,n),n.docChanged)?(console.debug("[FootnotePlugin] Applied steps",n.steps),n):null}});var cz=l(13945),cI=l(97864),cj=l(57322),cF=l(57450),cB=l(44380);let cR=new V.hs("autocomplete"),c_=e=>new V.k_({key:cR,state:{init:()=>({loading:!1,insertedRange:null}),apply(e,t){let l=e.getMeta("autocompleteEvent");return(null==l?void 0:l.type)==="reset"?{loading:!1,insertedRange:null}:(null==l?void 0:l.type)==="load"?{loading:!0,insertedRange:null}:(null==l?void 0:l.type)==="insert"?{loading:!1,insertedRange:l.range}:t}},props:{decorations(e){let t=[],l=cR.getState(e),{selection:a,doc:n}=e,{loading:o,insertedRange:i}=l||{};if(o){let e=r_.NZ.widget(a.from,()=>{let e=document.createElement("span");return e.className="autocomplete-loading",e});t.push(e)}if(i){let e;try{e=(0,r.Nx)(n,i,e=>e.isTextblock)}catch(t){e=[]}e.forEach(e=>{let{node:l,pos:a}=e,n=Math.max(a+1,i.from),o=Math.min(a+l.nodeSize-1,i.to),r=r_.NZ.inline(n,o,{class:"autocomplete-inserted"});t.push(r)})}return t.length?r_.zF.create(n,t):r_.zF.empty}}});var cM=l(53547);class cE extends cM.U{getSystemChatMessage(e){return{role:t7.VDI.System,content:cT(this.systemPrompt,e)}}getUserChatMessage(e){return{role:t7.VDI.User,content:cT(this.userPrompt,e)}}constructor({variables:e,systemPrompt:t,userPrompt:l,params:a}){super({params:a}),this.variables=e,this.systemPrompt=t,this.userPrompt=l}}function cT(e,t){let l=e;for(let e in t)l=l.replaceAll("{{".concat(e,"}}"),t[e]);return l}let cO=new cE({systemPrompt:"You are helping a user write a document. Your job is to continue what they've written by writing 2-3 additional sentences. Respond with the just the additional text, and no additional conversation.".trim(),userPrompt:"Continue the following text. Respond with at most 3 sentences.\n\n{{text}}".trim(),variables:["text"],params:{maxTokens:200,temperature:1,model:"gpt-3.5-turbo"}}),cP=/(\+\+\+)/;r.YY.create({name:"autocomplete",addProseMirrorPlugins(){return[c_(this.editor)]},addCommands:()=>({autoOutline:()=>e=>{let{editor:t,state:l,tr:a}=e,{selection:n,doc:o}=l,{$from:i,from:s}=n,d=(0,rM.JO)(l,i.after()),u=(0,r.KP)($.jg)(n);return!!u&&!!d&&(a2(o,u.pos,s),a.setMeta("autocompleteEvent",{type:"load"}),!0)},autoComplete:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return t=>{var l;let{editor:a,state:n,tr:o}=t,{selection:i,doc:r}=n,{from:s}=i,d=(0,rM.JO)(n,s);if(!(ej.of.get("aiAutocomplete")&&i.empty&&i instanceof V.U3&&d))return!1;let u=(0,J.KA)().getState(),c=null===(l=(0,es.Jo)(u))||void 0===l?void 0:l.organization;if(!(0,cB.n)("autocomplete",c))return!1;let m=a2(r,Math.max(i.from-1e3,0),i.from),f=(0,aK.p9)(m).slice(-200),p=(0,aK.$0)(f),g=r.textBetween(i.from-10,i.to);o.setMeta("autocompleteEvent",{type:"load"});let h=(0,l4.$F)(),b=cO.prepare({interactionId:h,variables:{text:p},params:e}),y=performance.now(),v={interactionId:h,interface:"autocomplete",inputContent:m};return(0,l4.rl)(v),(0,cF.U)(b,h,{timeout:5e3,retries:1}).then(e=>{var t;let l=(0,rM.d_)(n,d);if(!e||!l)throw Error("No completion or insertPos");e=e.trim();let o={from:l,to:l},i=a.chain().insertMarkdownAt(o,e).command(e=>{let{tr:t}=e,l=(0,iU.i)(t);return!l||(o.to=l.to,t.setSelection(l).scrollIntoView(),!0)}).setMeta("autocompleteEvent",{range:o,type:"insert"});(null===(t=n.doc.resolve(l).nodeBefore)||void 0===t?void 0:t.isText)&&!(g.endsWith(" ")||g.endsWith("\n"))&&i.insertContentAt(l," ",{updateSelection:!1}),i.run(),(0,l4.UL)({...v,outputContent:e,latency:performance.now()-y,timeToComplete:performance.now()-y}),(0,aD.w)("autocomplete",c,h),setTimeout(()=>{a.commands.setMeta("autocompleteEvent",{type:"reset"})},4e3)}).catch(e=>{console.warn("Error fetching autocomplete",e),a.commands.setMeta("autocompleteEvent",{type:"reset"})}),!0}}}),addInputRules:()=>[new r.fV({find:cP,handler:e=>{let{range:t,chain:l}=e;l().setTextSelection(t).deleteSelection().autoComplete().run()}})]});let cN="transparent",cD=(0,nC.i7)({"0%":{transform:"rotate(0deg)"},"100%":{transform:"rotate(360deg)"}}),cL=(0,nC.i7)({"0%":{opacity:.5,color:"var(--chakra-colors-trueblue-500)"},"100%":{opacity:1,color:"inherit"}}),cW={".autocomplete-loading":{display:"inline-block",borderColor:"currentColor",borderStyle:"solid",borderRadius:"99999px",borderWidth:"2px",borderBottomColor:cN,borderLeftColor:cN,animation:"".concat(cD," ").concat("0.45s"," linear infinite"),width:"var(--spinner-size)",height:"var(--spinner-size)","--spinner-size":"1em",marginLeft:"0.25em",color:"var(--chakra-colors-trueblue-500)"},".autocomplete-inserted":{animation:"".concat(cL," ").concat(4e3,"ms ease-out")}},cU="%23553bff",cG={backgroundRepeat:"no-repeat",backgroundSize:"11px",backgroundPosition:"8px center",fontSize:"13px",fontWeight:"bold",color:"var(--chakra-colors-trueblue-400)",position:"absolute",zIndex:1,top:"0px",left:"0px",backgroundColor:"var(--chakra-colors-trueblue-100)",padding:"4px 12px",paddingLeft:"24px",borderRadius:"0 0 4px 4px",pointerEvents:"none"},cH={".block-card":{transitionProperty:"opacity",transitionDuration:"normal"},".ai-generate-streaming-card":{"&.node-card":{pointerEvents:(0,oU.Xb)()?void 0:"none !important"},"&.node-card > [data-node-view-wrapper] > .card-wrapper > .card-body":{_before:{content:"''",position:"absolute",inset:"0px",zIndex:1,boxShadow:"0px 0px 0px 5px var(--chakra-colors-trueblue-100)",borderRadius:"inherit",pointerEvents:"none"}},".streaming-cursor__label":{_after:{...cG,backgroundImage:'/**/url(\'data:image/svg+xml;charset=utf-8,\x3c!--! Font Awesome Pro 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e\')'),content:"var(--ai-generating-label)"}}},"&.sal-active":{".block-card:not(.sal-active-card, .sal-active-card-parent)":{opacity:.5},".sal-active-card > [data-node-view-wrapper] > .card-wrapper > .card-body":{_before:{content:"''",position:"absolute",inset:"0px",zIndex:1,boxShadow:"0px 0px 0px 5px var(--chakra-colors-trueblue-100)",borderRadius:"inherit",pointerEvents:"none"},_after:{...cG,backgroundImage:'/**/url(\'data:image/svg+xml;charset=utf-8,\x3c!--! Font Awesome Pro 6.4.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --\x3e\')'),content:"var(--ai-editing-label)",left:"50%",transform:"translate(-50%,0px)"}},".sal-active-card-parent":{".block:not(.sal-active-card)":{opacity:.5},".sal-active-card":{".block":{opacity:1}}},".sal-selection-text":{backgroundColor:"rgba(100, 100, 100, 0.25)",...P.wd}}},cV=".125em",cq="scale(1.05)",cK={transitionDuration:"slow",transitionTimingFunction:"ease-out"},cJ=".comments-wrapper, .block-comments-circle",c$="> :is(".concat(cJ,")"),cQ="> :not(".concat(cJ,"), [data-spotlight-parent] > *"),cY=e=>{let t=e?.2:.65;return{"&.react-renderer > [data-node-view-wrapper]":{[cQ]:{transitionProperty:"filter, transform",...cK,filter:"opacity(".concat(t,") blur(").concat(e?cV:"0",")")},[c$]:{transitionProperty:"opacity",...cK,filter:"opacity(".concat(t,") blur(").concat(e?cV:"0",")"),"&[data-is-popup-open=true]":{filter:"none"},_hover:{filter:"none"}}},"&:not(.react-renderer)":{transitionProperty:"filter, transform",...cK,filter:"opacity(".concat(t,") blur(").concat(e?cV:"0",")")}}},cX={".ProseMirror":{"&.spotlight-active":{"[data-spotlight-dim]":{opacity:.2},".spotlightable":{...cY(!1),transitionProperty:"filter, transform",...cK,cursor:"pointer"},".spotlightable:hover":{transform:cq},".spotlightable.after-spotlight":cY(!0),".spotlightable.spotlight-block, .spotlight-block .spotlightable":{"&.react-renderer > [data-node-view-wrapper]":{[cQ]:{opacity:"1",filter:"none",transform:"".concat(cq," !important")},[c$]:{filter:"none"}},"&:not(.react-renderer)":{filter:"none",transform:"".concat(cq," !important")}}},...cH,".block-card":{transitionProperty:"opacity",transitionDuration:"normal"},"&.card-notes-active":{".block-card:not(.card-notes-active-parent-card)":{opacity:.5},".card-notes-active-parent-card .block-card":{opacity:"revert"},".card-notes-active-parent-card > [data-node-view-wrapper] > .card-wrapper > .card-body":{_before:{content:"''",position:"absolute",inset:"0px",zIndex:1,boxShadow:"0px 0px 0px 5px var(--chakra-colors-trueblue-100)",borderRadius:"inherit",pointerEvents:"none"}}},'&[contenteditable="true"]':{"&:focus-within":{".ProseMirror-gapcursor":{display:"block",height:"1.5em",position:"relative","&:after":{width:"0px",height:"100%",borderTop:"0px",borderLeft:"1px solid black"}},".grid-cell":{".ProseMirror-gapcursor:first-child":{marginTop:"1em"},".ProseMirror-gapcursor:last-child":{marginBottom:"1em"}},".block-table td":{".ProseMirror-gapcursor:first-child":{marginTop:".75em"},".ProseMirror-gapcursor:last-child":{marginBottom:".75em"}},".is-dark":{".ProseMirror-gapcursor:after":{borderLeftColor:"white"}}}},".collaboration-cursor__caret":{position:"relative",marginLeft:"-1px",marginRight:"-1px",borderLeft:"1px solid #0d0d0d",borderRight:"1px solid #0d0d0d",wordBreak:"normal",pointerEvents:"none",textIndent:0},".collaboration-cursor__label":{position:"absolute",top:"-1.4em",left:"-1px",fontSize:"12px",fontStyle:"normal",fontFamily:"'Inter', sans-serif",fontWeight:"600",lineHeight:"normal",letterSpacing:"normal",textTransform:"none",userSelect:"none",color:"#0d0d0d",padding:"0.1rem 0.3rem",borderRadius:"3px 3px 3px 0",whiteSpace:"nowrap",zIndex:1,pointerEvents:"auto",spellCheck:"false",_hover:{opacity:.1}},'&[contenteditable="false"]':{".ProseMirror-gapcursor":{display:"none"},".collaboration-cursor__caret:not(.streaming-cursor)":{display:"none"}},...cW,".is-selecting-node, .sal-selection-node, .sal-selection-card":{"[data-selection-ring]":{_before:{content:'""',position:"absolute",inset:0,borderRadius:"inherit",outline:"2px solid",outlineColor:"trueblue.300",pointerEvents:"none",zIndex:1}},'[data-selection-ring="inside"]':{_before:{zIndex:10,outlineOffset:"-2px"}},'[data-selection-ring="padded"]':{_before:{outlineOffset:"0.25em"}},".react-renderer [data-selection-ring]":{_before:{content:"none"}}},".is-selecting-around":{"[data-selection-background]":{_after:{content:'""',position:"absolute",inset:0,backgroundColor:"var(--chakra-ring-color)",borderRadius:"inherit",opacity:.75}},".react-renderer:not(.is-selecting-around) [data-selection-ring]":{_after:{content:"none"}}},".card-present-mode":{"&--doc":{transform:"translateY(0)",position:"relative",zIndex:1},"&--presentCollapsed":{transform:"translateY(0)",position:"relative",zIndex:1},"&--presentPrev":{transform:"translateY(-100%)",position:"fixed",zIndex:2},"&--presentCurrent":{transform:"translateY(0)","@media print":{transform:"none"},position:"fixed",zIndex:3},"&--presentNext":{transform:"translateY(100%)",position:"fixed",zIndex:2},"&--presentParent":{transform:"translateY(0)",position:"fixed",zIndex:2}},".document-content.is-doc-mode":{".card-wrapper":{"&:hover":{".card-divider":{opacity:1},".manage-card-controls":{opacity:1}}}},".document-content":{".card-wrapper":{"&:hover":{".card-footer-reactions":{opacity:1},".card-collapsed":{".card-footer-reactions":{display:"none"}}}}}},".ProseMirror-dropcursor":{transitionProperty:"inset",transitionDuration:"fast",borderRadius:"md",position:"relative",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"white",outline:"1px solid",outlineColor:"whiteAlpha.800",pointerEvents:"none",backdropFilter:"blur(4px)","&::after":{backgroundColor:"gray.700",color:"whiteAlpha.900",px:"8px",py:"2px",borderRadius:"sm",fontWeight:"medium",shadow:"md",fontSize:"sm",w:"max-content",pointerEvents:"none",display:"none"},'&[data-type="column"]::after':{content:'"Drop to add column"',position:"absolute",top:"-2em",display:"block"}}};var cZ=l(83707),c0=l(54363),c1=l(5893);let c2=(e,t,l)=>{let a=(0,J.GV)(es.DH);(0,eV.j)({ref:l,enabled:!!(l&&a===t),handler(e){var t,l;(null===(t=e.target)||void 0===t?void 0:t.closest("[data-footnote-view]"))||(null===(l=e.target)||void 0===l?void 0:l.closest("[data-footnote-label]"))||n(!1)}});let n=(0,F.useCallback)(l=>{var n,o;let i=e.state.selection,s=(0,r.eE)(i)&&!i.empty,d=(null===(n=document.activeElement)||void 0===n?void 0:n.closest(".footnote-popover"))||!!(null===(o=document.activeElement)||void 0===o?void 0:o.closest("[data-in-editor-focus]")),u=void 0!==l?l:a!==t;d||(u&&!s?(0,cx.N3)(t,!0):!1===u&&(0,cx.N3)(t,!1))},[e.state.selection,a,t]);return{onClick:n}},c6=e=>{let{node:t,editor:l,innerEditor:a,selected:n}=e,{noteId:o}=t.attrs,i=(0,F.useRef)(null),r=(0,J.GV)(es.DH),s=(0,J.GV)(es.Cl),d=(0,sf.oR)(),{onClick:c}=c2(l,o,i);(0,F.useEffect)(()=>{a&&a.setEditable(s)},[s,a]);let p=!!r&&r===o,g=(0,F.useCallback)(()=>(0,cx.Wj)(o,!1),[o]);(0,F.useEffect)(()=>{if(!a)return;let e=()=>{setTimeout(()=>{(0,Y.We)(a)||g()},20)};return a.on("blur",e),()=>{a.off("blur",e)}},[a,g]);let h=!(0,iy.NO)(l),b=(0,F.useCallback)(()=>{h&&c()},[h,c]);return(0,m.jsx)(u.VR,{as:"span","data-testid":"footnote-nodeview-wrapper",children:(0,m.jsxs)(eq.A,{isOpen:p,onClose:g,placement:"top",gutter:8,isLazy:!0,lazyBehavior:"unmount",autoFocus:!1,closeOnBlur:!1,closeOnEsc:!1,returnFocusOnClose:!1,children:[(0,m.jsx)(eK.W,{children:(0,m.jsx)(z.E,{as:"span",onClick:b,_after:{content:"counter(footnote)",counterIncrement:"footnote",position:"relative",bottom:"0.6em",fontSize:"0.8em",shadow:n&&h?"outline":void 0,borderRadius:"sm"},pl:"1px",className:"footnote",contentEditable:!1,"data-footnote-view":!0,cursor:h?"pointer":void 0})}),h&&(0,m.jsx)(eJ.Z,{children:(0,m.jsxs)(e$.h,{zIndex:"popover",shadow:"md",borderRadius:"md",border:"1px solid",borderColor:"gray.200",w:"500px",maxW:"100vw","data-footnote-popover-test-id":o,p:0,ref:i,children:[(0,m.jsx)(cz.R,{}),(0,m.jsx)(cI.e,{position:"relative",zIndex:"1",p:0,className:"footnote-popover","data-footnote-popover-id":o,children:d?(0,m.jsx)(c3,{...e,onClose:g}):(0,m.jsx)(c5,{...e,editable:s,onClose:g})}),(0,m.jsx)(f.az,{position:"absolute",top:"-".concat(8,"px"),bottom:"-".concat(8,"px"),left:0,right:0,zIndex:"0"})]})})]})})},c4=i3()({},cX,{".ProseMirror":{px:8,py:4,overflow:"hidden auto",maxH:"300px",maxW:"100%",borderRadius:"md"}}),c5=e=>{let{editor:t,innerEditor:l,mountEditor:a,destroyEditor:n,node:o,editable:i,getPos:s,onClose:d}=e,{noteId:u}=o.attrs,c=(0,F.useCallback)(()=>t.commands.convertNoteToCard(u),[t,u]),p=(0,F.useCallback)(()=>{t.chain().focus().setNodeSelection(s()).deleteSelection().run()},[t,s]);(0,F.useEffect)(()=>{if(a&&n)return a(),()=>{n()}},[a,n]);let g=(0,J.GV)(es.SJ),h=(0,tp.ZI)(g,"#FFFFFF");if(!l)return null;let b=(0,r.xe)(t.state.doc,e=>e.marks.some(e=>"footnoteLabel"===e.type.name&&e.attrs.noteId===u)).length>0;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(f.az,{className:er._P,sx:c4,position:"relative",_focusWithin:{shadow:i?"outline":void 0},borderRadius:"md",css:h,children:[(0,m.jsx)(c1.$,{editor:l,className:"highlight-mask"}),(0,m.jsx)(cZ.G,{editor:l}),(0,m.jsxs)(ed.e,{size:"sm",colorScheme:"gray",variant:"ghost",position:"absolute",right:4,top:2,onMouseDown:e3.Fw,spacing:0,children:[i&&(0,m.jsxs)(tr.W,{autoSelect:!1,isLazy:!0,children:[(0,m.jsx)(ts.I,{as:e9.K,icon:(0,m.jsx)(j.g,{icon:ec.Dwc}),minW:6,h:6,isRound:!0,backgroundColor:"white"}),(0,m.jsx)(eJ.Z,{children:(0,m.jsxs)(td.c,{"data-in-editor-focus":!0,zIndex:"dropdown",children:[b&&(0,m.jsx)(lg.D,{icon:(0,m.jsxs)("span",{className:"fa-layers fa-fw",children:[(0,m.jsx)(j.g,{icon:lb.vti,fixedWidth:!0}),(0,m.jsx)(j.g,{icon:lb.dmS,inverse:!0,transform:"shrink-8"})]}),onClick:c,children:(0,m.jsx)(em.x6,{id:"p/s15o"})}),(0,m.jsx)(lg.D,{icon:(0,m.jsx)(j.g,{icon:ec.yLS,fixedWidth:!0}),color:"red.500",onClick:p,children:(0,m.jsx)(em.x6,{id:"sHHbXH"})})]})})]}),(0,m.jsx)(e9.K,{"aria-label":ef.Ru._({id:"j+JKcM"}),icon:(0,m.jsx)(j.g,{icon:ec.GRI}),minW:6,h:6,isRound:!0,onClick:d,backgroundColor:"white"})]})]}),(0,m.jsx)(c0.Ht,{editor:l})]})},c3=e=>{let{mountEditor:t,destroyEditor:l,onClose:a}=e,n=(0,F.useMemo)(()=>{if(t)return t()},[t]);(0,F.useEffect)(()=>{if(l)return()=>l()},[l]);let o=(0,J.GV)(es.SJ),i=(0,tp.ZI)(o,"#FFFFFF");return n?(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(f.az,{className:er._P,sx:c4,position:"relative",borderRadius:"md",css:i,children:[(0,m.jsx)(cj.N,{editor:n}),(0,m.jsx)(ed.e,{size:"sm",colorScheme:"gray",variant:"ghost",position:"absolute",right:4,top:2,onMouseDown:e3.Fw,spacing:0,children:(0,m.jsx)(e9.K,{"aria-label":ef.Ru._({id:"j+JKcM"}),icon:(0,m.jsx)(j.g,{icon:ec.GRI}),minW:6,h:6,isRound:!0,onClick:a,backgroundColor:"white"})})]})}):null};var c8=l(25845);let c7=r.CU.create({name:"footnoteLabel",inclusive:!1,excludes:"link underline",priority:Z.y.FootnoteLabel,parseHTML(){return[{tag:"span[class=footnote-label][bookmark]",getAttrs:(0,X.Ll)(this.storage)},{tag:"span[class=footnote-label]"}]},renderHTML(e){let{HTMLAttributes:t}=e;return["span",(0,r.KV)(t,{class:"footnote-label"}),0]},renderHTMLforAI(e){let{mark:t}=e;return["span",{class:"footnote-label",bookmark:(0,X.vL)(this.storage,t)},0]},addStorage:X.xu,addAttributes:()=>({noteId:{rendered:!1}}),addProseMirrorPlugins(){return[(0,c8.f)(this,c9)]}}),c9=e=>{let{node:t,editor:l,children:a}=e,{noteId:n}=t.attrs,o=(0,sf.oR)(),{onClick:i}=c2(l,n),r=!(0,iy.NO)(l),s=(0,F.useCallback)(()=>{r&&i()},[r,i]);return(0,m.jsx)(u.VR,{as:"span",className:"footnote-label-view",children:(0,m.jsx)(z.E,{as:"span",className:"footnote-label",onClick:s,"data-footnote-label":!0,cursor:r?"pointer":void 0,children:o?a:(0,m.jsx)(u.$p,{as:"span"})})})},me=/(?:^|\s)((?:\^)((?:[^^]+))(?:\^))$/,mt=r.bP.create({name:"footnote",content:"(block | footnoteBlock)+",group:"inline",atom:!0,inline:!0,priority:Z.y.Footnote,parseHTML(){return[{tag:"span[class=footnote]",getContent:(e,t)=>l0.FK.fromJSON(t,JSON.parse(e.getAttribute("data-content")||"{}"))},{tag:"div[class=imported-footnote]"},{tag:"footnote[bookmark]",getAttrs:(0,X.Ll)(this.storage),getContent:(0,X.cn)(this.storage)}]},addStorage:X.xu,renderHTML(e){let{node:t,HTMLAttributes:l}=e;return["span",(0,r.KV)(l,{class:"footnote","data-content":JSON.stringify(t.content.toJSON())})]},renderHTMLforAI(e){let{node:t}=e;return["footnote",{bookmark:(0,X.vL)(this.storage,t)}]},addAttributes(){return{noteId:{parseHTML:e=>{let t=(0,X.Ll)(this.storage)(e);return t&&t.noteId?t.nodeId:(0,cx.pN)()},default:void 0}}},addNodeView:()=>r8(c6,{nodeName:"footnote",preventNodeOrExtensionTypes:["doc","document","card"]}),addInputRules(){var e;return[(e={find:me,nodeType:this.type,markType:this.editor.schema.marks.footnoteLabel},new r.fV({find:e.find,handler:t=>{let{state:l,range:a,match:n}=t,{tr:o}=l,i=n[n.length-1],s=n[0],d=a.to;if(i){let t=s.search(/\S/),n=a.from+s.indexOf(i),u=n+i.length;if((0,r.hO)(a.from,a.to,l.doc).filter(t=>t.mark.type.excluded.find(l=>l===e.markType&&l!==t.mark.type)).filter(e=>e.to>n).length)return;ua.from&&o.delete(a.from+t,n),d=a.from+t+i.length;let c=(0,cx.pN)();(0,cx.Wj)(c,!0);let m=e.nodeType.createAndFill({noteId:c},l0.FK.empty);o.insert(d,m),o.addMark(a.from+t,d,e.markType.create({noteId:c})),o.removeStoredMark(e.markType)}}}))]},addKeyboardShortcuts:()=>({Enter:e=>{let{editor:t}=e;if(!(0,cx.uI)(t.state.selection))return!1;let l=t.state.selection.node.attrs.noteId;return(0,cx.Wj)(l,!0),!0},Escape:()=>{let e=(0,cx.bk)();return!!e&&((0,cx.Wj)(e,!1),!0)},"Mod-Alt-f":e=>{let{editor:t}=e;return t.commands.toggleFootnote()}}),addProseMirrorPlugins:()=>[cC],addCommands:()=>({convertNoteToCard:e=>t=>{let{chain:l,state:a}=t,{doc:n}=a,o=(0,r.xe)(n,t=>"footnote"===t.type.name&&t.attrs.noteId===e);if(1!==o.length)throw Error("Found the wrong number of footnotes nodes: ".concat(o));let{node:i,pos:s}=o[0],d=(0,r.ve)(n.resolve(s-1),a.schema.marks.footnoteLabel,{noteId:i.attrs.noteId});if(!d)return console.error("Couldnt find the corresponding footnote mark",{node:i,pos:s}),!1;let u=n.textBetween(d.from,d.to),c={type:"card",attrs:{id:ao.generate()},content:[{type:"heading",attrs:{level:1},content:[{type:"text",text:u}]},...i.content.toJSON()]},m=new URL(window.location.href);m.hash="card-".concat(c.attrs.id),(0,et.wE)(c.attrs.id,!1);let f=n.content.size-1;return l().setTextSelection(d).unsetMark("footnoteLabel").setLink({href:m.toString()}).insertContentAt(f,c).command(e=>{let{tr:t}=e,l=(0,iW.s)(t.doc.resolve(f));return l&&t.setSelection(l),!0}).deleteRange({from:s,to:s+i.nodeSize}).focusDelayed().run()},toggleFootnote:()=>e=>{let{chain:t,state:l,editor:a}=e;if(a.isActive("footnoteLabel"))return t().toggleMark("footnoteLabel").focus().run();let n=(0,cx.pN)();return(0,cx.Wj)(n,!0),(0,cw.b)().push(()=>{var e,t;null===(e=(t=a.commands).forceHideBubbleMenu)||void 0===e||e.call(t,!0),ml(n)},"toggleFootnote"),t().setMark("footnoteLabel",{noteId:n}).insertContentAt(l.selection.to,{type:"footnote",attrs:{noteId:n},content:[{type:"paragraph"}]}).run()}})}),ml=e=>{let t=document.querySelector('[data-footnote-popover-id="'.concat(e,'"] .ProseMirror'));if(!t)return;t.focus();let l=window.getSelection();if(!l)return;let a=document.createRange();a.setStart(t,0),a.setEnd(t,0),l.removeAllRanges(),l.addRange(a)};var ma=l(33487),mn=l(34444),mo=l(98213);let mi=/(?:^|\s)((?:_)((?:[^_]+))(?:_))$/,mr=/(?:^|\s)((?:__)((?:[^__]+))(?:__))$/,ms=mo.Ay.extend({addInputRules(){return[(0,r.OX)({find:mi,type:this.type}),(0,r.OX)({find:mr,type:this.type})]}});function md(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,l=t>0,{parent:a,doc:n}=e,o=e.start(),i=e.after();if(a.type.spec.isolating){let e=n.resolve(l?i-1:o),t=(0,iU.n)(e,l?1:-1);if(l){let e=n.resolve(t.to).node();if(e&&e.isTextblock&&0===e.content.size)return t.to+1}return l?t.to:t.from}let r=e.start(e.depth-1);return md(e.doc.resolve(r),t)}var mu=l(44916);let mc=e=>{let t=md(e,-1);return e.pos===t?er.$x:t},mm=(e,t)=>{let l=md(t,1);return t.pos===l?e.state.doc.content.size-er.$x:l},mf=r.YY.create({name:"KeyMapOverride",priority:Z.y.KeyMapOverride,addOptions:()=>({addSelectionKeyMaps:!1}),addKeyboardShortcuts(){let e=()=>this.editor.commands.first(e=>{let{commands:t}=e;return[()=>t.handleCardAccentDelete(),()=>{var e;return null===(e=t.handleSmartLayoutDelete)||void 0===e?void 0:e.call(t,!0,!1)},()=>t.deleteSelectionAndSelectNear(-1),()=>t.deleteSelection(),e=>{let{view:t,state:l,dispatch:a}=e;return(0,mu.o6)(l,a,t)},()=>t.unwrapQuoteOnDelete(),e=>{let{view:l,state:a,tr:n}=e,o=t.joinBackward();return o&&n.setMeta("annotationEvent",{type:"join-backward",joinPos:a.selection.from,atBeginning:l.endOfTextblock("backward")}),o},()=>t.selectNodeBackward(),()=>t.handleLayoutDelete(!1),()=>t.handleButtonDelete(!0),()=>t.deleteCardIfEmpty(!1),()=>t.mergeCardsOnDelete(!1)]}),t=()=>this.editor.commands.first(e=>{let{commands:t}=e;return[()=>t.handleCardAccentDelete(),()=>{var e;return null===(e=t.handleSmartLayoutDelete)||void 0===e?void 0:e.call(t,!0,!0)},()=>t.deleteSelectionAndSelectNear(),()=>t.deleteSelection(),e=>{let{view:l,state:a,tr:n}=e,o=t.joinForward();return o&&n.setMeta("annotationEvent",{type:"join-forward",joinPos:a.selection.from,atEnd:l.endOfTextblock("forward")}),o},()=>t.selectNodeForward(),()=>t.handleLayoutDelete(!0),()=>t.handleButtonDelete(!0),()=>t.deleteCardIfEmpty(!0),()=>t.mergeCardsOnDelete(!0)]}),l={};return this.options.addSelectionKeyMaps&&(l={"Mod-a":e=>{let{editor:t}=e,{selection:l}=t.state;if(l instanceof V.nh&&l.node.type.spec.isolating)return t.commands.selectAll();let a=md(t.state.selection.$from,-1),n=md(t.state.selection.$to,1);return l.from===a&&l.to===n?t.commands.selectAll():(t.commands.command(e=>{let{tr:t}=e;return t.setSelection(V.U3.create(t.doc,a,n)),!0}),!0)},"Mod-ArrowUp":e=>{let{editor:t}=e,l=mc(t.state.selection.$from);if(!l)return!1;let a=t.state.doc.resolve(l);if(ea.n.valid(a)){let e=new ea.n(a);return t.view.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}return t.chain().setTextSelection(l).scrollIntoView().run()},"Mod-Shift-ArrowUp":e=>{let{editor:t}=e,l=mc(t.state.selection.$from);return!!l&&t.chain().setTextSelection({from:l,to:t.state.selection.to}).scrollIntoView().run()},"Mod-ArrowDown":e=>{let{editor:t}=e,l=mm(t,t.state.selection.$to),a=t.state.doc.resolve(l);if(ea.n.valid(a)){let e=new ea.n(a);return t.view.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}return t.chain().setTextSelection(l).scrollIntoView().run()},"Mod-Shift-ArrowDown":e=>{let{editor:t}=e,l=mm(t,t.state.selection.$to);return t.chain().setTextSelection({from:t.state.selection.from,to:l}).scrollIntoView().run()},"Shift-Mod-a":e=>{let{editor:t}=e;return t.commands.selectAll()}}),{...l,Enter:()=>this.editor.commands.first(e=>{let{commands:t}=e;return[()=>t.newlineInCode(),()=>t.createParagraphNear(),()=>t.liftEmptyBlock(),e=>{let{view:l,state:a,tr:n}=e;return n.setMeta("annotationEvent",{type:"split-block",splitPos:a.selection.from,atBeginning:l.endOfTextblock("backward")}),t.splitBlock()}]}),Backspace:e,"Mod-Backspace":e,"Shift-Backspace":e,Delete:t,"Mod-Delete":t,Space:()=>this.editor.commands.first(e=>{let{commands:t}=e;return[()=>t.handleSpaceToZoom()]})}}});r.YY.create({name:"UndoInputRuleKeymap",priority:Z.y.UndoInputRuleKeymap,addKeyboardShortcuts:()=>({"Shift-Mod-a":e=>{let{editor:t}=e;return t.commands.selectAll()},"Mod-z":e=>{let{editor:t}=e;return t.commands.undoInputRule()},Backspace:e=>{let{editor:t}=e;return t.commands.undoInputRule()},"Mod-Backspace":e=>{let{editor:t}=e;return t.commands.undoInputRule()}})});let mp=r.YY.create({name:"KeyBoardCatchall",priority:Z.y.KeyBoardCatchall,addKeyboardShortcuts:()=>({Tab:e=>{let{editor:t}=e;return t.view.hasFocus()},"Shift-Tab":e=>{let{editor:t}=e;return t.view.hasFocus()}}),addProseMirrorPlugins:()=>[new V.k_({key:new V.hs("KeyBoardCatchall"),props:{handleKeyDown:(e,t)=>uj.WC.handleKeydown(t)}})]});var mg=l(22574),mh=l(71002),mb=l(12127),my=l(94007),mv=l(40452),mk=l(48292);let mw=e=>{var t;let{node:l,decorations:a,editor:n,getPos:o}=e,{options:i,...r}=l.attrs,s=(0,mv.fw)(a),d=(0,mk.B)(s.smartLayoutAttrs.variantKey),{Cell:c}=d,g=(0,J.GV)(es.SJ),h=(0,cl.aG)(s.smartLayoutAttrs,s.direction),{firstChildSize:b}=(0,T.P)(a),y=s.index===s.numCells-1,v=(0,J.GV)(es.nD),k=(0,eP.DM)(a),w="number"==typeof s.emphasizedIndex&&s.emphasizedIndex!==s.index,x=(0,F.useCallback)(()=>{let e=o(),t=n.state.doc.nodeAt(o());t&&n.commands.insertSmartLayoutCell(e+t.nodeSize)},[n,o]),S=d.addDirection?d.addDirection(h):"right",[A,C]=(0,o$.yz)(s.direction),I=(0,F.useCallback)(()=>{v&&n.commands.selectNodeAtPos(o())},[n,o,v]),B=r.image,R=(0,F.useCallback)(e=>{n.commands.updateNestedAttributesAtPos(o(),{image:i3()({},B,e,{meta:{has_transparency:!0}})})},[n,o,B]),{bgRemovalInProgress:_}=(0,i7._A)({editor:n,id:r.id,src:null==B?void 0:B.src,updateAttributes:R});return(0,m.jsx)(p.u,{...e,children:(0,m.jsx)(f.az,{display:"contents",position:"relative","data-spotlight-parent":!0,className:w?"smart-layout-cell-not-emphasized":"",style:{...(0,n9.AS)(h.horizontalAlign||(null===(t=d.baseHorizontalAlign)||void 0===t?void 0:t.call(d,{dir:s.direction})),s.direction)},children:(0,m.jsxs)(c,{cellOptions:i,layoutOptions:h,theme:g,...s,...r,...e,firstChildSize:b,isFocused:k,selectCell:I,variant:d,dragHandle:(0,m.jsx)(E.A,{...e,handlePlacement:"top","data-testid":"smart-layout-cell-drag-handle",label:(0,m.jsx)(eN.s,{direction:"column",align:"center",children:(0,m.jsx)(em.x6,{id:"YkfVHA",components:{0:(0,m.jsx)(z.E,{color:"gray.500"})}})})}),children:[(0,m.jsx)(u.$p,{style:{maxWidth:"100%",wordBreak:"break-word"}}),v&&y&&(0,m.jsx)(eN.s,{position:"absolute",..."bottom"===S?{bottom:-3,[C]:0,width:"100%",height:6,justify:"center"}:{[C]:-3,bottom:0,height:"100%",width:6,align:"center"},opacity:"0",transitionProperty:"opacity",transitionDuration:"normal",zIndex:"1",className:"add-button",children:(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(em.x6,{id:"NQ8llq"}),placement:"top",children:(0,m.jsx)(e9.K,{icon:(0,m.jsx)(j.g,{icon:ec.QLR}),"aria-label":ef.Ru._({id:"NQ8llq"}),position:"absolute",size:"xs",variant:"plain",isRound:!0,onClick:x,onMouseDown:e3.Fw})})}),_&&v&&(0,m.jsx)(my.Td,{removeBackground:_})]})})})},mx=r.bP.create({name:"smartLayoutCell",content:"(block | smartLayoutBlock)+",isolating:!0,selectable:!1,containerHandle:!0,imageKeyPath:"image",accessoryImageKey:"image",addAttributes:()=>({id:(0,sj.e)(mb.z),options:{default:{},...(0,Y.tb)("options")},width:{default:null},image:{default:null,...(0,Y.tb)("image")},label:{default:null,parseHTML:e=>e.getAttribute("label")||e.getAttribute("number")}}),parseHTML(){return[{tag:"div[class=layout-item]"},{tag:"item"},{tag:"div[image-bookmark]",context:"smartLayout/",getAttrs:e=>{let t=e.getAttribute("image-bookmark");if(!t)return!1;let l=(0,X.bi)(this.storage,t);return{...mS(e),image:l}}},{tag:"div",context:"smartLayout/",getAttrs:e=>mS(e)}]},renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,r.KV)(t,{class:"layout-item"}),0]},addStorage:X.xu,renderHTMLforAI(e){let{node:t}=e,{image:l,options:a,...n}=t.attrs,o={};Object.keys(a).forEach(e=>{o[e]="string"==typeof a[e]?a[e]:JSON.stringify(a[e])});let i={...n,...o};return l?["div",i,["img",{bookmark:(0,X.vL)(this.storage,l)}],["div",0]]:["div",i,0]},addNodeView:()=>(0,u.gu)(mw,{update:c.z0})}),mS=e=>{let t=e.dataset.image?JSON.parse(e.dataset.image):void 0,l=e.getAttribute("label")||e.getAttribute("number"),a=(0,mk.a)().find(t=>{var l,a;return t.htmlTag===(null===(l=e.parentElement)||void 0===l?void 0:l.tagName.toLowerCase())||t.key===(null===(a=e.parentElement)||void 0===a?void 0:a.tagName.toLowerCase())});return{image:t,label:l,options:((null==a?void 0:a.options.map(e=>e.key))||[]).reduce((t,l)=>{let a=e.getAttribute(l);if(a)try{t[l]=JSON.parse(a)}catch(e){t[l]=a}return t},{})}};var mA=l(94669),mC=l(13934);let mz=e=>{let{node:t}=e,{verticalAlign:l}=t.attrs;return(0,m.jsxs)(u.VR,{className:"grid-cell",style:{position:"relative",justifyContent:l},"data-selection-ring":!0,children:[(0,m.jsx)(E.A,{handlePlacement:"top",...e,"data-testid":"column-drag-handle",label:(0,m.jsx)(eN.s,{direction:"column",align:"center",children:(0,m.jsx)(em.x6,{id:"zWdF4l",components:{0:(0,m.jsx)(z.E,{color:"gray.500"})}})})}),(0,m.jsx)(u.$p,{})]})},mI=r.bP.create({name:"gridCell",content:"(block | layoutBlock)+",definingAsContext:!0,isolating:!0,selectable:!1,containerHandle:!0,parseHTML:()=>[{tag:"div[class=column]"},{tag:"div",context:"gridLayout/"}],addAttributes:()=>({verticalAlign:null}),renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,r.KV)(t,{class:"column"}),0]},addNodeView:()=>(0,u.gu)(mz,{update:c.z0})});var mj=l(12443),mF=l(20265),mB=l(93090);class mR{constructor(e=null){this.dragging=e}}let m_=new V.hs("layoutPlugin"),mM=e=>new V.k_({key:m_,state:{init:()=>new mR,apply:(e,t)=>t},appendTransaction:(e,t,l)=>{if(!e.some(e=>e.docChanged))return null;let a=e.find(e=>e.selectionSet),n=l.tr;if(l.doc.descendants((e,t)=>{if("gridLayout"===e.type.name&&1==e.childCount){let l=n.mapping.map(t);n.replaceWith(l,n.mapping.map(t+e.nodeSize),e.child(0).content).setMeta("annotationEvent",{type:"unwrap-node",pos:l})}}),!n.docChanged)return null;if(a){let e=a.selection.$from.depth-n.selection.$from.depth,t=(0,iU.n)(n.doc.resolve(a.selection.from-e));t&&n.setSelection(t)}return n},props:{handleDOMEvents:{drop(t,l){var a,n,o;let i=null===(a=t.dragging)||void 0===a?void 0:a.annotations;if(!m_.getState(t.state))return!1;let r=null===(n=t.dragging)||void 0===n?void 0:n.slice,s=null,d=null,u=(0,mB.p$)(l).filter(mB.KS);try{d=(0,u7.Vk)(t,l,r),s=(0,u9.ds)(t,l,r)}catch(e){return!1}try{let{selection:a}=t.state,n=!a.empty,c=null==r?void 0:r.content.toJSON(),m=[];if(u.length>0&&(c=(m=(0,mF.kT)(e,u)).map(e=>e.content)),!c)return!1;if((null==s?void 0:s.node.type.name)==="gridCell"){let{node:t,pos:a,side:r}=s,d="left"===r?a:a+t.nodeSize,u=(null===(o=c[0])||void 0===o?void 0:o.type)!=="gridCell",f=u?{type:"gridCell",content:c}:c;return e.chain().insertContentAt({from:d,to:d},f,{updateSelection:!1}).command(e=>{let{tr:t}=e;return n&&t.deleteSelection(),i&&t.setMeta("annotationEvent",{type:"drop",dragging:i,droppedBlockPos:d+(u?1:0)}),!0}).focusMapped(d,1).run(),m.length>0&&m.forEach(e=>{e.upload()}),l.preventDefault(),!0}if(!d&&!s)return;let{node:f,pos:p,side:g}=d||s;if(p>a.from&&p{let{tr:a}=l;if(n&&a.deleteSelection(),i){let l="left"===g&&r?r.size:f.nodeSize,n=(0,iq.U5)({side:g,view:t,tr:a,dragging:i,dropPos:p,dropNode:f,leftContentSize:l});requestAnimationFrame(()=>{var t,l;null===(t=(l=e.commands).moveAnnotations)||void 0===t||t.call(l,n)})}return!0}).focusMapped(p,y).run(),m.length>0&&m.forEach(e=>{e.upload()})}catch(e){console.error("(caught) [LayoutPlugin] handleDrop error:",e)}return l.preventDefault(),!0}}}}),mE=new V.hs("layoutResizing");class mT{getActiveHandleAbs(e){return this.activeHandle?(0,rM.d_)(e,this.activeHandle):null}reset(){return this.activeHandle=null,this.dragging=null,this}setHandle(e,t){return null===t.setHandle?this.activeHandle=null:this.activeHandle=(0,rM.JO)(e,t.setHandle),this}setDragging(e){return this.dragging=e.setDragging,this}apply(e,t){let l=e.getMeta(mE);return l&&"setHandle"in l?this.setHandle(t,l):l&&"setDragging"in l?this.setDragging(l):l&&"reset"in l?this.reset():this}constructor(e=null,t=null){this.activeHandle=e,this.dragging=t}}let mO=e=>mE.getState(e.state),mP=(e,t)=>{e.dispatch(e.state.tr.setMeta(mE,{setHandle:t}))},mN=(e,t)=>{e.dispatch(e.state.tr.setMeta(mE,{setDragging:t}))},mD=e=>{e.dispatch(e.state.tr.setMeta(mE,{reset:!0}))},mL=(e,t)=>{if(!e.editable||!t.target||t.target.closest(".column-resize-handle"))return;let l=mO(e);if(l.dragging)return;let a=function(e,t){var l;let a=e.posAtCoords({left:t.clientX,top:t.clientY});if(!a||-1===a.inside)return null;let n=e.domAtPos(a.inside);if(!n)return null;let o=n.node.childNodes[n.offset];if(!o)return null;let i=e.state.doc.resolve(a.inside);if((null===(l=i.nodeAfter)||void 0===l?void 0:l.type.name)!=="gridCell")return null;let{left:r,right:s}=o.getBoundingClientRect();if(t.clientX-r<=5){let t=e.state.doc.resolve(i.before(i.depth)),l=mW((0,u9.Ob)(t),e=>e.pos===i.pos);return(null==l?void 0:l.pos)||null}return s-t.clientX<=5?i.pos:null}(e,t);a!==l.getActiveHandleAbs(e.state)&&mP(e,a)},mW=(e,t)=>{for(let l=0;l{let l=e.domAtPos(t);return l.node.childNodes[l.offset].offsetWidth},mG=(e,t)=>{let{node:l,offset:a}=e.domAtPos(t.start()),n=l.childNodes[a];do if(n&&n.classList&&n.classList.contains("node-gridLayout"))break;while(n=n.parentNode);return n},mH=e=>{let{getPos:t,updateAttributes:l,editor:a,node:n}=e,o=a.state.doc.resolve(t()),i=(0,u9.Ob)(o);(0,F.useEffect)(()=>{i.length!==n.attrs.colWidths.length&&setTimeout(()=>{l({colWidths:(0,rN.I)(i.length)})},0)},[n,i,l])},mV=e=>{let{node:t,editor:l,getPos:a}=e,n=t.content.childCount,o=(0,J.GV)(es.Cl),i=(0,nN.FX)();mH(e);let r=n%2==0,s=Math.min((0,d9.h5)({base:1,sm:r?2:1,md:r?2:3,lg:4})||4,n),d=(0,F.useCallback)(()=>{l.commands.addLayoutCell(a())},[l,a]),c=n"".concat(e,"%")).join(" ");return(0,m.jsx)(p.u,{...e,children:(0,m.jsxs)(tf.r,{className:(0,I.cx)("grid-col-controls",o&&"is-editable"),columns:s,gap:"var(--grid-border)",position:"relative",gridTemplateColumns:f,"data-selection-ring":!0,children:[(0,m.jsx)(u.$p,{className:"layout-content"}),(0,m.jsx)(E.A,{...e,label:ef.Ru._({id:"Szg6OU"}),"data-testid":"layout-drag-handle"}),(0,m.jsx)(eN.s,{position:"absolute",top:"0",h:"100%",align:"center",w:6,insetInlineEnd:-3,className:"add-column",opacity:"0",transitionProperty:"opacity",transitionDuration:"normal",children:c&&(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(em.x6,{id:"AgvHni"}),placement:"top",children:(0,m.jsx)(e9.K,{icon:(0,m.jsx)(j.g,{icon:ec.QLR}),"aria-label":ef.Ru._({id:"AgvHni"}),position:"absolute",size:"xs",variant:"plain",isRound:!0,zIndex:"1",onClick:d})})})]})})},mq=r.bP.create({name:"gridLayout",content:"gridCell{1, ".concat(mC.Z,"}"),group:"cardBlock",defining:!1,isolating:!0,selectable:!1,priority:Z.y.Layout,containerHandle:!0,parseHTML:()=>[{tag:"div[class=columns]"},{tag:"columns"}],renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,r.KV)(t,{class:"columns"}),0]},renderHTMLforAI(e){let{node:t}=e;return["columns",{colWidths:JSON.stringify(t.attrs.colWidths)},0]},addAttributes(){let e="colWidths";return{colWidths:{default:[],parseHTML:t=>{let l=t.getAttribute("data-".concat(e));if(l)return JSON.parse(l);let a=0;return t.childNodes.forEach(e=>{"DIV"===e.nodeName&&a++}),(0,rN.I)(a)},renderHTML:t=>{let l=t[e];return l?{["data-".concat(e)]:JSON.stringify(l)}:{}}},fullWidthBlock:{default:!1}}},addNodeView:()=>(0,u.gu)(mV,{update:c.R$,ignoreMutation:mg.I}),addProseMirrorPlugins(){return[mM(this.editor),new V.k_({key:mE,state:{init:()=>new mT,apply:(e,t,l,a)=>t.apply(e,a)},props:{attributes:e=>null!==mE.getState(e).getActiveHandleAbs(e)?{class:"resize-cursor"}:{class:""},handleDOMEvents:{mousemove:(e,t)=>!!ej.of.get("layoutResizing")&&(mL(e,t),!1),mouseleave:e=>!!ej.of.get("layoutResizing")&&(!function(e){let t=mO(e);null===t.getActiveHandleAbs(e.state)||t.dragging||mP(e,null)}(e),!1),mousedown:(e,t)=>!!ej.of.get("layoutResizing")&&(!function(e,t){if(!e.editable)return;let l=mO(e),a=l.getActiveHandleAbs(e.state);if(null===a||l.dragging)return;let n=e.state.doc.resolve(a),o=[...n.node().attrs.colWidths],i=(0,u9.xK)(n),r=mU(e,a),s=mG(e,n),d=s.offsetWidth;mN(e,{startX:t.clientX,startWidth:r,colWidths:o,tableWidth:d,colIndex:i});let u=null;function c(t){window.removeEventListener("mouseup",c),window.removeEventListener("mousemove",m);let l=mO(e);if(l.dragging){if(null===u){mN(e,null);return}if(l.dragging)try{let t=l.getActiveHandleAbs(e.state);(function(e,t,l){let a=e.state.doc.resolve(t).before(),n=e.state.tr.setNodeMarkup(a,void 0,{colWidths:[...l]}).setMeta("annotationEvent",{type:"update-node-attrs",pos:a});e.dispatch(n),function(e,t){let l=e.state.doc.resolve(t),a=mG(e,l).querySelector(".grid-col-controls");a&&(a.style.gridTemplateColumns="")}(e,t)})(e,t,u),mN(e,null)}catch(t){mD(e)}u=null}}function m(t){if(!t.which)return c(t);let l=mO(e),a=l.getActiveHandleAbs(e.state);if(!l.dragging||null===a)return;let{colIndex:n,colWidths:o}=l.dragging,i=function(e,t){let{tableWidth:l}=e,a=t.clientX-e.startX;return rP()(100*a/l,0)}(l.dragging,t);(function(e,t){let l=e.querySelector(".grid-col-controls");l&&(l.style.gridTemplateColumns=t.map(e=>"".concat(e,"%")).join(" "))})(s,u=(0,rN.H0)(o,n,i,15)),(0,rD.i$)(s)}window.addEventListener("mouseup",c),window.addEventListener("mousemove",m),t.preventDefault()}(e,t),!1)},decorations(e){let t=mE.getState(e).getActiveHandleAbs(e);if(null!==t){let l=[];try{let a=document.createElement("div");return a.className="column-resize-handle",l.push(r_.NZ.widget(t+1,a)),r_.zF.create(e.doc,l)}catch(e){return console.error("(caught) layoutResizing error: ".concat(e.message)),r_.zF.empty}}},nodeViews:{}}})]},addCommands(){var e=this;return{useLayoutPreset:(e,t)=>l=>{let{dispatch:a,tr:n,commands:o,view:i}=l;if(!a)return!0;let s=(0,u9.DF)(n.doc.resolve(e));if(!s)return!0;let d=(0,u9.Ob)(s),u=t.length-d.length,c=[];for(;0!==u;){if(u<0){let t=(0,u9.nX)(n.doc.resolve(e),-1),l=t.nodeAfter;n.deleteRange(t.pos,t.pos+l.nodeSize),c=[...1===l.childCount&&(0,r.Op)(l.firstChild)?[]:l.content.toJSON(),...c],u++;continue}if(u>0){o.addLayoutCell(s.pos,!1),u--;continue}}n.setNodeAttribute(e,"colWidths",t);let m=(0,u9.nX)(n.doc.resolve(s.pos),-1);if(!m||!m.nodeAfter)return!0;let f=m.pos+m.nodeAfter.nodeSize-1;if(o.insertContentAt(f,c,{updateSelection:!1}),n.selection.from>f||n.selection.to>f){let e=n.doc.resolve(m.pos+1).end(),t=(0,iU.n)(n.doc.resolve(e),-1);t&&n.setSelection(t)}let p=mG(i,s);return p&&(0,rD.i$)(p),!0},insertLayout:e=>t=>{let{dispatch:l,commands:a}=t;if(!l)return!0;let n=Array.from(Array(e),e=>mK);return a.insertContentAndSelect({type:"gridLayout",attrs:{colWidths:(0,rN.I)(e)},content:n})},addLayoutCell:function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return l=>{let{chain:a,state:n}=l,o=n.doc.nodeAt(e);if(!o||o.type.name!==mq.name)return!1;let i=e+o.nodeSize-1,{colWidths:r}=o.attrs,s=r.length,d=rP()(100/(s+1),2),u=(0,rN.KJ)(r,s,d,15),c=a().insertContentAt(i,mK,{updateSelection:!1});return t&&c.selectInsertedNode(),c.command(t=>{let{tr:l}=t;return l.setNodeAttribute(e,"colWidths",u),!0}).run(),!0}},handleLayoutDelete:function(t){let l=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return a=>{let{tr:n,dispatch:o,state:i}=a;if(!o)return!0;let s=(0,r.KP)(e=>e.type.name===mI.name)(i.selection),d=(0,r.KP)(e=>e.type.name===mq.name)(i.selection);if(!s||!d)return!1;if(!l||(0,Y.mf)(s.node)){if(2==d.node.childCount){let t=s.node===d.node.child(0),l=t?d.node.child(1):d.node.child(0),a=t?d.start+d.node.child(0).nodeSize+1:d.start+1,o=a+l.content.size;n.replaceWith(d.pos,d.pos+d.node.nodeSize,l.content);let i=(0,iU.n)(n.doc.resolve(d.pos+(t?0:l.content.size)),t?1:-1);i&&n.setSelection(i);let r=(0,iq.es)({insertPos:d.pos,contentPos:a,contentEnd:o,editor:e.editor});requestAnimationFrame(()=>{var t,l;null===(t=(l=e.editor.commands).moveAnnotations)||void 0===t||t.call(l,r)})}else{let e=n.doc.resolve(s.pos);(0,mA.K)(n,e,t),n.setNodeAttribute(d.pos,"colWidths",(0,rN.XC)(d.node.attrs.colWidths,[(0,u9.xK)(e)]))}return!0}let{parent:u}=i.selection.$from;return!!(i.selection.empty&&u.isTextblock&&(0,r.Op)(u))&&u==s.node.firstChild&&!t&&(n.deleteRange(i.selection.$from.before(),i.selection.$from.after()),!0)}},goToNextLayoutCell:e=>t=>{let{tr:l,state:a}=t,n=(0,r.KP)(e=>e.type.name===mI.name||e.type.name===mx.name)(a.selection),o=(0,r.KP)(e=>e.type.name===mq.name||e.type.name===mh.o.name)(a.selection);if(!n||!o)return!1;let i=a.doc.resolve(n.pos),s=e?i.index()+1:i.index()-1;if(s<0||s>=i.parent.childCount)return!1;let d=i.posAtIndex(s);return l.setSelection(V.LN.near(a.doc.resolve(d))),!0}}},addKeyboardShortcuts:()=>({Tab:e=>{let{editor:t}=e;return t.commands.goToNextLayoutCell(!0)},"Shift-Tab":e=>{let{editor:t}=e;return t.commands.goToNextLayoutCell(!1)}})}),mK={type:"gridCell",content:[{type:"paragraph"}]};var mJ=l(37672);let m$=e=>{let{node:t,decorations:l}=e,{fontSize:a,placeholder:n}=t.attrs;return(0,m.jsx)(p.u,{dir:(0,n9.fZ)(l),...e,children:(0,m.jsx)(u.$p,{as:"li","data-testid":"bullet-list-item","data-font-size":a,"data-placeholder":n})})};var mQ=l(33795),mY=l(60443);let mX=/^\s*([-*])\s$/,mZ=r.bP.create({name:mY.e.Bullet,content:"inline*",defining:!0,group:"block cardNotesBlock",selectable:!1,allowFontSizes:"body",addNodeView:()=>(0,u.gu)(m$,{as:"ul",update:c.z0,updateWrapperEl:(e,t)=>{e.setAttribute("indent",t.node.attrs.indent)}}),addOptions:()=>({HTMLAttributes:{}}),addAttributes:()=>({indent:{default:0},fontSize:ck.mD}),addInputRules(){return[(0,mQ.aW)({find:mX,type:this.type},this.editor.state.schema)]},addKeyboardShortcuts:()=>({"Mod-Shift-8":e=>{let{editor:t}=e;return t.commands.setListItems({variant:mY.e.Bullet})},"Mod-.":e=>{let{editor:t}=e;return t.commands.setListItems({variant:mY.e.Bullet})}}),parseHTML(){return[{tag:'li[variant="'.concat(this.name,'"]')}]},renderHTML(e){let{HTMLAttributes:t}=e;return["li",(0,r.KV)(this.options.HTMLAttributes,t,{variant:this.name}),0]}}),m0=[e=>e.toString(),e=>String.fromCharCode(96+e),e=>(function(e){let t={M:1e3,CM:900,D:500,CD:400,C:100,XC:90,L:50,XL:40,X:10,IX:9,V:5,IV:4,I:1},l="";for(let a of Object.keys(t)){let n=Math.floor(e/t[a]);e-=n*t[a],l+=a.repeat(n)}return l})(e).toLowerCase()],m1=e=>{var t;let{decorations:l,node:a}=e,{indent:n,fontSize:o,placeholder:i}=a.attrs,r=null===(t=l.find(e=>e.spec.listNumber))||void 0===t?void 0:t.spec.listNumber,s=(m0[n%m0.length]||m0[0])(r);return(0,m.jsx)(p.u,{dir:(0,n9.fZ)(l),...e,children:(0,m.jsx)(u.$p,{as:"li","data-list-counter":s,"data-font-size":o,"data-placeholder":i})})},m2=/^(\d+)\.\s$/,m6=r.bP.create({name:mY.e.Numbered,content:"inline*",defining:!0,group:"block cardNotesBlock",selectable:!1,allowFontSizes:"body",addOptions:()=>({HTMLAttributes:{}}),addNodeView:()=>(0,u.gu)(m1,{as:"ol",update:c.z0,updateWrapperEl:(e,t)=>{e.setAttribute("indent",t.node.attrs.indent)}}),addAttributes:()=>({indent:{default:0},fontSize:ck.mD}),addInputRules(){return[(0,mQ.aW)({find:m2,type:this.type},this.editor.state.schema)]},addKeyboardShortcuts:()=>({"Mod-/":e=>{let{editor:t}=e;return t.commands.setListItems({variant:mY.e.Numbered})},"Mod-Shift-7":e=>{let{editor:t}=e;return t.commands.setListItems({variant:mY.e.Numbered})}}),parseHTML(){return[{tag:'li[variant="'.concat(this.name,'"]')}]},renderHTML(e){let{HTMLAttributes:t}=e;return["li",(0,r.KV)(this.options.HTMLAttributes,t,{variant:this.name}),0]}});var m4=l(88865);let m5=e=>{let{decorations:t,node:l,updateAttributes:a}=e,n=(0,J.GV)(es.Jo),o=(0,ac.Iy)("edit",n),{checked:i,fontSize:r,placeholder:s}=l.attrs;return(0,m.jsx)(p.u,{dir:(0,n9.fZ)(t),...e,children:(0,m.jsxs)(z.E,{as:"li",color:i?"var(--body-color-muted)":void 0,textDecoration:i?"line-through":void 0,transition:"color 250ms ease-out",position:"relative",className:"todo","data-font-size":r,children:[(0,m.jsx)(m4.S,{contentEditable:!1,suppressContentEditableWarning:!0,isChecked:i,onChange:e=>{o&&a({checked:e.target.checked})},position:"absolute"}),(0,m.jsx)(u.$p,{as:"span",className:"todo-content","data-placeholder":s})]})})},m3=/^\s*\[[ ]?\]\s$/,m8=/^\s*\[x\]\s$/,m7=r.bP.create({name:mY.e.Todo,addOptions:()=>({HTMLAttributes:{}}),content:"inline*",defining:!0,group:"block cardNotesBlock",selectable:!1,allowFontSizes:"body",addAttributes:()=>({indent:{default:0},checked:{default:!1},fontSize:ck.mD}),addNodeView:()=>(0,u.gu)(m5,{as:"ul",update:c.z0,updateWrapperEl:(e,t)=>{e.setAttribute("indent",t.node.attrs.indent)}}),addInputRules(){return[(0,mQ.aW)({find:m3,type:this.type,getAttributes:{checked:!1}},this.editor.state.schema),(0,mQ.aW)({find:m8,type:this.type,getAttributes:{checked:!0}},this.editor.state.schema)]},addKeyboardShortcuts:()=>({"Mod-,":e=>{let{editor:t}=e;return t.commands.setListItems({variant:mY.e.Todo})},"Mod-Shift-9":e=>{let{editor:t}=e;return t.commands.setListItems({variant:mY.e.Todo})}}),parseHTML(){return[{tag:'li[variant="'.concat(this.name,'"]')}]},renderHTML(e){let{HTMLAttributes:t}=e;return["li",(0,r.KV)(this.options.HTMLAttributes,t,{variant:this.name}),0]}});var m9=l(74327),fe=l(66712);let ft=(0,F.forwardRef)((e,t)=>{let{dimensions:l,enforceMinDimensions:a,isThumbnail:n,isLoading:o,children:i,...r}=e,s=(0,ej.u)("enableVirtualization"),d=(0,o6.rd)();if(!s)return(0,m.jsx)(m.Fragment,{children:i});let u=l?{width:"".concat(l.width,"px"),height:"".concat(l.height,"px")}:{};return(!0===o||a)&&(u.minHeight=u.height),void 0!==o&&(u.height=void 0,u.width=void 0),(0,m.jsxs)(eN.s,{backgroundColor:!1===o?"transparent":d?"whiteAlpha.200":"blackAlpha.200",ref:t,position:!1!==o?"relative":"static",transition:"background-color .2s",...u,...r,children:[i,!1!==o&&(0,m.jsx)(nk.y,{position:"absolute",top:"50%",insetStart:"50%",colorScheme:"gray",size:n?"xs":"md"})]})});ft.displayName="VirtualizedPlaceholder";var fl=l(98371);class fa{static observeElement(){for(var e=arguments.length,t=Array(e),l=0;l{}:fa.instance.doObserveElement(...t)}static get instance(){return fa._instance||(fa._instance=new fa),fa._instance}doObserveElement(e,t,l){let{rootMargin:a="0px 0px 0px 0px",root:n=null}=l,o=this.getObserverForRoot(n,a);return this.callbacksMap.has(o)||this.callbacksMap.set(o,new Map),this.callbacksMap.get(o).set(e,t),o.observe(e),()=>{this.disconnect(e,a,n)}}disconnect(e,t,l){var a,n;let o=this.getObserverForRoot(l,t,!0);if(!o)return;o.unobserve(e);let i=this.callbacksMap.get(o);i&&i.delete(e),(null==i||!i.size)&&(o.disconnect(),this.callbacksMap.delete(o),null===(a=this.intersectionObserversMap.get(l))||void 0===a||a.delete(t),(null===(n=this.intersectionObserversMap.get(l))||void 0===n?void 0:n.size)||this.intersectionObserversMap.delete(l))}getObserverForRoot(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!this.intersectionObserversMap.has(e)){if(l)return;this.intersectionObserversMap.set(e,new Map)}let a=this.intersectionObserversMap.get(e);if(!a.has(t)){if(l)return;a.set(t,new IntersectionObserver(this.intersectionCallback.bind(this),{root:e,rootMargin:t}))}return a.get(t)}intersectionCallback(e,t){let l=new Map,a=this.callbacksMap.get(t);a&&(e.forEach(e=>{l.has(e.target)||l.set(e.target,[]),l.get(e.target).push(e)}),l.forEach((e,t)=>{try{var l;null===(l=a.get(t))||void 0===l||l(e)}catch(e){console.error(e)}}))}constructor(){this.intersectionObserversMap=new Map,this.callbacksMap=new Map}}fa._instance=null;class fn{get stats(){let e={};return this.entries.forEach(t=>{var l;let{status:a}=t;e[a]=(null!==(l=e[a])&&void 0!==l?l:0)+1}),e}static get instance(){return fn._instance||(fn._instance=new fn),fn._instance}constructor(){this.entries=new Map,o.$.DEBUG_ENABLED&&"object"==typeof globalThis&&(globalThis.gammaInViewportStats=this)}}fn._instance=void 0;let fo=function(){var e,t,l;let{intersectionMargin:a="100% 0px 100% 0px",memoGroup:n,...o}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=(0,ej.u)("enableVirtualization"),r=(0,F.useId)(),s=(0,F.useRef)(),d=(0,F.useRef)(),u=i?o.dimensions?"HIDDEN":"PENDING":"VISIBLE",[c,m]=(0,F.useState)(u),f=(0,F.useRef)(c),[p,g]=(0,F.useState)(null!==(l=o.dimensions)&&void 0!==l?l:void 0),h=(0,F.useMemo)(()=>{let e=()=>{if("HIDDEN"===f.current&&s.current){let e=s.current.getBoundingClientRect();g({width:e.width,height:e.height})}m(f.current)},t=null;return function(l){let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;f.current=l,t&&(clearTimeout(t),t=null),t=setTimeout(()=>{t=null,e()},a)}},[]),b=null==o?void 0:o.loading,y=(e,t)=>{var l,n;if(!i){h("VISIBLE"),null===(l=d.current)||void 0===l||l.call(d);return}if(!e||b){null===(n=d.current)||void 0===n||n.call(d);return}let o=(0,fl.Hc)(e,t);d.current=fa.observeElement(e,e=>{var t;let l=null!==(t=f.current)&&void 0!==t?t:"PENDING",a=e.find(e=>e.isIntersecting);if("VISIBLE"!==l&&a){h("VISIBLE");return}"HIDDEN"===l||a||h("HIDDEN",1500)},{root:o,rootMargin:a})},v=(0,F.useCallback)(()=>{if(!s.current){var e;null===(e=d.current)||void 0===e||e.call(d);return}if(!o.loading){if(y(s.current,n),!o.dimensions&&!p){let e=s.current.getBoundingClientRect();g({width:e.width,height:e.height})}"PENDING"===f.current&&h("HIDDEN")}},[h,o.loading,null===(e=o.dimensions)||void 0===e?void 0:e.width,null===(t=o.dimensions)||void 0===t?void 0:t.height,null==p?void 0:p.width,null==p?void 0:p.height,n]),k=(0,F.useCallback)(e=>{s.current!==e&&(s.current=e,v())},[v]);return(0,F.useEffect)(()=>{var e;return fn.instance.entries.set(r,{status:c,el:null!==(e=s.current)&&void 0!==e?e:null}),()=>{fn.instance.entries.delete(r)}},[c,r]),{inViewport:"PENDING"===c?void 0:"VISIBLE"===c,ref:k,dimensions:p}},fi=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,J.GV)(es.OG),l=(0,J.GV)(es.$i),a=!1!==e.memoGroup&&(t?"".concat(e.memoGroup?"".concat(e.memoGroup,":"):"","presenting:").concat(l):void 0);return fo({...e,memoGroup:a})};var fr=l(66792);let fs=e=>{let{attrs:t,inGallery:l,shouldDisableClick:a}=e,n=(0,ee.lQ)(t),o=t.displayStyle,i=(0,ej.u)("linksV2"),r=(0,sf.oR)(),s=(0,ee.eb)(t,i&&"preview"===o&&!l),{handleOpenLinkWithInterstitial:d,handleOpenNativeLinkWithInterstitial:u,linkUrlSafe:c}=(0,fr.E)(n),m=i&&"newTab"===s&&!a;return(0,F.useMemo)(()=>m?{url:r?n:c,handleOpenLinkWithInterstitial:d,handleOpenNativeLinkWithInterstitial:u}:void 0,[d,u,c,n,m,r])};var fd=l(76304),fu=l(92712),fc=l(90286);let fm=e=>{let{enterZoom:t,zoomBoxProps:l,url:a,handleOpenLink:n,handleOpenInNewTab:o}=e,i=(0,J.GV)(es.nD);return nI.D1?null:!i&&n&&a?(0,m.jsx)(fu.Q,{inset:0,w:"100%",h:"100%",position:"absolute",zIndex:1,cursor:"pointer",children:(0,m.jsx)(fu.r,{onClick:n,href:a,target:"_blank",rel:"noopener"})}):(0,m.jsx)(fc.K,{enterZoom:t,doubleClickNonZoomHandler:i?o:void 0,...l})};var ff=l(4876);let fp={allowPopups:!1,noSandbox:!1,preventScroll:void 0},fg=e=>{let{initialUrl:t,frameRef:l,iframeOptions:a,backgroundColor:n="white",onLoad:o,...i}=e,{allowPopups:r,preventScroll:s,noSandbox:d}=a||fp;return(0,m.jsx)(eN.s,{w:"100%",h:"100%",direction:"column",background:n,...i,children:(0,m.jsx)("iframe",{ref:l,src:t,frameBorder:"0",width:"100%",height:"100%",allow:"encrypted-media; camera; microphone",allowFullScreen:!0,title:"Embedded app",sandbox:d?void 0:"allow-forms allow-scripts allow-same-origin allow-modals allow-pointer-lock ".concat(r?"allow-popups":""),scrolling:s?"no":void 0,style:{flex:1},onLoad:()=>{null==o||o()}})})},fh=(()=>{let e=e=>e.replace(/^https?:/,""),t=null,l=new Map,a={capture:!0,passive:!0},n=n=>{let o=e(n);l.delete(o),0===l.size&&t&&(window.removeEventListener("message",t,a),t=null)};return(o,i)=>{if(l.set(e(o),i),t)return()=>n(o);let r=Math.floor(519*Math.random());return t=t=>{if("https://if-cdn.com"===t.origin)try{let a=JSON.parse(t.data);if(!("context"in a))return;let n=Math.floor(519*Math.random());a.messageId=n,a.listenerId=r;let o=e(a.context);if(l.has(o)){l.get(o)(a);return}}catch(e){console.error(e)}},window.addEventListener("message",t,a),()=>n(o)}})();function fb(e){return!!e&&"if-cdn.com"===new URL(e).host}let fy=e=>{let[t,l]=(0,F.useState)(null),a="function"==typeof e,n={resizeSettled:!1,loadFired:!1,preloadStart:Number.NEGATIVE_INFINITY,loadStart:Number.NEGATIVE_INFINITY,triggered:!1},o=(0,F.useRef)({...n}),i=(0,F.useRef)(e),r=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],{preloadStart:t,loadStart:l,resizeSettled:a,loadFired:n,triggered:r}=o.current,s=performance.now()-t,d=performance.now()-l;if(!r&&(e||a&&n)){var u;console.debug("[embed] firing onLoad ".concat(d,"ms after frame load"),{preloadDelta:s,loadDelta:d}),o.current.triggered=!0,null===(u=i.current)||void 0===u||u.call(i);return}};return(0,F.useEffect)(()=>{i.current=e},[e]),(0,F.useEffect)(()=>{if(!a||!fb(t))return()=>{o.current={...n}};o.current.preloadStart=performance.now();let e=null,l=fh(t,e=>{e&&"object"==typeof e&&"height"in e&&i.push(e.height),s(i.length?200:1e3)}),i=[],s=t=>{e&&(clearTimeout(e),e=null),o.current.resizeSettled||(e=setTimeout(()=>{e=null,o.current.resizeSettled=!0,l(),r()},t))};return s(1e3),()=>{e&&(clearTimeout(e),e=null),l(),o.current={...n}}},[t,a]),{handlePreload:e=>(l(e),()=>{o.current.loadStart=performance.now(),o.current.loadFired=!0,r(!fb(e))})}},fv=e=>{let{html:t,onLoad:l,...a}=e,{handlePreload:n}=fy(l),o=(0,F.useRef)({frame:null,listener:null});return(0,m.jsx)(f.az,{position:"relative",role:"group",className:"html-embed-viewer","data-selection-ring":"inside","data-selection-background":!0,borderRadius:"var(--box-border-radius)",contentEditable:!1,dangerouslySetInnerHTML:{__html:t},ref:e=>{if(!e){o.current.frame&&o.current.listener&&o.current.frame.removeEventListener("load",o.current.listener),o.current={frame:null,listener:null};return}let t=null==e?void 0:e.getElementsByTagName("iframe");if((null==t?void 0:t.length)!==1){null==l||l();return}let a=t.item(0),i=a.src;if(a===o.current.frame)return;o.current.frame&&o.current.listener&&o.current.frame.removeEventListener("load",o.current.listener);let r=n(i);o.current={frame:a,listener:r},a.addEventListener("load",r)},...a})};var fk=l(20671);let fw=e=>{let{frameRef:t,node:l,isStealth:a=!1,isDark:n}=e,o=(0,ee.lQ)(l.attrs),{handleOpenLinkWithInterstitial:i}=(0,fr.E)(o);return(0,m.jsxs)(eN.s,{direction:"row",background:n?"gray.800":"gray.50",align:"center",borderBottom:"1px solid",borderColor:n?"gray.600":"gray.200",w:"100%",p:1,zIndex:2,position:a?"absolute":"relative",transitionProperty:"common",transitionDuration:"normal",opacity:a?0:1,_hover:{opacity:1},fontFamily:"var(--chakra-fonts-body)",children:[(0,m.jsx)(fk.p,{size:"xs",value:o,border:"0",noOfLines:1,color:n?"gray.200":"gray.600",pointerEvents:"none",readOnly:!0}),(0,m.jsxs)(ed.e,{size:"xs",spacing:1,variant:"ghost",colorScheme:"gray",ml:2,children:[(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(em.x6,{id:"HpK/8d"}),placement:"top",children:(0,m.jsx)(e9.K,{isRound:!0,"aria-label":ef.Ru._({id:"HpK/8d"}),icon:(0,m.jsx)(j.g,{icon:ec.yek}),onClick:()=>{if(!t.current)return;let e=t.current.src;t.current.src="about:blank",setTimeout(()=>{t.current&&(t.current.src=e)},50)}})}),(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(em.x6,{id:"Alx2/L"}),placement:"top",children:(0,m.jsx)(e9.K,{isRound:!0,"aria-label":ef.Ru._({id:"Alx2/L"}),icon:(0,m.jsx)(j.g,{icon:ec.vMs}),onClick:i})})]})]})};var fx=l(12116);let fS=e=>{let{isZoomed:t,useStealthNav:l,onLoad:a,opacity:n,...o}=e,{node:i}=o,r=(0,F.useRef)(null),{colorMode:s}=(0,ng.G6)(),d="dark"===s,u=(0,nN.FX)(),{url:c,proxy:f,source:p,embed:g}=i.attrs,h=(0,fx.B)(p),b=h.rewriteEmbedUrl&&c?h.rewriteEmbedUrl(c):c,y=f?(0,fx.l)(b):b||"about:blank",{isUntrusted:v}=(0,ff.i)(y);return h.preferHtml&&(null==g?void 0:g.html)?(0,m.jsx)(fv,{html:g.html,w:t?"100%":void 0,onClick:t?e3.dG:void 0,onLoad:a,opacity:n,...h.minWidth?{minW:"min(".concat(h.minWidth,", 100vw)"),left:"50%",transform:"translateX(-50%)"}:void 0}):v?(0,m.jsx)(eN.s,{h:"100%",w:"100%",align:"center",justify:"center",children:"unknown embed"}):(0,m.jsxs)(eN.s,{direction:"column",h:"100%",w:"100%",maxW:"var(--media-maxW)",maxH:"var(--media-maxH)",borderRadius:t?"lg":"var(--box-border-radius)",border:"1px solid",borderColor:d?"gray.600":"gray.200",overflow:"hidden",position:"relative","data-content-reference":!0,"data-selection-ring":"inside","data-selection-background":!0,className:(0,I.cx)("embed-viewer"),onClick:t?e3.dG:void 0,children:[(0,m.jsx)(fw,{...o,frameRef:r,isDark:d,isStealth:l}),!t&&(0,m.jsx)(fd.zA,{...o,frameRef:r}),(0,m.jsx)(fg,{initialUrl:y,frameRef:r,iframeOptions:h.iframeOptions,onLoad:a,css:{aspectRatio:u?"1 / 1.618":"1.618 / 1"},flex:"1"})]})};var fA=l(57750);let fC=(0,sZ.P)(f.az),fz=(0,sZ.P)(eN.s),fI=e=>{let{node:t,editor:l,decorations:a}=e,n=t.attrs,{source:i,embed:r,displayStyle:s,id:d,sourceUrl:u}=n,c=(0,fx.B)(i),{isZoomed:g,enterZoom:h,exitZoom:b}=(0,fd.RL)(d),y="inline"===s&&c.preferHtml&&(null==r?void 0:r.html),v=(0,ce.NZ)(e),k=(0,nN.FX)(),w=(0,J.GV)(es.nD),x=(0,eP.DM)(a)||!l.view.hasFocus(),S=(0,ej.u)("virtualizeEmbeds"),[A,C]=(0,F.useState)(!1),z=!o.$.GAMMA_PUPPETEER_SERVICE&&(y||"inline"===s)&&!v&&!(k&&c.forcePreviewOnMobile),{handleOpenLinkWithInterstitial:j,handleOpenNativeLinkWithInterstitial:B,url:R}=fs({attrs:n,inGallery:v,shouldDisableClick:!!(c.inlineInteractive&&z)})||{},_=!v&&!l.isThumbnail,{inViewport:M,ref:E,dimensions:T}=fi();return S&&z&&!l.isThumbnail&&"embed.gdrive"!==c.key&&!1===M?(!0===A&&C(!1),(0,m.jsx)(p.u,{...e,as:"div",children:(0,m.jsx)(ft,{ref:E,dimensions:T})})):(0,m.jsxs)(p.u,{...e,children:[(0,m.jsxs)(fC,{h:"100%",w:"calc(100% * var(--media-scale))",className:(0,I.cx)("embed-preview",!y&&!(c.inlineInteractive&&z)&&eb.Gx),"data-export-as-image":!0,"data-export-link":u,position:"relative",overflow:y&&c.minWidth?"visible":"hidden","data-drag-handle":!0,ref:E,children:[z&&l.isThumbnail?(0,m.jsx)(fA.a6,{...e}):v?(0,m.jsx)(fA.x6,{...e}):z?(0,m.jsx)(ft,{isLoading:!A,dimensions:T,enforceMinDimensions:"embed.twitter"===c.key,flexDir:"column",children:(0,m.jsx)(fS,{...e,opacity:A?1:0,onLoad:()=>{C(!0)},useStealthNav:!0})}):(0,m.jsx)(fA.Ch,{...e}),c.inlineInteractive&&!k&&z?(0,m.jsx)(f.az,{position:"absolute",inset:0,zIndex:1,pointerEvents:w&&!x&&"inline"===s?"auto":"none",cursor:"default"}):c.inlineInteractive&&k&&z?(0,m.jsx)(m.Fragment,{}):(0,m.jsx)(fm,{enterZoom:h,handleOpenLink:B,handleOpenInNewTab:j,url:R})]}),_&&(0,m.jsx)(fd.Gx,{isZoomed:g,exitZoom:b,editor:l,children:(0,m.jsx)(fz,{h:"100%",w:"100%",direction:"column",justify:"center",align:"center",children:(0,m.jsx)(fS,{...e,onLoad:()=>{C(!0)},isZoomed:!0})})})]})},fj=r.bP.create({name:"embed",group:"block media",atom:!0,draggable:!0,selectable:!0,expandable:!0,addNodeView:()=>(0,u.gu)(fI,{update:c.z0}),addAttributes:()=>({id:(0,sj.e)(mb.z),url:{},source:{default:m9.Jp.key},thumbnail:{...(0,Y.tb)("thumbnail")},embed:{...(0,Y.tb)("embed")},meta:{...(0,Y.tb)("meta")},proxy:{},sourceUrl:{},displayStyle:{default:"preview"},fullWidthBlock:{default:!1},clickBehavior:{default:null}}),parseHTML(){return[{tag:"div[class=embed]"},{tag:"iframe[bookmark]",getAttrs:(0,X.Ll)(this.storage)}]},renderHTML(e){let{HTMLAttributes:t,node:l}=e;return["div",(0,r.KV)(t,{class:"embed"}),["a",{href:(0,ee.lQ)(l),target:"_blank"},(0,ee.JY)(l)]]},addStorage:X.xu,renderHTMLforAI(e){let{node:t}=e;return["iframe",{bookmark:(0,X.vL)(this.storage,t)}]},addCommands:()=>({replaceEmbedsById:(e,t)=>l=>{let{editor:a,chain:n}=l,o=(0,r.xe)(a.state.doc,t=>"embed"===t.type.name&&t.attrs.id===e),i=n();return o.forEach(e=>{let{pos:l,node:a}=e;i.insertContentAt({from:l,to:l+a.nodeSize},t,{updateSelection:!1})}),i.run(),!0},updateEmbedsById:(e,t)=>l=>{let{editor:a,chain:n}=l,o=(0,r.xe)(a.state.doc,t=>("embed"===t.type.name||"video"===t.type.name)&&t.attrs.id===e),i=n();return o.forEach(e=>{let{pos:l}=e;i.updateAttributesAtPos(l,{thumbnail:t.thumbnail})}),i.run(),!0},insertEmbedAndFetchMetadata:function(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return a=>{let{commands:n,editor:o}=a,i=(0,mb.z)();n.insertContent({type:"embed",attrs:{id:i,url:e,sourceUrl:e,displayStyle:null!=t?t:"preview",meta:{title:"Loading..."}}},{updateSelection:!1});let r=!1;return(0,fe.Yq)(e,e=>{if(r){o.commands.updateEmbedsById(i,e);return}let l=t3.Fn[e.source];o.commands.replaceEmbedsById(i,{type:(null==l?void 0:l.nodeName)||"embed",attrs:{...e,id:i,displayStyle:null!=t?t:"video"===l.nodeName?"inline":"preview"}}),r=!0}).catch(t=>{console.warn("(caught) insertEmbedAndFetchMetadata error fetching url",t,e),l&&o.commands.replaceEmbedsById(i,e)}),!0}}})});var fF=l(69951);let fB="gallery-prevent-flex";class fR{constructor(e=null){this.dragging=e}}let f_=new V.hs("galleryPlugin"),fM=e=>new V.k_({key:f_,state:{init:()=>new fR,apply:(e,t)=>t},props:{handleDOMEvents:{drop(e){var t;let l=null===(t=e.dragging)||void 0===t?void 0:t.annotations,a=f_.getState(e.state);if(!a)return!1;a.dragging=l}},decorations:e=>{let{doc:t}=e,l=[];return t.descendants((e,t,a)=>{if((0,ce.Pb)(e))l.push(r_.NZ.node(t,t+e.nodeSize,{class:"gallery-layout-".concat(e.attrs.layout)},{children:e.content}));else if((0,ce.Pb)(a)){var n;let o="image"===e.type.name&&(null===(n=e.attrs.resize)||void 0===n?void 0:n.clipType)==="circle";l.push(r_.NZ.node(t,t+e.nodeSize,{class:o?fB:""},{inGallery:!0,layout:a.attrs.layout,dimensions:a.attrs.dimensions,thumbHeight:a.attrs.thumbHeight,thumbSpacing:a.attrs.thumbSpacing}))}}),r_.zF.create(t,l)},handlePaste:(e,t,l)=>{let{selection:a,schema:n}=e.state;if(!(a instanceof V.nh&&(0,ce.Pb)(a.node)))return!1;if((0,ce.jG)(n,l,t)){let t=e.state.tr.setSelection(V.U3.create(e.state.doc,a.to-1));e.dispatch(t)}return!1},handleDrop:(t,l,a)=>{let n;let o=f_.getState(t.state),i=null==o?void 0:o.dragging;o&&(o.dragging=null);try{if(!(n=(0,ce.tz)(t,l,a,!1)))return!1}catch(e){return console.error("(caught) [GalleryPlugin] handleDrop checkGalleryDropTarget error:",e),!1}try{let{selection:l}=t.state,o=!l.empty,r=a.content.toJSON(),{pos:s,side:d,node:u}=n;if(u&&(0,ce.Pb)(u)){let t="left"===d?s:s+1;e.chain().insertContentAt({from:t,to:t},r,{updateSelection:!1}).command(l=>{let{tr:a}=l;if(o&&a.deleteSelection(),i){let l=e.state.tr;l.deleteSelection(),a.setMeta("annotationEvent",{type:"drop",dragging:i,droppedBlockPos:l.mapping.map(t)})}return!0}).focusMapped(t).run()}else if(u&&(0,ee.Bv)(u)){let l="left"===d?[...r,u.toJSON()]:[u.toJSON(),...r];e.chain().insertContentAt({from:s,to:s+u.nodeSize},{type:"gallery",content:l},{updateSelection:!1}).command(l=>{let{tr:a}=l;if(o&&a.deleteSelection(),i){let l=(0,iq.Q4)({side:d,view:t,tr:a,dragging:i,dropPos:s,dropNode:u});requestAnimationFrame(()=>{var t,a;null===(t=(a=e.commands).moveAnnotations)||void 0===t||t.call(a,l)})}return!0}).run()}}catch(e){console.error("(caught) [GalleryPlugin] handleDrop error:",e)}return!0}}});var fE=l(83380),fT=l(74801),fO=l(47572),fP=l(56436);let fN=e=>e&&m9.Dc[e]?m9.Dc[e]:m9.GQ,fD=16/9,fL=e=>{let{isZoomed:t,onLoad:l,opacity:a,position:n="relative",...o}=e,{node:i}=o,{embed:r,source:s,sourceUrl:d}=i.attrs,u=fN(s),c=(0,F.useRef)(null),p=u.preferHtml&&(null==r?void 0:r.html),g=(null==r?void 0:r.height)&&!(null==r?void 0:r.width),h=(null==r?void 0:r.height)&&(null==r?void 0:r.width)?r.width/r.height:(null==r?void 0:r.aspectRatio)||fD,b=t?{width:"min(var(--media-maxW), calc(var(--media-maxH) * ".concat(h,"))"),height:"video.tiktok"===s?void 0:g?r.height:"min(var(--media-maxH), calc(var(--media-maxW) / ".concat(h,"))"),alignContent:"center"}:p?{width:"100%"}:g?{height:r.height}:{height:0,pb:"".concat(100/h,"%")},y=(null==r?void 0:r.url)||i.attrs.embedUrl||d,v=u&&u.rewriteEmbedUrl&&y?u.rewriteEmbedUrl(y):y;return(0,m.jsxs)(f.az,{position:n,opacity:a,"data-content-reference":!0,"data-drag-handle":!0,...b,onClick:t?e3.dG:void 0,transition:"opacity .2s",children:[!t&&(0,m.jsx)(fd.zA,{...o,frameRef:c}),p?(0,m.jsx)(fv,{html:r.html,w:t?"100%":void 0,onClick:t?e3.dG:void 0,onLoad:l,...u.minWidth?{minW:"min(".concat(u.minWidth,", 100vw)"),left:"50%",transform:"translateX(-50%)"}:void 0,maxW:u.maxWidth}):(0,m.jsx)(fg,{initialUrl:v,backgroundColor:"none",borderRadius:"var(--box-border-radius)",overflow:"hidden","data-content-reference":!0,"data-selection-ring":"inside","data-selection-background":!0,className:(0,I.cx)("video-player"),onLoad:l,iframeOptions:{preventScroll:!0,...u.iframeOptions},position:"absolute",inset:0,frameRef:c})]})},fW=e=>{let{node:t,editor:l}=e,a=t.attrs,{source:n,embed:i,displayStyle:r,id:s,sourceUrl:d}=a,{isZoomed:u,enterZoom:c,exitZoom:g}=(0,fd.RL)(s),h=(0,ce.NZ)(e),b=(0,fx.B)(n),y=(0,ej.u)("virtualizeEmbeds"),[v,k]=(0,F.useState)(!1),w=!o.$.GAMMA_PUPPETEER_SERVICE&&"inline"===r,x="inline"===r&&b.preferHtml&&(null==i?void 0:i.html),S=!h&&!l.isThumbnail,{handleOpenLinkWithInterstitial:A,handleOpenNativeLinkWithInterstitial:C,url:z}=fs({attrs:a,inGallery:h,shouldDisableClick:w&&!h})||{},{inViewport:j,ref:B,dimensions:R}=fi();return y&&w&&!1===j&&!l.isThumbnail?(!0===v&&k(!1),(0,m.jsx)(p.u,{...e,as:"div",children:(0,m.jsx)(ft,{ref:B,dimensions:R})})):(0,m.jsxs)(p.u,{...e,as:"div",children:[(0,m.jsx)(f.az,{h:"100%",w:"calc(100% * var(--media-scale))",className:(0,I.cx)("embed-preview",!w&&eb.Gx),"data-export-as-image":!0,"data-export-link":d,position:"relative",overflow:x&&b.minWidth?"visible":"hidden",ref:B,children:l.isThumbnail?(0,m.jsx)(fA.a6,{...e}):h?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(fm,{enterZoom:c,url:z,handleOpenLink:C,handleOpenInNewTab:A}),(0,m.jsx)(fA.x6,{...e})]}):w?(0,m.jsx)(ft,{isLoading:!v,dimensions:R,children:(0,m.jsx)(fL,{opacity:v?1:0,position:"static",onLoad:()=>{k(!0)},...e})}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(fm,{enterZoom:c,url:z,handleOpenLink:C,handleOpenInNewTab:A}),(0,m.jsx)(fA.Ch,{...e})]})}),S&&(0,m.jsx)(fd.Gx,{isZoomed:u,exitZoom:g,editor:l,children:(0,m.jsx)(eN.s,{width:"var(--media-maxW)",height:"var(--media-maxH)",direction:"column",align:"center",justify:"center",children:(0,m.jsx)(fL,{onLoad:()=>{k(!0)},...e,isZoomed:!0})})})]})},fU=r.bP.create({name:"video",group:"block media",atom:!0,draggable:!0,selectable:!0,expandable:!0,addNodeView:()=>(0,u.gu)(fW,{update:c.z0}),addAttributes:()=>({id:(0,sj.e)(mb.z),embedUrl:{},source:{},thumbnail:{...(0,Y.tb)("thumbnail")},embed:{...(0,Y.tb)("embed")},meta:{...(0,Y.tb)("meta")},sourceUrl:{},displayStyle:{default:"inline"},fullWidthBlock:{default:!1},clickBehavior:{default:null}}),parseHTML(){return[{tag:"div[class=video]"},{tag:"video[bookmark]",getAttrs:(0,X.Ll)(this.storage)}]},addStorage:()=>({bookmarks:{}}),renderHTMLforAI(e){let{node:t}=e;return["video",{bookmark:(0,X.vL)(this.storage,t)}]},renderHTML(e){let{HTMLAttributes:t,node:l}=e;return["div",(0,r.KV)(t,{class:"video"}),["a",{href:(0,ee.lQ)(l),target:"_blank"},(0,ee.JY)(l)]]}}),fG=(0,sZ.P)(eN.s),fH=e=>{let{node:t,editor:l,getPos:a}=e,n=t.attrs,o=(0,nN.FX)(),i=(0,ce.yg)(e),r=0===i.length,s=(0,o6.rd)(),d=r?fF.Aj:o?fF.XJ:n.thumbHeight||fF.Aj,c=n.layout,f="grid"===c?n.dimensions||"square":void 0,g=(0,n9.lI)(n.horizontalAlign||"center"),{isZoomed:h,isZoomComplete:b,exitZoom:y,zoomedId:v,setZoomedId:k}=(0,fd.$B)(i.map(e=>e.attrs.id)),w=(0,J.GV)(es.nD),x=(0,F.useRef)(null),S=(0,fT.z)(x,e=>(0,ce.HI)(l.view,e)),A=(0,F.useCallback)(e=>{try{var t;e.stopPropagation(),e.preventDefault();let n=a(),o=l.state.doc.nodeAt(n);if(!o)return;let i=null===(t=o.lastChild)||void 0===t?void 0:t.attrs.source,r=n+(null==o?void 0:o.nodeSize)-1;l.chain().insertContentAt(r,{type:"mediaPlaceholder",attrs:{source:i||"image.custom"}}).run(),setTimeout(()=>{l.commands.focus(),l.commands.setNodeSelection(r),(0,fE.G)()})}catch(e){console.error("(caught) [GalleryView] addImage",e)}},[a,l]),C=(0,F.useCallback)(e=>{var t;l.isEditable&&(null===(t=e.target.closest(".gallery, .block"))||void 0===t?void 0:t.classList.contains("gallery"))&&l.commands.selectNodeAtPos(a())},[l,a]),I=(0,F.useMemo)(()=>"grid"===c?{overflow:"hidden",aspectRatio:"square"===f?"1":"landscape"===f?"4/3":"3/4"}:"logo"===c?{height:void 0}:{h:"".concat(d,"em"),flex:n.stretchFill?"1 1 auto":null===n.stretchFill?"1 1 auto":void 0},[c,f,d,n.stretchFill]),B=(0,F.useMemo)(()=>"grid"===c?{justifyContent:"center",display:"grid",gridTemplateColumns:1===i.length?"repeat(auto-fit, ".concat(n.thumbHeight,"em)"):i.length<6?n.thumbHeight>=fF.Vj/(1+.1*i.length)?"repeat(auto-fit, minmax(".concat(n.thumbHeight,"em, 1fr))"):"repeat(auto-fit, ".concat(n.thumbHeight,"em)"):"repeat(auto-fit, minmax(".concat(n.thumbHeight,"em, 1fr))"),gap:n.thumbHeight>=fF.Vj/2?"".concat(fF.I0,"em"):n.thumbHeight<=fF.Vj/3?"".concat(fF.I0/1.25,"em"):"".concat(fF.I0/1.5,"em")}:{gap:n.thumbHeight<=fF.Aj/3?"".concat(fF.I0/2,"em"):n.thumbHeight<=fF.Aj/2?"".concat(fF.I0/1.5,"em"):"".concat(fF.I0,"em"),display:"flex",flexDirection:"row",flexWrap:"wrap",alignItems:"center",placeContent:g,w:i.length>=3&&(null===n.stretchFill||n.stretchFill)?"100%":void 0},[c,n.thumbHeight,n.stretchFill,g,i.length]);return(0,m.jsxs)(p.u,{...e,children:[(0,m.jsxs)(eN.s,{className:"gallery",cursor:"default",onClick:C,ref:x,align:g,direction:"column",position:"relative","data-selection-ring":!0,"data-selection-background":!0,...r?S:{},css:{"--media-maxH":"flex"===c?"".concat(d,"em"):void 0,"--media-maxW":"100%"},w:"100%",sx:{".gallery-content":{w:"100%",display:"flex"===c?"contents":void 0},"[data-node-view-content-inner=gallery]":{...B,".block":{...I,["&.".concat(fB)]:{flex:"0 0 auto"},my:0,transitionProperty:"filter",transitionDuration:"normal",_hover:{[":not(.block-mediaPlaceholder) > :not(.".concat(fO.T,")")]:{filter:"brightness(0.9)"}},"[data-node-view-wrapper]":{h:"100%"}},".block-mediaPlaceholder":{overflow:"visible"}},".block-gallery.is-focused & .placeholder":{bg:s?dI.N.DARK_GALLERY_BG:dI.N.LIGHT_GALLERY_BG},".placeholder":{minW:"flex"===c?"12em":"logo"===c?"6em":void 0,h:"logo"===c?(0,ce.w5)(n.thumbHeight,n.thumbSpacing):void 0}},children:[r?(0,m.jsxs)(eC.T,{spacing:3,h:"".concat(d,"em"),justify:"center",contentEditable:!1,color:s?dI.N.DARK_COLOR:dI.N.LIGHT_COLOR,className:"gallery-placeholder","data-testid":"gallery-placeholder",userSelect:"none",children:[(0,m.jsx)(j.g,{size:"2x",icon:lh.yvG}),w?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(eu.$,{size:"xs",onClick:A,onMouseDown:e3.Fw,children:"Add images"}),(0,m.jsx)(z.E,{color:s?dI.N.DARK_ICON_COLOR:dI.N.LIGHT_ICON_COLOR,fontSize:"sm",textAlign:"center",children:(0,m.jsx)(em.x6,{id:"oyPIji"})})]}):null]}):(0,m.jsx)(u.$p,{className:"gallery-content"}),w&&!r&&(0,m.jsx)(eN.s,{position:"absolute",bottom:"0",h:"grid"===c||"logo"===c?"100%":"".concat(d,"em"),align:"center",w:6,insetEnd:-3,className:"add-image",opacity:"0",transitionProperty:"opacity",zIndex:"tooltip",transitionDuration:"normal",children:(0,m.jsx)(eI.Tz,{label:(0,m.jsx)(em.x6,{id:"P5MuiB"}),placement:"top",children:(0,m.jsx)(e9.K,{icon:(0,m.jsx)(j.g,{icon:ec.QLR}),"aria-label":ef.Ru._({id:"P5MuiB"}),position:"absolute",size:"xs",variant:"plain",isRound:!0,onClick:A})})}),(0,m.jsx)(E.A,{...e,label:ef.Ru._({id:"wnA/4R"})})]}),(0,m.jsx)(fd._M,{isZoomed:h,isZoomComplete:b,exitZoom:y,zoomedId:v,setZoomedId:k,editor:l,children:i.filter(e=>e.attrs.id).map(e=>{let{id:t}=e.attrs,a=e.type.name;return{id:t,thumbnail:"image"===a?(0,m.jsx)(fP.F,{imageAttrs:e.attrs,objectFit:"cover",isThumbnail:!0}):(0,m.jsx)(fA.x6,{node:e}),full:(0,m.jsx)(eN.s,{justify:"center",align:"center",h:"100%",w:"100%",children:"image"===a?(0,m.jsx)(fP.F,{isZoomed:!0,imageAttrs:e.attrs}):"video"===a?(0,m.jsx)(fG,{width:"var(--media-maxW)",height:"var(--media-maxH)",direction:"column",align:"center",justify:"center",children:(0,m.jsx)(fL,{isZoomed:!0,node:e,decorations:[],editor:l})}):(0,m.jsx)(fG,{h:"100%",w:"100%",direction:"column",justify:"center",align:"center",children:(0,m.jsx)(fS,{isZoomed:!0,node:e,decorations:[],editor:l})})})}})})]})},fV=r.bP.create({name:"gallery",group:"cardBlock layoutBlock",content:"media*",isolating:!0,draggable:!0,selectable:!0,priority:Z.y.Gallery,containerHandle:!0,expandable:!0,addNodeView:()=>(0,u.gu)(fH,{update:c.z0,ignoreMutation:mg.I}),addAttributes:()=>({thumbHeight:{default:fF.Aj},fullWidthBlock:{default:!1},layout:{default:"flex"},stretchFill:{},dimensions:{default:"square"},thumbSpacing:{default:fF.mj}}),addProseMirrorPlugins(){return[fM(this.editor)]},parseHTML:()=>[{tag:"div[class=gallery]"},{tag:"gallery"}],renderHTMLforAI(e){let{node:t}=e;return["gallery",{thumbHeight:t.attrs.thumbHeight},0]},renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,r.KV)(t,{class:"gallery"}),0]}});var fq=l(45776);let fK=r.YY.create({name:"media",addExtensions:()=>[mb.p],addCommands:()=>({handleSpaceToZoom:()=>e=>{let{state:t}=e;if(t.selection instanceof V.nh&&(0,ee.Bv)(t.selection.node)){let e=(0,J.KA)(),{id:l}=t.selection.node.attrs;return!!(l&&(0,rS.iZ)(l)(e.getState()))||(e.dispatch((0,es.a)({nodeId:t.selection.node.attrs.id})),!0)}return!1}})});var fJ=l(35923),f$=l(50881);let fQ=["paragraph","heading","title","bullet","numbered","todo","toggleSummary"],fY=r.YY.create({name:"placeholderText",addGlobalAttributes:()=>[{types:fQ,attributes:{placeholder:{default:null,keepOnSplit:!1,rendered:!1}}}],addCommands:()=>({removeFilledPlaceholders:()=>e=>{let{tr:t,dispatch:l}=e;return!l||(t.doc.descendants((e,l)=>{e.attrs.placeholder&&e.textContent&&(console.debug("Removing placeholder",e.attrs.placeholder,"at",l,"with content",e.textContent),t.setNodeAttribute(l,"placeholder",null))}),!0)}}),onUpdate(){fX(this.editor)}}),fX=nT()(e=>{e.isEditable&&e.commands.removeFilledPlaceholders()},100,{maxWait:1e3});var fZ=l(97404),f0=l(85700),f1=l(65641),f2=l(77583);let f6=r.YY.create({name:"TableCommands",addCommands:()=>({selectColumn:e=>t=>{let{tr:l,dispatch:a}=t;if(!a)return!0;let{doc:n}=l,o=n.resolve(e),i=f2.rn.colSelection(o);return l.setSelection(i),!0},selectRow:e=>t=>{let{tr:l,dispatch:a}=t;if(!a)return!0;let{doc:n}=l,o=n.resolve(e),i=f2.rn.rowSelection(o);return l.setSelection(i),!0},selectTable:e=>t=>{let{tr:l,dispatch:a}=t;if(!a)return!0;let{doc:n}=l,o=n.resolve(e),i=f2.rn.colSelection(o),r=f2.rn.rowSelection(i.$anchorCell,i.$headCell);return l.setSelection(r),!0}})}),f4=r.bP.create({name:"tableCell",addOptions:()=>({HTMLAttributes:{}}),content:"(block | tableBlock)+",addAttributes:()=>({colspan:{default:1},rowspan:{default:1}}),tableRole:"cell",isolating:!0,selectable:!1,parseHTML:()=>[{tag:"td"},{tag:"th"}],renderHTML(e){let{HTMLAttributes:t}=e;return["td",(0,r.KV)(this.options.HTMLAttributes,t),0]}}),f5=e=>(0,m.jsxs)(u.VR,{className:"table-row-wrapper",style:{display:"contents"},children:[(0,m.jsx)("th",{style:{position:"relative",padding:0},children:(0,m.jsx)(f3,{...e})}),(0,m.jsx)(u.$p,{as:"div",className:"table-row-content",style:{display:"contents"}})]}),f3=(0,F.memo)(e=>{let{...t}=e,{getPos:l,editor:a}=t;return(0,m.jsx)(eN.s,{height:"100%",align:"center",contentEditable:!1,suppressContentEditableWarning:!0,children:(0,m.jsx)(E.A,{...t,label:ef.Ru._({id:"9c44h0"}),onClick:()=>{let e=l()+1;a.chain().focus().selectRow(e).run()},insetInlineStart:"-0.5em",top:"1em",zIndex:"3","data-testid":"table-row-control"})})});f3.displayName="RowControl";let f8=r.bP.create({name:"tableRow",addOptions:()=>({HTMLAttributes:{}}),selectable:!1,content:"tableCell+",tableRole:"row",containerHandle:!0,addNodeView:()=>(0,u.gu)(f5,{update:c.z0,as:"tr"}),parseHTML:()=>[{tag:"tr"}],renderHTML(e){let{HTMLAttributes:t}=e;return["tr",(0,r.KV)(this.options.HTMLAttributes,t),0]}});var f7=l(32565),f9=l(45965);let pe=e=>{let{node:t,decorations:l}=e,{level:a,horizontalAlign:n,placeholder:o}=t.attrs,i=o||(a===pt.DefaultTitle?ef.Ru._({id:"wja8aL"}):ef.Ru._({id:"MHrjPM"}));return(0,m.jsx)(p.u,{...e,style:{display:"flex",flexDirection:"column",...(0,n9.yp)(n)},children:(0,m.jsx)(u.$p,{dir:(0,n9.fZ)(l),level:a,className:(0,I.cx)("title",B.U6),"data-placeholder":i,style:{minWidth:"min(100%, 10em)",...(0,n9.O8)(n)}})})};var pt=function(e){return e[e.DefaultTitle=1]="DefaultTitle",e[e.LargeTitle=2]="LargeTitle",e[e.XLargeTitle=3]="XLargeTitle",e}({});let pl=r.bP.create({name:"title",content:"inline*",group:"block cardNotesBlock",defining:!0,selectable:!1,addAttributes:()=>({level:{default:1}}),addNodeView:()=>(0,u.gu)(pe,{update:c.z0}),parseHTML:()=>[{tag:"h1[class=title]"}],addInputRules(){return(0,f9.Y5)().map(e=>{let[,t]=e,{inputRegex:l,level:a}=t;return l?(0,ux.JJ)({find:l,type:this.type,getAttributes:{level:a}}):null}).filter(e=>!!e)},renderHTML(e){let{HTMLAttributes:t}=e;return["h1",(0,r.KV)(t,{class:"title"}),0]}});var pa=l(46896);let pn=()=>new V.k_({key:new V.hs("TogglePlugin"),props:{handlePaste(e,t,l){let{selection:a,tr:n}=e.state,o=(0,r.KP)(pa.Rv)(a);if(!o)return!1;let i=null,s=null,d=[];if(l.content.descendants(e=>{e.isTextblock&&(i?d.push(e):(i=e.content,s=(0,n8.NA)(e)||null))}),!i)return;s&&n.setNodeAttribute(o.pos,"fontSize",s),n.replaceSelection(l0.Ji.maxOpen(i));let u=n.mapping.map(o.pos+o.node.nodeSize);n.replaceRange(u,u,l0.Ji.maxOpen(l0.FK.fromArray(d)));let c=(0,iU.i)(n,-1);return c&&n.setSelection(c),e.dispatch(n),!0},decorations(e){let{doc:t}=e,l=[];return t.descendants((e,t,a)=>{if(!a||!(0,pa.Rv)(e))return;let n=(0,Y.F2)(a.content).slice(1).every(e=>(0,Y.Op)(e)),o=r_.NZ.node(t,t+e.nodeSize,{},{isToggleDecoration:!0,toggleId:a.attrs.id,isEmpty:n});l.push(o)}),r_.zF.create(t,l)}}}),po=e=>{var t;return(null===(t=e.find(e=>e.spec.isToggleDecoration))||void 0===t?void 0:t.spec)||{}},pi="1.5em",pr=e=>{let{node:t,decorations:l}=e,{level:a,fontSize:n,placeholder:o,horizontalAlign:i}=t.attrs,{toggleId:r="",isEmpty:s}=po(l),d=(0,n9.yp)(i),c=(0,n9.fZ)(l),[f]=(0,o$.yz)(c),g=(0,J.GV)(es.nD),h=(0,J.GV)(es.jO),b=(0,J.GV)((0,es.q)(r))||h,y=(0,F.useCallback)(()=>{(0,pa.bG)(r,!b)},[r,b]);return(0,m.jsx)(p.u,{...e,hideComments:!b,children:(0,m.jsxs)(z.E,{as:"div",dir:c,display:"flex",flexDirection:"column",position:"relative",onClick:g?void 0:y,cursor:g?void 0:"pointer",style:{display:"flex",flexDirection:"column",...(0,n9.yp)(i)},children:[(0,m.jsx)(eu.$,{[f]:"calc(0.125em - ".concat(pi,")"),position:"absolute",variant:"ghost",colorScheme:"gray",color:s?"var(--body-color-muted)":"var(--body-color)",onClick:g?y:void 0,contentEditable:!1,onMouseDown:e3.Fw,fontSize:"1em",lineHeight:"inherit",height:"100%",px:2,marginStart:-2,minW:"unset","data-testid":"toggle-button",children:(0,m.jsx)(z.E,{transform:"rotate(".concat(b?90:"rtl"===c?180:0,"deg)"),transformOrigin:"center",transitionProperty:"transform",transitionDuration:"normal",fontSize:"0.75em",children:(0,m.jsx)(j.g,{icon:lb.ijD})})}),(0,m.jsx)(u.$p,{dir:c,level:a,"data-placeholder":o||ef.Ru._({id:"JFciKP"}),"data-font-size":n,className:(0,I.cx)((0,n8.Ii)(n)&&B.U6),style:{minWidth:"min(100%, 10em)",textAlign:d.textAlign,...(0,n9.O8)(i)}})]})})},ps=r.bP.create({name:"toggleSummary",content:"inline*",selectable:!1,marks:"bold italic underline code footnoteLabel strike textColor highlight",allowFontSizes:"heading body",addAttributes:()=>({fontSize:ck.mD}),addNodeView:()=>(0,u.gu)(pr,{update:c.z0}),renderHTML(e){let{HTMLAttributes:t}=e;return["summary",t,0]},parseHTML:()=>[{tag:"summary"}]}),pd=e=>{let{decorations:t,node:l}=e,a=(0,n9.fZ)(t),[n]=(0,o$.yz)(a),o=(0,J.GV)(es.jO),i=(0,J.GV)((0,es.q)(l.attrs.id))||o;return(0,m.jsx)(p.u,{...e,hideComments:i,readOnly:!i,children:(0,m.jsxs)(f.az,{dir:a,ps:pi,position:"relative","data-open":!!i,className:"toggle",borderRadius:"var(--box-border-radius)","data-selection-ring":"padded",children:[(0,m.jsx)(u.$p,{}),i&&(0,m.jsx)(f.az,{position:"absolute",[n]:"0.375em",bottom:"0.25em",top:"2.5em",borderStart:"1px solid",borderColor:"var(--neutral-border-color)"})]})})};var pu=l(44275);let pc=/^\s*([+])\s$/,pm=r.bP.create({name:"toggle",group:"layoutBlock calloutBlock cardBlock smartLayoutBlock tableBlock",content:"toggleSummary (block | layoutBlock)+",selectable:!1,isolating:!0,priority:Z.y.Toggle,expandable:!0,addNodeView:()=>(0,u.gu)(pd,{update:c.z0}),addProseMirrorPlugins:()=>[pn()],addAttributes:()=>({id:(0,sj.e)(pu.n)}),addInputRules(){var e;return[(e={find:pc,innerType:this.editor.schema.nodes.toggleSummary,outerType:this.type,getInnerAttributes:e=>({fontSize:(0,n8.NA)(e)}),getOuterAttributes:()=>{let e=(0,pu.n)();return(0,pa.bG)(e,!0),{id:e}}},new r.fV({find:e.find,handler:t=>{let{state:l,range:a,match:n}=t,o=l.doc.resolve(a.from);if(!o.node(-1).canReplaceWith(o.index(-1),o.indexAfter(-1),e.outerType))return;let i=(0,r.gk)(e.getOuterAttributes,void 0,o.parent)||{},s=(0,r.gk)(e.getInnerAttributes,void 0,o.parent)||{},d=l.tr.delete(a.from,a.to),u=d.doc.resolve(a.from),c=u.parent,m=e.outerType.createAndFill(i,[e.innerType.create(s,c.content)]);d.replaceWith(u.before(),u.after(),m);let f=(0,iU.n)(d.doc.resolve(a.from));f&&d.setSelection(f)}}))]},addCommands(){var e=this;return{unwrapToggle:()=>e=>{let{state:t,editor:l,tr:a}=e;if(!l.isActive("toggleSummary"))return!1;let{selection:n,schema:o}=t,i=(0,r.KP)(pa.p8)(n);if(!i||i.start+1!==n.from||!n.empty)return!1;let s=(0,Y.F2)(i.node.content),d=s[0],{type:u,level:c}=(0,n8.o)(d.attrs.fontSize),m=["heading"===u?o.nodes.heading.create({level:c},d.content):o.nodes.paragraph.create({fontSize:d.attrs.fontSize},d.content)].concat(s.slice(1));a.replaceWith(i.pos,i.pos+i.node.nodeSize,l0.FK.from(m)).setMeta("annotationEvent",{type:"unwrap-node",pos:i.pos});let f=a.doc.resolve(i.pos),p=(0,iW.s)(f);return p&&a.setSelection(p),!0},joinBackwardInToggle:()=>e=>{let{state:t,editor:l,chain:a}=e;if(l.isActive("toggleSummary"))return!1;let{selection:n}=t,o=(0,r.KP)(pa.p8)(n);if(!o)return!1;let i=(0,Y.F2)(o.node.content).slice(1);return!!n.empty&&0===n.$from.parentOffset&&1===i.length&&(a().command(e=>{let{tr:t}=e,a=t.doc.resolve(o.pos+1).end();return t.insert(a,l.schema.nodes.paragraph.create()),!0}).joinBackward(),!0)},wrapWithToggle:function(t){let l=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return a=>{let n,{state:o,tr:i}=a,{doc:r,selection:s,schema:d}=o,u=s.$from.blockRange(s.$to);if(!u)return!1;let c=[];r.nodesBetween(s.from,s.to,(e,t,l)=>{if(l===u.parent)return c.push(e),!1});let m=[];if(!t&&c[0].isTextblock&&c[0].textContent.length<100){let e=(0,n8.NA)(c[0]);n=d.nodes.toggleSummary.create({fontSize:e},c[0].content),m=c.slice(1)}else{let e=t?d.text(t):null;n=d.nodes.toggleSummary.create(null,e),m=c}let f=(0,pu.n)();l&&(0,pa.bG)(f,!0);let p=e.editor.schema.nodes.toggle.createAndFill({id:f},l0.FK.fromArray([n,...m]));if(!p)return!1;let{start:g,end:h}=u;i.replaceRangeWith(g,h,p).setMeta("annotationEvent",{type:"wrap-nodes",start:g,end:h,level:1});let b=(0,iW.t)(i);if(!b)return!1;let y=(0,iW.s)(b,-1);return y&&i.setSelection(y),!0}},enterInToggle:()=>e=>{let{editor:t,state:l,chain:a}=e;if(!t.isActive("toggle"))return!1;let n=(0,r.KP)(pa.p8)(l.selection);if(!n||(0,pa.vb)(n.node.attrs.id))return!1;let{selection:o}=t.state,{$from:i}=o;if(i.parentOffset===i.parent.nodeSize-2){let e=n.pos+n.node.nodeSize;return a().insertContentAt(e,{type:"paragraph"}).selectInsertedNode().run(),!0}return(0,pa.bG)(n.node.attrs.id,!0),!0}}},addKeyboardShortcuts:()=>({Enter:e=>{let{editor:t}=e;return t.commands.enterInToggle()},Backspace:e=>{let{editor:t}=e;return t.commands.first(e=>{let{commands:t}=e;return[()=>t.unwrapToggle(),()=>t.joinBackwardInToggle()]})}}),addExtensions:()=>[pu.D,ps],renderHTML(e){let{HTMLAttributes:t}=e;return["details",t,0]},parseHTML:()=>[{tag:"details"}]}),pf=l(15657).A.extend({parseHTML:()=>[{tag:"u"},{style:"text-decoration=underline"},{style:"text-decoration-line=underline"}]});var pp=l(39002);let pg=function(){let{isInnerEditor:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[u2,u6,nO.T,iE,i6.QJ.configure({enabled:!o.$.GAMMA_PUPPETEER_SERVICE}),et.iM,i1,rQ,rB,sr,pp.n,n.E,ma.B,mJ.N.configure({openOnClick:!1}),d3,uq.z,k,ms,pf,f0.n,mQ.B8,mZ,m6,m7,pl,mn.DZ,f$.f,h,G,d5.N,n9.wq,f7.f,w.$,A,f7.r,ck.Z4,fY,f1.X.extend({resizable:!0,allowTableNodeSelection:!0}),f8,f4,f6,dJ,fK,re.Ud,fq._V,fU,fj,cb,uy,fV,fJ.M9,fJ.BF,fJ.lw,rZ.Hf,uC,mq,mI,mh.o,mx,mt,c7,ua,sk,pm,cy,rt.h,i.a,cv,d2,co,a.v,fZ.a,mf.configure({addSelectionKeyMaps:!e}),mp]}},57322:(e,t,l)=>{"use strict";l.d(t,{N:()=>d});var a=l(31085);l(13236);var n=l(14041),o=l(58599),i=l(95186),r=l(74346);class s extends n.Component{componentDidMount(){this.mounted=!0}componentWillUnmount(){this.mounted=!1}init(){let{editor:e}=this.props;if(!e)return;let{doc:t}=e.state;e.contentComponent=this,e.createNodeViews(),this.RootComponent=(0,a.jsx)(u,{editor:e,node:t})}setRenderer(e,t){this.renderers.set(e,t),this.mounted&&this.setState({counter:this.state.counter+1})}removeRenderer(e){this.renderers.delete(e),this.mounted&&this.setState({counter:this.state.counter+1})}render(){let{editor:e}=this.props;return e?(0,a.jsx)("div",{className:"ProseMirror",children:this.RootComponent}):null}constructor(e){super(e),this.RootComponent=null,this.renderers=new Map,this.mounted=!1,this.editorContentRef=n.createRef(),this.editorContentChildren=n.createRef(),this.state={counter:0},this.init()}}let d=n.memo(s),u=e=>{let{node:t,editor:l}=e;return(0,a.jsx)(i.e.Provider,{value:{editor:l,node:t},children:(0,a.jsx)(o.VR,{children:(0,a.jsx)(r.$,{})})})}},74346:(e,t,l)=>{"use strict";l.d(t,{$:()=>h});var a=l(31085),n=l(81313),o=l(13236),i=l(69e3),r=l(14041),s=l(95186),d=l(95580),u=l(19534);let c=e=>{let t={};for(let l of e.attributes){let e=l.name;"class"===e?t.className=l.value:"contenteditable"===e&&"false"===l.value||(t[e]=l.value)}return t},m=(e,t,l,n)=>{let o=Array.from(l.contentComponent.renderers.values()).find(t=>t.props.node===e);if(o){let e=o.element.nodeName.toLowerCase()||"div",{style:l,...i}=c(o.element);return(0,a.jsx)(e,{"data-pos":t,...i,STYLE:"white-space: inherit;".concat(l),children:(0,a.jsx)(o.component,{...o.props,children:n})},o.id)}return null},f=e=>{var t;return null!==(t=e.config.renderHTMLforSSR)&&void 0!==t?t:e.config.renderHTML},p=e=>{let t={...e};return(null==t?void 0:t.style)&&(t.STYLE=t.style,delete t.style),(null==t?void 0:t.class)&&(t.className=t.class,delete t.class),(null==t?void 0:t.colspan)&&(t.colSpan=t.colspan,delete t.colspan),(null==t?void 0:t.rowspan)&&(t.rowSpan=t.rowspan,delete t.rowspan),t},g=(e,t)=>{var l;let a=(0,d.vC)(e,t.type);if(!a)return[];let n=e.extensionManager.attributes.filter(e=>e.type===t.type.name),i=(0,o.zU)(t,n),r=a;for(;!f(r)&&r.parent;)r=r.parent;let s=null===(l=f(r))||void 0===l?void 0:l.bind(a);if(!s)return[];let[u,c,m]=s({HTMLAttributes:i,node:t,mark:t,editor:e});return[u,p(c),m]},h=r.memo(e=>{let{node:t,editor:l,getPos:o}=(0,s.c)();if(!t||!l)return null;let d=e.as||"div",c=t.isInline||t instanceof i.CU?"span":"div",f=[],p="function"==typeof o?o():null,h=(e,t,o)=>{let i=(null===p?0:p)+t+1,s=m(e,i,l);if(s)return s;let d=t=>Array.from(e.marks).reverse().reduce((e,t)=>{let a=m(t,i,l,e);if(a)return a;let[n,s,d]=g(l,t)||[];return n?r.createElement(n,{key:o,...s},e):e},t),c=null===p?[]:(0,u.j5)(l,i),[f,b,y]=g(l,e);if(f&&b){let l=null;if(0===y&&e.firstChild){let a=[];e.forEach((e,l,n)=>{a.push(h(e,t+l,"".concat(o,"_").concat(n)))}),l=a,console.debug("[SSR NodeViewContent] HOLE",a)}else Array.isArray(y)?(console.debug("[SSR NodeViewContent] children array",y),l=[...y]):y&&(console.debug("[SSR NodeViewContent] children plain",y),l=y);let{nodeName:a,...s}=c.map(e=>{var t;return null===(t=e.type)||void 0===t?void 0:t.attrs}).reduce((e,t)=>({...e,...t}),{}),u={...b,...s,className:(0,n.cx)(s.class,b.class),"data-pos":i};return delete u.class,console.debug("[SSR NodeViewContent] non-nodeview:",o,u,y),d(r.createElement(f,{key:o,...u},l))}return e.isText?d((0,a.jsx)(r.Fragment,{children:e.textContent},o)):null};return t.forEach((e,l)=>{let a=f.length+1,n=h(e,l,"".concat(a));n?f.push(n):console.warn("%c [Simple NodeViewContent] UNKNOWN NODE $$$$$$$$$$$$$$$$$$$$$$$$$","background-color: aqua; font-weight: bold",{unknownNode:e,parentNode:t})}),(0,a.jsx)(d,{...e,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style},children:(0,a.jsx)(c,{"data-node-view-content-inner":t.type.name,style:{whiteSpace:"inherit"},children:0===f.length?null:1===f.length?f[0]:f})})});h.displayName="NodeViewContent"},89284:(e,t,l)=>{"use strict";l.d(t,{bO:()=>H,gT:()=>K,Vo:()=>q,E1:()=>V});var a=l(12917),n=l(20501),o=l(12327),i=l(40074),r=l.n(i),s=l(34789),d=l.n(s),u=l(65998),c=l(45709),m=l(3040),f=l(3601);let p=()=>[{key:"autoComplete",name:()=>o.Ru._({id:"ZyVTQp"}),shortcut:f.H,nodeName:"paragraph",icon:m._$C,keywords:["continue","autocomplete","typeahead","complete","continue","ai"],execute:e=>{e.commands.autoComplete()},featureFlag:"aiAutocomplete",creditType:"autocomplete",needsConnection:!0},{key:"aiCardAfter",name:()=>o.Ru._({id:"yk2NpI"}),nodeName:"card",icon:m._$C,execute:e=>e.commands.insertCardAfter((0,c.G)().aiCardAfter),checkDisabled:e=>!e.schema.nodes.card,keywords:["card","below","after","new"],featureFlag:"addCard2",needsConnection:!0}];var g=l(16262),h=l(98736),b=l(77256),y=l(98757);let v=()=>[{key:"barChartVertical",name:()=>o.Ru._({id:"kaIve5"}),icon:a.s67,chartType:"bar"},{key:"barChartHorizontal",name:()=>o.Ru._({id:"JXpNuP"}),icon:a.Mkm,chartType:"horizontal-bar"},{key:"lineChart",name:()=>o.Ru._({id:"Kt/Lzz"}),icon:a.gK3,chartType:"line"},{key:"pieChart",name:()=>o.Ru._({id:"5+y+OQ"}),icon:a.W1p,chartType:"pie"},{key:"donutChart",name:()=>o.Ru._({id:"DNipMm"}),icon:a.oDg,chartType:"donut"}].map(e=>({nodeName:"chart",keywords:["graph",e.chartType],featureFlag:"enableCharts",execute:t=>{t.chain().insertChart(e.chartType,!0).editSelectedChart().run()},dragStartFn:t=>{let l=(0,h.r4)();(0,b.fS)(t,{type:"chart",attrs:{chartType:e.chartType,id:l,data:(0,y.$)(e.chartType)||{}}})},dragEndFn:e=>{e.commands.editSelectedChart()},...e}));var k=l(46108),w=l.n(k),x=l(27664);let S={flywheel:{type:"diagram",attrs:{horizontalAlign:"center",shapes:[{x:1024.2205225919886,y:545.3520002984831,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:sBqhkO1gaRDC33E9nLFRf",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:27,html:'

Two

',shapeColor:null},parentId:"page:page",index:"a4",typeName:"shape"},{x:605.5691768594324,y:545.3520002984831,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:LuxCoSOJiKidTHonK_r3y",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:27,html:'

Four

',shapeColor:null},parentId:"page:page",index:"a5",typeName:"shape"},{x:811.2936767672497,y:332.49917028373386,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:jNEccTSx5tCosurJ5Ot2M",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:27,html:'

One

',shapeColor:null},parentId:"page:page",index:"a6",typeName:"shape"},{x:786.7936767672497,y:753.4464458368486,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:OUIb317WtLr7vTROMJmRY",type:"text",props:{color:"black",size:"m",w:145.68119328124112,text:"",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:27,html:'

Three

',shapeColor:null},parentId:"page:page",index:"a7",typeName:"shape"},{x:774.4554909171899,y:664.006697053962,rotation:3.141592653589793,isLocked:!1,opacity:1,meta:{},id:"shape:gOmdcWQlSymeyfc0iFv_H",type:"arrow",parentId:"page:page",index:"a8",props:{dash:"solid",size:"m",fill:"solid",color:"black",labelColor:"black",bend:-33.715948517019974,start:{type:"point",x:-143.39749318568477,y:299.6671450013758},end:{type:"point",x:-296.8596898701958,y:124.06206342608016},arrowheadStart:"none",arrowheadEnd:"arrow",text:"",labelPosition:.5,font:"draw",shapeColor:null,strokeWidth:"md"},typeName:"shape"},{x:949.3708512974239,y:475.1522148190538,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:FoSkoOljiovlpXtyepQ0L",type:"arrow",parentId:"page:page",index:"a8G",props:{dash:"solid",size:"m",fill:"solid",color:"black",labelColor:"black",bend:-33.715948517019974,start:{type:"point",x:-165.31582160993514,y:295.60684693665877},end:{type:"point",x:-292.70420767490987,y:127.69426010254801},arrowheadStart:"none",arrowheadEnd:"arrow",text:"",labelPosition:.5,font:"draw",shapeColor:null,strokeWidth:"md"},typeName:"shape"},{x:749.9432407400066,y:507.6958283407593,rotation:4.555309347705199,isLocked:!1,opacity:1,meta:{},id:"shape:xJbFH6GE8sktyfodgK-9d",type:"arrow",parentId:"page:page",index:"a8V",props:{dash:"solid",size:"m",fill:"solid",color:"black",labelColor:"black",bend:-33.715948517019974,start:{type:"point",x:-141.06822675649278,y:304.84894107910753},end:{type:"point",x:-293.7665666504506,y:149.96506626343376},arrowheadStart:"none",arrowheadEnd:"arrow",text:"",labelPosition:.5,font:"draw",shapeColor:null,strokeWidth:"md"},typeName:"shape"},{x:973.8831014746072,y:631.4630835322564,rotation:1.413716694115406,isLocked:!1,opacity:1,meta:{},id:"shape:98AlWuZ3MNJ8HXkw_0SX8",type:"arrow",parentId:"page:page",index:"a9",props:{dash:"solid",size:"m",fill:"solid",color:"black",labelColor:"black",bend:-33.715948517019974,start:{type:"point",x:-138.9882886080492,y:300.5849857402369},end:{type:"point",x:-290.8832143177716,y:128.98965564678986},arrowheadStart:"none",arrowheadEnd:"arrow",text:"",labelPosition:.5,font:"draw",shapeColor:null,strokeWidth:"md"},typeName:"shape"}],assets:[],meta:{},width:420.44444444444446,svg:'

Two

Four

One

Three

'}},quadrant:{type:"diagram",attrs:{horizontalAlign:"center",shapes:[{x:1074.82421875,y:229.03125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:0ok4F6wp2WXfO_JbW55tI",type:"arrow",parentId:"page:page",index:"a1",props:{dash:"solid",size:"m",fill:"solid",color:"black",labelColor:"black",bend:0,start:{type:"point",x:0,y:0},end:{type:"point",x:0,y:400},arrowheadStart:"arrow",arrowheadEnd:"arrow",text:"",labelPosition:.5,font:"draw",shapeColor:null,strokeWidth:"md"},typeName:"shape"},{x:869.5924737463713,y:27.95840719431982,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:lfd5uMWVGIIFlwc_gfUf_",type:"arrow",parentId:"page:page",index:"a2",props:{dash:"solid",size:"m",fill:"solid",color:"black",labelColor:"black",bend:0,start:{type:"point",x:0,y:400},end:{type:"point",x:400,y:400},arrowheadStart:"arrow",arrowheadEnd:"arrow",text:"",labelPosition:.5,font:"draw",shapeColor:null,strokeWidth:"md"},typeName:"shape"},{x:1026.82421875,y:170.3671875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:c4kLEFg-x_YebbalM4bbJ",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:27,html:'

Title

',shapeColor:null},parentId:"page:page",index:"a3",typeName:"shape"},{x:1275.47265625,y:404.9296875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:rr2bWXVlRik_OTR3-Mzxb",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:27,html:'

Title

',shapeColor:null},parentId:"page:page",index:"a4",typeName:"shape"},{x:770.2109375,y:404.9296875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:4nADMgFMClNzOAl0NqJsR",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:27,html:'

Title

',shapeColor:null},parentId:"page:page",index:"a4V",typeName:"shape"},{x:1026.82421875,y:640.79296875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:pQUKVKJOu78f_j_B0Y1_-",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:27,html:'

Title

',shapeColor:null},parentId:"page:page",index:"a5",typeName:"shape"}],assets:[],meta:{},width:434.6666666666667,svg:'

Title

Title

Title

Title

'}},venn:{type:"diagram",attrs:{horizontalAlign:"center",shapes:[{x:1175.87109375,y:508.45703125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:YuAAYaKmNVXbxRM9Ym0z4",type:"geo",props:{w:394.4375,h:394.4375,geo:"ellipse",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a1",typeName:"shape"},{x:904.79296875,y:508.45703125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:ywvivjfUEJxH_FT8HCp6E",type:"geo",props:{w:394.4375,h:394.4375,geo:"ellipse",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a2",typeName:"shape"},{x:1040.3320312500002,y:270.0929726013588,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:uoJ_xUvPbDuyBaVh94J02",type:"geo",props:{w:394.4375,h:394.4375,geo:"ellipse",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a3",typeName:"shape"},{x:1092.234375,y:547.42578125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:W8BtDrKhUUa_fmB-YfrG4",type:"text",props:{color:"black",size:"m",w:108,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:24,html:'

Expensive

',shapeColor:null},parentId:"page:page",index:"a4",typeName:"shape"},{x:1282.02734375,y:547.42578125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:lLHXbsMOmu2pfYDmh7SMV",type:"text",props:{color:"black",size:"m",w:104,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:24,html:'

Take time

',shapeColor:null},parentId:"page:page",index:"a5",typeName:"shape"},{x:1185.5507812500002,y:689.046875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:FJv1W-bQpfCY0dAUn_ezA",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:52,html:'

Low
quality

',shapeColor:null},parentId:"page:page",index:"a6",typeName:"shape"},{x:1373.08984375,y:705.67578125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:tT7vEjVJGLo0tv18nWtJV",type:"text",props:{color:"black",size:"m",w:107,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:34,html:'

Cheap

',shapeColor:null},parentId:"page:page",index:"a7",typeName:"shape"},{x:1017.1328125,y:705.67578125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:gaQCyTxoxdrsvbDkqQV9C",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:34,html:'

Fast

',shapeColor:null},parentId:"page:page",index:"a8",typeName:"shape"},{x:1189.5507812500002,y:424.234375,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:VAbhvBq-Ec1CIYnCjzhl2",type:"text",props:{color:"black",size:"m",w:96,text:"",font:"draw",align:"middle",autoSize:!0,scale:1,h:20,growY:34,html:'

Good

',shapeColor:null},parentId:"page:page",index:"a9",typeName:"shape"}],assets:[],meta:{},width:431.1111111111111,svg:'

Expensive

Take time

Low
quality

Cheap

Fast

Good

'}},calendarWeek:{type:"diagram",attrs:{horizontalAlign:null,shapes:[{x:179.0625,y:119.1171875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:hF6E8P7CiXiSsRo7LG0FF",type:"geo",props:{w:301.9961468758189,h:873.9095562737236,geo:"rectangle",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"Zy",typeName:"shape"},{x:495.4840350809791,y:119.1171875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:taayoSjVZnQxAEAkYzW8F",type:"geo",props:{w:301.9961468758189,h:873.9095562737236,geo:"rectangle",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"Zz",typeName:"shape"},{x:811.9055701619584,y:119.1171875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:DogbW2-V83SiEhlezSTF1",type:"geo",props:{w:301.9961468758189,h:873.9095562737236,geo:"rectangle",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a0",typeName:"shape"},{x:1128.3271052429373,y:119.1171875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:SzwGSCVn7h1Uo_B_b-0jU",type:"geo",props:{w:301.9961468758189,h:873.9095562737236,geo:"rectangle",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a1",typeName:"shape"},{x:1445.4682141660628,y:119.1171875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:IAo_g6FQp9YK2JWBCaGMU",type:"geo",props:{w:301.9961468758189,h:873.9095562737236,geo:"rectangle",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a2",typeName:"shape"},{x:832.3614242096944,y:134.56584632459914,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:l_vkpYMsSpaE9s3TN_mKw",type:"text",props:{color:"black",size:"m",w:261.08443878034683,text:"Wed",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:34,html:'

Wed

',shapeColor:null},parentId:"page:page",index:"a5",typeName:"shape"},{x:1148.7829592906733,y:134.56584632459914,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:Cw9jJcIeB18UZCowlxx0A",type:"text",props:{color:"black",size:"m",w:261.08443878034683,text:"Thu",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:34,html:'

Thu

',shapeColor:null},parentId:"page:page",index:"a6",typeName:"shape"},{x:1465.9240682137988,y:134.56584632459914,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:VvguEUBmR1u7tIdodua_7",type:"text",props:{color:"black",size:"m",w:261.08443878034683,text:"Fri",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:34,html:'

Fri

',shapeColor:null},parentId:"page:page",index:"a7",typeName:"shape"},{x:204.97813786171344,y:211.51595163729675,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:lqef5zWrrlQl9HENeGEnL",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Meeting with Jon",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Meeting with Jon

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aD",typeName:"shape"},{x:204.97813786171344,y:605.0019073645135,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:IgEYD45iYr1sSFMoAwbyu",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Team bonding",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Team bonding

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDG",typeName:"shape"},{x:204.97813786171344,y:297.31890598073045,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:Qim4eNR90mSPnWlJh468S",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Checking emails",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Checking emails

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDV",typeName:"shape"},{x:1154.2427431046506,y:295.64859941977187,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:IL-fsOSVuSRXre2dwItqj",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"HR meetings",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

HR meetings

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDZ",typeName:"shape"},{x:1154.2427431046506,y:379.7812472022469,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:bH7UwVBlNxoEzsh_1zjen",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Onboarding new hire",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Onboarding new hire

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDb",typeName:"shape"},{x:521.3996729426926,y:211.51595163729675,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:HAHtaenTwvKec_w0q3MVQ",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Attend CS meeting",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Attend CS meeting

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDd",typeName:"shape"},{x:1471.3838520277761,y:379.7812472022469,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:7ONsfQ5KbFBdZuwBMYOXz",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"Team happy hour",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Team happy hour

',shapeColor:"#26A688",strokeWidth:"sm"},parentId:"page:page",index:"aDe",typeName:"shape"},{x:1471.3838520277761,y:211.51595163729675,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:ov9MLbM2hIPHiHbKtLXgq",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Attend CS meeting",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Attend CS meeting

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDf",typeName:"shape"},{x:1471.3838520277761,y:295.64859941977187,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:JcWFs24GgyS_MNCWFyy4F",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Office tour",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Office tour

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDg",typeName:"shape"},{x:837.8212080236717,y:211.51595163729675,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:avNg2b0XCoj-PSVRH9NqC",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"1:1 with Zach",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

1:1 with Zach

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDh",typeName:"shape"},{x:837.8212080236717,y:297.45150900814224,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:B3hQTKLjKcuwSsT8VwJpR",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Company all hands",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Company all hands

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDj",typeName:"shape"},{x:837.8212080236717,y:379.7812472022469,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:Ew3E_uQg_oIqeazf2vqpP",type:"geo",props:{w:251,h:101.34061312191727,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Bugbashing diagrams V2 with eng team",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Bugbashing diagrams V2 with eng team

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDk",typeName:"shape"},{x:837.8212080236717,y:500.13645302107966,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:Fg4fxWRIxgyovffXhHIzF",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Customer call",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Customer call

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDkV",typeName:"shape"},{x:1154.2427431046506,y:211.51595163729678,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:VvbN_RGjDdrkdA1f5rsRd",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Vendor call",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Vendor call

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDkl",typeName:"shape"},{x:204.97813786171344,y:381.1218603241642,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:2vK8h6FMVleRUW2G9Od19",type:"geo",props:{w:251,h:121.0625,geo:"rectangle",color:"black",labelColor:"black",fill:"semi",dash:"solid",size:"m",font:"draw",text:"Setup a call with our food vendor at the office in SF",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Setup a call with our food vendor at the office in SF

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aDl",typeName:"shape"},{x:204.97813786171344,y:521.1989530210797,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:9SYkhq44JuzFO637hB390",type:"geo",props:{w:250.16487115239204,h:64.78836164651827,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:" Lunch",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

\uD83C\uDF54 Lunch

',shapeColor:"#26A688",strokeWidth:"none"},parentId:"page:page",index:"aDt",typeName:"shape"},{x:515.9398891287151,y:134.56584632459914,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:SDZcV2JidoSxClP0MxiaV",type:"text",props:{color:"black",size:"m",w:261.08443878034683,text:"Tue",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:34,html:'

Tue

',shapeColor:null},parentId:"page:page",index:"aE",typeName:"shape"},{x:199.518354047736,y:134.56584632459914,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:tSOF89upJLNWmMbbVcY6R",type:"text",props:{color:"black",size:"m",w:261.08443878034683,text:"Mon",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:34,html:'

Mon

',shapeColor:null},parentId:"page:page",index:"aF",typeName:"shape"}],assets:[{meta:{},id:"asset:1703535279",type:"image",typeName:"asset",props:{name:"Screen Shot 2024-04-10 at 3.37.50 PM.png",src:"https://cdn-staging.gamma.app/QWjS6fBfpt/b63db3d6baac4d469108cf61a4c7ee71/original/Screen-Shot-2024-04-10-at-3.37.50-PM.png",w:2842,h:1550,mimeType:"image/png",isAnimated:!1}},{meta:{},id:"asset:-1866522948",type:"image",typeName:"asset",props:{name:"tldrawFile",src:"https://cdn-staging.gamma.app/QWjS6fBfpt/c494e974b8cc46b8910df2aa1a4051db/original/tldrawFile.png",w:3841,h:2161,mimeType:"image/png",isAnimated:!1}}],meta:{},width:null,svg:'

Wed

Thu

Fri

Meeting with Jon

Team bonding

Checking emails

HR meetings

Onboarding new hire

Attend CS meeting

Team happy hour

Attend CS meeting

Office tour

1:1 with Zach

Company all hands

Bugbashing diagrams V2 with eng team

Customer call

Vendor call

Setup a call with our food vendor at the office in SF

\uD83C\uDF54 Lunch

Tue

Mon

'}},calendarMonths:{type:"diagram",attrs:{horizontalAlign:null,shapes:[{x:187.0625,y:119.1171875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:hF6E8P7CiXiSsRo7LG0FF",type:"geo",props:{w:419.6875,h:677.9375,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"none"},parentId:"page:page",index:"Zy",typeName:"shape"},{x:621.23828125,y:119.1171875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:taayoSjVZnQxAEAkYzW8F",type:"geo",props:{w:419.6875,h:677.9375,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"none"},parentId:"page:page",index:"Zz",typeName:"shape"},{x:1055.4140625,y:119.1171875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:DogbW2-V83SiEhlezSTF1",type:"geo",props:{w:419.6875,h:677.9375,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"none"},parentId:"page:page",index:"a0",typeName:"shape"},{x:1479.765625,y:227.52734375,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:n-HH4IouUsStSFr3VNbU-",type:"line",parentId:"page:page",index:"a2",props:{dash:"solid",size:"m",color:"black",spline:"line",points:{a1:{id:"a1",index:"a1",x:-4.6640625,y:22115642650533118e-29},a2:{id:"a2",index:"a2",x:-1292.703125,y:2220446049250313e-28}},shapeColor:null,strokeWidth:"none"},typeName:"shape"},{x:201.34708590770333,y:145.867869309553,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:BEBrp9VENbneWCEP9Z57D",type:"text",props:{color:"black",size:"m",w:389.55916409229667,text:"January",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:34,html:'

January

',shapeColor:null},parentId:"page:page",index:"a3",typeName:"shape"},{x:631.6081020625556,y:145.867869309553,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:-3Bu-xyyud5-NY1mEsn_r",type:"text",props:{color:"black",size:"m",w:399.24346043744436,text:"February",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:34,html:'

February

',shapeColor:null},parentId:"page:page",index:"a4",typeName:"shape"},{x:1064.4140625,y:145.867869309553,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:97V6hIrYPl_7kahzLVj4Y",type:"text",props:{color:"black",size:"m",w:397.96463853034425,text:"March",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:34,html:'

March

',shapeColor:null},parentId:"page:page",index:"a5",typeName:"shape"},{x:213.4453125,y:262.6015625,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:hqEIx0gJpckN8eL0a3_eG",type:"geo",props:{w:377.57421875,h:68.80859375,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"Campaign brief",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Campaign brief

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a6",typeName:"shape"},{x:424.8515625,y:350.465234375,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:L4SJqvXoG-EotQtRMTPY8",type:"geo",props:{w:242.98046875,h:68.80859375,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"Brainstorming idea",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Brainstorming idea

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a7",typeName:"shape"},{x:642.359375,y:438.32890625000005,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:5PsZHZLZu4_CVVyhnfMhV",type:"geo",props:{w:317.4921875,h:68.80859375,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"Pitching V1 draft",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Pitching V1 draft

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a8",typeName:"shape"},{x:801.10546875,y:526.192578125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:gaTWbH01oHY5U8i7-0YWM",type:"geo",props:{w:216.140625,h:68.80859375,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"Team sync",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Team sync

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a9",typeName:"shape"},{x:1017.24609375,y:614.05625,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:LTp09wJ7CZ4hmqxK3TqOs",type:"geo",props:{w:216.140625,h:68.80859375,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"Product launch",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

Product launch

',shapeColor:"#26A688",strokeWidth:"none"},parentId:"page:page",index:"aA",typeName:"shape"},{x:1224.703125,y:701.919921875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:YRlBT-re2qFu7J2lowdkX",type:"geo",props:{w:216.140625,h:68.80859375,geo:"rectangle",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"PR push",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

PR push

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"aB",typeName:"shape"}],assets:[],meta:{},width:null,svg:'

January

February

March

Campaign brief

Brainstorming idea

Pitching V1 draft

Team sync

Product launch

PR push

'}},concentricCircles:{type:"diagram",attrs:{horizontalAlign:"center",shapes:[{x:565.8710406141417,y:267.2348052328804,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:TAw6_9rfNRYvwwWYH_HCE",type:"geo",props:{w:477.70836857906545,h:477.70836857906545,geo:"ellipse",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a1",typeName:"shape"},{x:616.0939715727751,y:367.685804457496,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:EgzihrX9ISnR1IDnH3Nb-",type:"geo",props:{w:377.2573693544499,h:377.2573693544499,geo:"ellipse",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a2",typeName:"shape"},{x:668.9469658115557,y:473.48237590821486,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:PjG3dFUaDsYRxpsyfV9pW",type:"geo",props:{w:271.5513808768887,h:271.5513808768887,geo:"ellipse",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a3",typeName:"shape"},{x:710.2141277616566,y:556.2474435629489,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:q-kyMkxhO2b6WeTH0ets_",type:"geo",props:{w:189.21399728645815,h:189.21399728645815,geo:"ellipse",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:"#26A688",strokeWidth:"sm"},parentId:"page:page",index:"a4",typeName:"shape"},{x:464.90514248458214,y:65.35157205630884,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:j5viwZdfHENtGXtzpl0By",type:"geo",props:{w:679.628218169672,h:679.628218169672,geo:"ellipse",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a0",typeName:"shape"},{x:510.91801733541865,y:157.35060141748204,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:ktAwuZYMrly1jH7bcYmPU",type:"geo",props:{w:587.634481733614,h:587.634481733614,geo:"ellipse",color:"black",labelColor:"black",fill:"none",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a0V",typeName:"shape"},{x:725.4037617637376,y:93.6328125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:arpSUqzdolhE3v92x2Hlg",type:"text",props:{color:"black",size:"m",w:159,text:"",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:28,html:'

Strangers

',shapeColor:null},parentId:"page:page",index:"a6",typeName:"shape"},{x:698.7226562500001,y:191.5703125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:p4dDCuUjLEG9hLXieB7uX",type:"text",props:{color:"black",size:"m",w:211.83203125000003,text:"",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:28,html:'

Community

',shapeColor:null},parentId:"page:page",index:"a7",typeName:"shape"},{x:698.7226562500001,y:300.83203125,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:IQ2anr8KXqvDn1DTJJIM1",type:"text",props:{color:"black",size:"m",w:212,text:"",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:28,html:'

Acquaintances

',shapeColor:null},parentId:"page:page",index:"a8",typeName:"shape"},{x:698.7226562500001,y:410.09375,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:O77tcKAFokcE_JogX_h3n",type:"text",props:{color:"black",size:"m",w:212,text:"",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:28,html:'

Friends

',shapeColor:null},parentId:"page:page",index:"a9",typeName:"shape"},{x:698.7226562500001,y:497.0234375,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:Ku24cDrP5-0A12pFZdch1",type:"text",props:{color:"black",size:"m",w:212,text:"",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:28,html:'

Family

',shapeColor:null},parentId:"page:page",index:"aA",typeName:"shape"},{x:698.7226562500001,y:628.6171875,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:Bd8YnNb0vDeKdtlRMcNh_",type:"text",props:{color:"black",size:"m",w:212,text:"",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:27,html:'

Me

',shapeColor:"#FFFFFF"},parentId:"page:page",index:"aB",typeName:"shape"}],assets:[{meta:{},id:"asset:1250396056",type:"image",typeName:"asset",props:{name:"tldrawFile",src:"https://cdn-staging.gamma.app/QWjS6fBfpt/1503bafa04414cc2a7b9848c75a23885/original/tldrawFile.png",w:800,h:801,mimeType:"image/png",isAnimated:!1}}],meta:{},width:360,svg:'

Strangers

Community

Acquaintances

Friends

Family

Me

'}},targetCircles:{type:"diagram",attrs:{horizontalAlign:"center",shapes:[{x:929.6197161942252,y:155.0916582850458,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:Lyhoe8Jk5MAMoudOizb8X",type:"geo",props:{w:500.14804571219815,h:500.14804571219815,geo:"ellipse",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a0G",typeName:"shape"},{x:967.92743672945,y:193.45976889185556,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:RYOvVH5HKvjk5GXZojXEJ",type:"geo",props:{w:423.4118244985782,h:423.4118244985782,geo:"ellipse",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a0l",typeName:"shape"},{x:1007.5906901264586,y:233.06263221727892,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:guJhyRC2_2GgZ9f0HcNJR",type:"geo",props:{w:344.20609784773154,h:344.20609784773154,geo:"ellipse",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a1V",typeName:"shape"},{x:1043.7799729004403,y:269.2519149912604,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:seEkM5XtC9yIw7hoXfdbS",type:"geo",props:{w:271.8275322997684,h:271.8275322997684,geo:"ellipse",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a2V",typeName:"shape"},{x:1081.7319672065987,y:307.3344023477454,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:NS2ahjw0mGlpg-PMYOxM8",type:"geo",props:{w:195.6625575867985,h:195.6625575867985,geo:"ellipse",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:null,strokeWidth:"sm"},parentId:"page:page",index:"a3V",typeName:"shape"},{x:1115.50785950286,y:340.94563257104426,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:3f1yjdcch_VMlWXK600PT",type:"geo",props:{w:128.4400971402006,h:128.4400971402006,geo:"ellipse",color:"black",labelColor:"black",fill:"solid",dash:"solid",size:"m",font:"draw",text:"",align:"middle",verticalAlign:"middle",growY:0,url:"",html:'

',shapeColor:"#26A688",strokeWidth:"sm"},parentId:"page:page",index:"a4V",typeName:"shape"},{x:1073.6937390503244,y:381.6656811411451,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:1FLv65NIvaurbbxTQrE18",type:"text",props:{color:"black",size:"m",w:212,text:"Me",font:"draw",align:"middle",autoSize:!1,scale:1,h:20,growY:27,html:'

Me

',shapeColor:"#FFFFFF"},parentId:"page:page",index:"aB",typeName:"shape"},{x:1381.0026472829704,y:173.17393949526377,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:Q6dHtLEQiLE4grg0RCM-A",type:"line",parentId:"page:page",index:"aC",props:{dash:"solid",size:"m",color:"black",spline:"line",points:{a1:{id:"a1",index:"a1",x:2.417216937863941,y:7.723304968297555},a2:{id:"a2",index:"a2",x:-52.226471674030236,y:48.30663418059406}},shapeColor:null,strokeWidth:"sm"},typeName:"shape"},{x:1396.40422015788,y:245.48057367585784,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:V6TsnoH4I7lC4eFh_jCVf",type:"line",parentId:"page:page",index:"aCV",props:{dash:"solid",size:"m",color:"black",spline:"line",points:{a1:{id:"a1",index:"a1",x:48.001155258881184,y:41.665293041944466},a2:{id:"a2",index:"a2",x:-47.682312332765534,y:66.29026038484135}},shapeColor:null,strokeWidth:"sm"},typeName:"shape"},{x:1418.8041070476638,y:554.4103614129623,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:Z7iFyapJSWnC-Nj48trDz",type:"line",parentId:"page:page",index:"aCd",props:{dash:"solid",size:"m",color:"black",spline:"line",points:{a1:{id:"a1",index:"a1",x:28.116150018295414,y:-27.85190422662322},a2:{id:"a2",index:"a2",x:-138.26659908197,y:-91.24836881350053}},shapeColor:null,strokeWidth:"sm"},typeName:"shape"},{x:1396.40422015788,y:405.1656811411451,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:UyPPQxh5Izzrta_PeC4Lv",type:"line",parentId:"page:page",index:"aCl",props:{dash:"solid",size:"m",color:"black",spline:"line",points:{a1:{id:"a1",index:"a1",x:94.52397902306642,y:3674838211509268e-29},a2:{id:"a2",index:"a2",x:-62.28449928723883,y:3674838211509268e-29}},shapeColor:null,strokeWidth:"sm"},typeName:"shape"},{x:1396.40422015788,y:680.9410126688012,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:YvmG2cbsMv-yBAjUCLAZV",type:"line",parentId:"page:page",index:"aD",props:{dash:"solid",size:"m",color:"black",spline:"line",points:{a1:{id:"a1",index:"a1",x:-30.33301659894073,y:-34.31453399190673},a2:{id:"a2",index:"a2",x:-187.1016230443878,y:-198.11935311752904}},shapeColor:null,strokeWidth:"sm"},typeName:"shape"},{x:1456.428646134135,y:520.7240691140834,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:EdTs6rzP02YRCn-NSSouG",type:"text",props:{color:"black",size:"m",w:190.61066381032765,text:"Friends",font:"draw",align:"start",autoSize:!1,scale:1,h:44,growY:0,html:'

Friends

',shapeColor:null},parentId:"page:page",index:"aE",typeName:"shape"},{x:1373.8179823238074,y:633.1902718076452,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:9DzQSxc3Xru2fKGSdFx16",type:"text",props:{color:"black",size:"m",w:191,text:"Family",font:"draw",align:"start",autoSize:!1,scale:1,h:44,growY:0,html:'

Family

',shapeColor:null},parentId:"page:page",index:"aF",typeName:"shape"},{x:1496.9281991809464,y:383.1656811411449,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:VKIjJjszvAlrkJQJfGUV1",type:"text",props:{color:"black",size:"m",w:204.36525326738322,text:"Acquaintances",font:"draw",align:"start",autoSize:!1,scale:1,h:44,growY:0,html:'

Acquaintances

',shapeColor:null},parentId:"page:page",index:"aG",typeName:"shape"},{x:1451.2460195004435,y:263.4599680925235,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:V6a9zGihrEPKbWp0WyYFu",type:"text",props:{color:"black",size:"m",w:204.36525326738322,text:"Community",font:"draw",align:"start",autoSize:!1,scale:1,h:44,growY:0,html:'

Community

',shapeColor:null},parentId:"page:page",index:"aH",typeName:"shape"},{x:1389.4198642208344,y:155.14109047464459,rotation:0,isLocked:!1,opacity:1,meta:{},id:"shape:tneIatSl5yj2J6kQLD4Hy",type:"text",props:{color:"black",size:"m",w:204.36525326738322,text:"Strangers",font:"draw",align:"start",autoSize:!1,scale:1,h:44,growY:0,html:'

Strangers

',shapeColor:null},parentId:"page:page",index:"aI",typeName:"shape"}],assets:[{meta:{},id:"asset:1250396056",type:"image",typeName:"asset",props:{name:"tldrawFile",src:"https://cdn-staging.gamma.app/QWjS6fBfpt/1503bafa04414cc2a7b9848c75a23885/original/tldrawFile.png",w:800,h:801,mimeType:"image/png",isAnimated:!1}}],meta:{},width:534.2222222222222,svg:'

Me

Friends

Family

Acquaintances

Community

Strangers

'}}},A={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/Concentric.2b092fc4.svg",height:96,width:253,blurWidth:0,blurHeight:0},C={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/Flywheel.fd4813bb.svg",height:96,width:254,blurWidth:0,blurHeight:0},z={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/Gantt.9e741fcd.svg",height:96,width:253,blurWidth:0,blurHeight:0},I={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/Kanban.004b9ebf.svg",height:96,width:253,blurWidth:0,blurHeight:0},j={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/Quadrants.61681555.svg",height:96,width:254,blurWidth:0,blurHeight:0},F={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/Target.99d9a5a8.svg",height:96,width:253,blurWidth:0,blurHeight:0},B={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/Venn.7a87e038.svg",height:96,width:254,blurWidth:0,blurHeight:0},R=()=>[{key:"diagram",name:()=>o.Ru._({id:"G1q1hG"}),keywords:["sketch","drawing","shapes","diagram","canvas","freeform"],shortcut:"/diagram"},{key:"flywheel",name:()=>o.Ru._({id:"6BBMcV"}),keywords:["cycle","circle","diagram","flywheel"],previewImage:C,icon:a.yNr},{key:"quadrant",name:()=>o.Ru._({id:"tmk28W"}),keywords:["matrix","quadrant","diagram","2x2"],previewImage:j,icon:a.YOd},{key:"venn",name:()=>o.Ru._({id:"z5TX2d"}),previewImage:B,icon:a.cvw,keywords:["venn","diagram"]},{key:"targetCircles",name:()=>o.Ru._({id:"s07vVU"}),keywords:["target","circles","nested","concentric","diagram","bullseye"],icon:a.pvD,previewImage:F},{key:"concentricCircles",name:()=>o.Ru._({id:"SqseBa"}),keywords:["concentric","circles","diagram"],icon:a.ppD,previewImage:A},{key:"calendarWeek",name:()=>o.Ru._({id:"ToE1YL"}),keywords:["week","days","calendar","diagram","kanban","schedule","timeline"],icon:a.aXh,previewImage:I},{key:"calendarMonths",name:()=>o.Ru._({id:"jIipv0"}),keywords:["month","days","calendar","diagram","kanban","schedule","gantt chart","timeline"],icon:a.nKW,previewImage:z}].map(e=>{let t="diagram"===e.key?{type:"diagram",attrs:{}}:S[e.key];return{nodeName:"diagram",icon:a.qTS,...e,execute:e=>{let l=(0,x.rZ)(),a=w()(t);a.attrs.id=l,(0,x.CD)(l,!0),e.commands.insertContent(a)},dragStartFn:e=>{let l=(0,x.rZ)(),a=w()(t);a.attrs.id=l,(0,x.CD)(l,!0),(0,b.fS)(e,a)}}}).filter(e=>!!e);var _=l(69180),M=l(49572),E=l(60443),T=l(80917),O=l(83380),P=l(62216);let N=()=>Object.entries(P.Fn).filter(e=>{let[t,l]=e;return l.nodeName&&!l.disabled}).map(e=>{let[t,l]=e;return{key:t,name:l.label,nodeName:l.nodeName||"mediaPlaceholder",execute:e=>e.commands.insertMediaBlock(l.key),dragStartFn:e=>{(0,T.f)(e,{type:"mediaPlaceholder",attrs:{source:l.key}})},dragEndFn:()=>{(0,O.G)()},description:l.description,icon:l.icon,image:l.image,testId:l.key,keywords:l.keywords,featureFlag:l.featureFlag,priority:l.priority,categories:l.categories,checkDisabled:l.checkDisabled,badge:l.badge}});var D=l(59277),L=l(44275),W=l(46896);let U=()=>[{key:"toggle",name:()=>o.Ru._({id:"JFciKP"}),description:()=>o.Ru._({id:"Woijyj"}),keywords:["toggle","expand","collapse","disclosure","details"],nodeName:"toggle",icon:a.ijD,execute:e=>{let t=(0,L.n)();(0,W.bG)(t,!0),e.chain().insertContent({...(0,c.G)().toggle,attrs:{id:t}}).selectInsertedNode().run()},dragStartFn:e=>{let t=(0,L.n)();(0,W.bG)(t,!0),(0,T.f)(e,{...(0,c.G)().toggle,attrs:{id:t}})}}];var G=l(95580);let H=()=>[{key:"insertCardAfter",name:()=>o.Ru._({id:"coNSGP"}),nodeName:"card",icon:a.UiS,execute:e=>e.commands.insertCardAfter(),checkDisabled:e=>!e.schema.nodes.card,keywords:["card","below","after","new"]},{key:"insertCardInside",name:()=>o.Ru._({id:"lOmsEK"}),nodeName:"card",icon:a.ViY,execute:e=>e.commands.insertNestedCard(),checkDisabled:e=>!e.schema.nodes.card,keywords:["nested","card","sub"]},{key:"splitCard",name:()=>o.Ru._({id:"ONXbeB"}),nodeName:"card",icon:a.ufr,shortcut:"***",execute:e=>e.commands.splitCardAtSelection(),checkDisabled:e=>!e.schema.nodes.card,dragStartFn:e=>{(0,T.f)(e,(0,c.G)().normalText)},dragEndFn:e=>{e.chain().splitCardAtSelection().focusDelayed().run()},keywords:["split"]},{key:"title",name:()=>o.Ru._({id:"MHrjPM"}),nodeName:"title",icon:n.jwR,shortcut:"! Title",execute:e=>{e.chain().focus().setFontSize("title").run()},checkDisabled:(e,t)=>!!t&&!(0,G.zi)(e,"title"),keywords:["title","large"]},{key:"display",name:()=>o.Ru._({id:"Xm/s+u"}),nodeName:"title",icon:n.jwR,shortcut:"!! Title",execute:e=>{e.chain().focus().setFontSize("titleLg").run()},checkDisabled:(e,t)=>!!t&&!(0,G.zi)(e,"title"),keywords:["display","large"]},{key:"monster",name:()=>o.Ru._({id:"bSLwU6"}),nodeName:"title",icon:n.jwR,shortcut:"!!! Ahhhh",execute:e=>{e.chain().focus().setFontSize("titleXl").run()},checkDisabled:(e,t)=>!!t&&!(0,G.zi)(e,"title"),keywords:["monster","huge"]},{key:"h1",name:()=>o.Ru._({id:"lXKZGw"}),nodeName:"heading",icon:a.RDv,shortcut:"# Heading 1",execute:e=>{e.chain().focus().setFontSize("h1").run()},checkDisabled:(e,t)=>!!t&&!(0,G.zi)(e,"heading"),keywords:["heading","h1"]},{key:"smallText",name:()=>o.Ru._({id:"LBkaLa"}),nodeName:"paragraph",icon:n.jwR,shortcut:"/sm",execute:e=>{e.chain().focus().setFontSize("sm").run()},checkDisabled:(e,t)=>!!t&&!(0,G.zi)(e,"body"),keywords:["sm","small","paragraph"]},{key:"normalText",name:()=>o.Ru._({id:"5NwZ8t"}),nodeName:"paragraph",icon:a.jwR,shortcut:"/md",execute:e=>{e.chain().focus().setFontSize("md").run()},checkDisabled:(e,t)=>!!t&&!(0,G.zi)(e,"body"),keywords:["md","normal","paragraph","default","body"]},{key:"largeText",name:()=>o.Ru._({id:"0Sz17G"}),nodeName:"paragraph",icon:a.jwR,shortcut:"/lg",execute:e=>{e.chain().focus().setFontSize("lg").run()},checkDisabled:(e,t)=>!!t&&!(0,G.zi)(e,"body"),keywords:["lg","large","paragraph"]},{key:"h2",name:()=>o.Ru._({id:"El7NbA"}),nodeName:"heading",icon:a.K1h,shortcut:"## Heading 2",execute:e=>{e.chain().focus().setFontSize("h2").run()},checkDisabled:(e,t)=>!!t&&!(0,G.zi)(e,"heading"),keywords:["heading","h2"]},{key:"h3",name:()=>o.Ru._({id:"SFN6dN"}),nodeName:"heading",icon:a.Dn6,shortcut:"### Heading 3",execute:e=>{e.chain().focus().setFontSize("h3").run()},checkDisabled:(e,t)=>!!t&&!(0,G.zi)(e,"heading"),keywords:["heading","h3"]},{key:"h4",name:()=>o.Ru._({id:"nJeKmw"}),nodeName:"heading",icon:a.wLS,shortcut:"#### Heading 4",execute:e=>{e.chain().focus().setFontSize("h4").run()},checkDisabled:(e,t)=>!!t&&!(0,G.zi)(e,"heading"),keywords:["heading","h4"]},{key:"openEmojiPicker",name:()=>o.Ru._({id:"tKlWWY"}),nodeName:"emoji",icon:n.H82,execute:e=>e.commands.openEmojiPicker(),keywords:["symbol","emoji"]},{key:"bulletedList",name:()=>o.Ru._({id:"ynb7Kh"}),nodeName:E.e.Bullet,icon:a.pch,shortcut:"- Item",execute:e=>{e.chain().setListItems({variant:E.e.Bullet}).selectInsertedNode().run()},checkDisabled:(e,t)=>!!t&&!(0,G.aq)(e,E.e.Bullet),keywords:["bullets","unordered","ul","list"]},{key:"numberedList",name:()=>o.Ru._({id:"M3G9ZD"}),nodeName:E.e.Numbered,icon:a.Tsj,shortcut:"1. Item",execute:e=>{e.chain().setListItems({variant:E.e.Numbered}).selectInsertedNode().run()},checkDisabled:(e,t)=>!!t&&!(0,G.aq)(e,E.e.Numbered),keywords:["numbers","numbered","ordered","ol","list"]},{key:"todoList",name:()=>o.Ru._({id:"rCIbrq"}),nodeName:E.e.Todo,icon:a.AgW,shortcut:"[] Item",execute:e=>{e.chain().setListItems({variant:E.e.Todo}).selectInsertedNode().run()},checkDisabled:(e,t)=>!!t&&!(0,G.aq)(e,E.e.Todo),keywords:["todo","task","checkbox","list","checklist"]},{key:"blockquote",name:()=>o.Ru._({id:"OLMhPm"}),nodeName:"blockquote",icon:a.R9H,shortcut:"> Quote",execute:e=>e.chain().focus().toggleBlockquote().run(),keywords:["quote","blockquote"]},...(0,g.A3)(),{key:"buttonGroup",name:()=>o.Ru._({id:"hxBFty"}),nodeName:"buttonGroup",icon:a.A8r,execute:e=>e.commands.insertContentAndSelect((0,c.G)().buttonGroup),description:()=>o.Ru._({id:"IvDo5O"}),keywords:["button","link","click","call to action"]},{key:"codeBlock",name:()=>o.Ru._({id:"4A3Yzu"}),nodeName:"codeBlock",icon:a.jTw,shortcut:"```",execute:e=>{e.chain().focus().setCodeBlock().run()},keywords:["code","block","codeblock"]},{key:"mathBlock",name:()=>o.Ru._({id:"TI6GY9"}),nodeName:"math_display",featureFlag:"math",icon:a.YLF,keywords:["math","equation","latex","katex"],execute:e=>e.chain().focus().insertContent((0,c.G)().mathBlock).run(),dragEndFn:()=>{},description:()=>o.Ru._({id:"mBJFYh"})},{key:"mathInline",name:()=>o.Ru._({id:"qc9cD+"}),featureFlag:"math",nodeName:"math_inline",icon:a.Dkf,keywords:["math","equation","latex","katex"],execute:e=>e.chain().focus().insertMathInline().run(),shortcut:"$x^2$ "},{key:"table2",name:()=>o.Ru._({id:"3gSgpL"}),keywords:["table","grid","data"],nodeName:"table",shortcut:"/table",icon:a.w97,execute:e=>e.commands.insertTable({rows:2,cols:2,withHeaderRow:!1})},{key:"table3",name:()=>o.Ru._({id:"ZjN50+"}),keywords:["table","grid","data"],nodeName:"table",icon:a.w97,execute:e=>e.commands.insertTable({rows:3,cols:3,withHeaderRow:!1})},{key:"table4",name:()=>o.Ru._({id:"64S2d0"}),keywords:["table","grid","data"],nodeName:"table",icon:a.w97,execute:e=>e.commands.insertTable({rows:4,cols:4,withHeaderRow:!1})},{key:"columns2",name:()=>o.Ru._({id:"vVJ2/D"}),keywords:["columns","layout","grid","two"],nodeName:"gridLayout",shortcut:"/columns",icon:a.oZz,execute:e=>e.commands.insertLayout(2)},{key:"columns3",name:()=>o.Ru._({id:"OnuuaA"}),keywords:["columns","layout","grid","three"],nodeName:"gridLayout",icon:a.oZz,execute:e=>e.commands.insertLayout(3)},{key:"columns4",name:()=>o.Ru._({id:"hexbw8"}),keywords:["columns","layout","grid","four"],nodeName:"gridLayout",icon:a.oZz,execute:e=>e.commands.insertLayout(4)},{key:"contributors",name:()=>o.Ru._({id:"YqsXfH"}),nodeName:"contributors",icon:a.hP6,execute:e=>e.commands.insertContentAndSelect((0,c.G)().contributors),keywords:["contributors","authors","credits"]},{key:"divider",name:()=>o.Ru._({id:"R8AthW"}),nodeName:"divider",icon:a.adM,keywords:["hr","rule","line","divider"],shortcut:"---",execute:e=>e.commands.insertContentAndSelect((0,c.G)().divider)},{key:"tableOfContents",name:()=>o.Ru._({id:"9FTolD"}),featureFlag:"tableOfContentsBlock",nodeName:"tableOfContents",icon:a.o97,execute:e=>e.commands.insertContentAndSelect((0,c.G)().tableOfContents,-1),keywords:["toc","contents"]},{key:"gallery",name:()=>o.Ru._({id:"U+kFad"}),description:()=>o.Ru._({id:"GqdREM"}),nodeName:"gallery",shortcut:"/gallery",icon:a.Qyz,keywords:["gallery","image","layout","filmstrip","carousel"],execute:e=>e.commands.insertContentAndSelect((0,c.G)().gallery)},{key:"logo",name:()=>o.Ru._({id:"YkFus/"}),description:()=>o.Ru._({id:"YRtGxa"}),nodeName:"gallery",shortcut:"/logos",icon:a.a8v,keywords:["logo","logos","gallery"],execute:e=>e.chain().insertContentAndSelect((0,c.G)().logoGallery).run()},{key:"footnote",name:()=>o.Ru._({id:"dOxPd4"}),nodeName:"footnote",shortcut:"^note^",icon:a.sxe,execute:e=>{let t=(0,_.pN)(),l={...(0,c.G)().footnote,attrs:{noteId:t}};(0,_.Wj)(t,!0),e.commands.insertContent(l)},dragStartFn:e=>{let t=(0,_.pN)(),l={...(0,c.G)().footnote,attrs:{noteId:t}};(0,_.Wj)(t,!0),(0,T.f)(e,l)},checkDisabled:M.Q,keywords:["footnote","note","reference"]},...v(),...U(),...N(),...(0,D.WP)(),...(0,D.Wg)(),...R(),...p()],V=()=>r()(H(),e=>e.priority),q=()=>d()(H(),"key"),K=function(e,t){var l;let a=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return!!(t.needsConnection&&n||t.featureFlag&&!u.of.get(t.featureFlag)||(null===(l=t.checkDisabled)||void 0===l?void 0:l.call(t,e,a)))||!!a&&!(0,G.Bi)(e,t.nodeName)}},45709:(e,t,l)=>{"use strict";l.d(t,{G:()=>s});var a=l(12327),n=l(16262),o=l(42717),i=l(51436);let r=()=>a.Ru._({id:"9FTolD"}),s=()=>({title:{type:"title",attrs:{level:1}},h1:{type:"heading",attrs:{level:1}},normalText:{type:"paragraph"},h2:{type:"heading",attrs:{level:2}},h3:{type:"heading",attrs:{level:3}},h4:{type:"heading",attrs:{level:4}},bulletedList:{type:"bullet",attrs:{indent:0}},numberedList:{type:"numbered",attrs:{indent:0}},todoList:{type:"todo",attrs:{indent:0}},blockquote:{type:"blockquote",content:[{type:"paragraph"}]},codeBlock:{type:"codeBlock"},mathBlock:{type:"math_display"},button:{type:"button",content:[{type:"text",text:a.Ru._({id:"uWe4QF"})}]},buttonGroup:{type:"buttonGroup",content:[{type:"button",content:[{type:"text",text:a.Ru._({id:"uWe4QF"})}]}]},table2:{type:"table",content:[{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]}]},table3:{type:"table",content:[{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]}]},table4:{type:"table",content:[{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]},{type:"tableRow",content:[{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]},{type:"tableCell",attrs:{colspan:1,rowspan:1},content:[{type:"paragraph"}]}]}]},columns2:{type:"gridLayout",content:[{type:"gridCell",content:[{type:"paragraph"}]},{type:"gridCell",content:[{type:"paragraph"}]}]},columns3:{type:"gridLayout",content:[{type:"gridCell",content:[{type:"paragraph"}]},{type:"gridCell",content:[{type:"paragraph"}]},{type:"gridCell",content:[{type:"paragraph"}]}]},columns4:{type:"gridLayout",content:[{type:"gridCell",content:[{type:"paragraph"}]},{type:"gridCell",content:[{type:"paragraph"}]},{type:"gridCell",content:[{type:"paragraph"}]},{type:"gridCell",content:[{type:"paragraph"}]}]},insertCardInside:{type:"card",content:[{type:"cardLayoutItem",attrs:{itemId:"body",background:{}},content:[{type:"heading",attrs:{level:1}}]}]},aiCardAfter:{type:"card",attrs:{generatorInput:o.O},content:[{type:"paragraph"}]},footnote:{type:"footnote",content:[{type:"paragraph"}]},contributors:{type:"contributors"},divider:{type:"divider"},tableOfContents:[{type:"heading",attrs:{level:3},content:[{type:"text",text:r()}]},{type:"tableOfContents"}],gallery:{type:"gallery",content:[]},logoGallery:{type:"gallery",attrs:{layout:"logo"},content:[]},...(0,i.s2)(),...n.EW,toggle:{type:"toggle",content:[{type:"toggleSummary"},{type:"paragraph"}]}})},77256:(e,t,l)=>{"use strict";l.d(t,{E1:()=>a.E1,GO:()=>o.G,Jb:()=>n.J,Vo:()=>a.Vo,fS:()=>n.f,gT:()=>a.gT});var a=l(89284),n=l(80917),o=l(45709)},33242:(e,t,l)=>{"use strict";l.d(t,{H:()=>a});let a="setSelectionOrigin"},80917:(e,t,l)=>{"use strict";l.d(t,{J:()=>i,f:()=>o});var a=l(69e3),n=l(10458);let o=(e,t)=>{let l=Array.isArray(t)?t:[t],n=a.Ji.fromJSON(e.schema,{content:l});e.view.dragging={slice:n,move:!0},e.commands.setTextSelection(e.state.selection.from)},i=(e,t)=>{n.zS.track(n.VV.NODE_INSERTED,{node_name:e.nodeName,command:e.key,method:t}),"card"===e.nodeName&&n.zS.track(n.VV.CARD_CREATED,{method:t,command:e.key})}},83707:(e,t,l)=>{"use strict";l.d(t,{G:()=>M});var a=l(31085),n=l(14608),o=l(59742),i=l(9746),r=l(34363),s=l(18658),d=l(80532),u=l(65446),c=l(38735),m=l(12761),f=l(52177),p=l(81570),g=l(14041),h=l(91559),b=l(4977),y=l(93090);let v=e=>{let{currentAttributes:t,updateAttributes:l,editor:a,isMounted:n}=e,o=(0,g.useRef)({currentAttributes:t,updateAttributes:l,sourceKey:t.source});o.current.currentAttributes=t,o.current.updateAttributes=l,(0,g.useEffect)(()=>{o.current.sourceKey=o.current.currentAttributes.source},[t.tempUrl,t.src]),(0,g.useEffect)(()=>{if(!a||n)return;let{src:e,tempUrl:t,uploadStatus:l}=o.current.currentAttributes;t&&!e&&l!==b.A.Uploading&&(console.log("[useUploadOnUnmount] uploading tempUrl:",t),o.current.updateAttributes({uploadStatus:b.A.Uploading,source:o.current.sourceKey}),(0,y.XE)(a,t))},[a,n])};var k=l(62911),w=l(88957),x=l(45776),S=l(62216),A=l(73818),C=l(36830),z=l(95580),I=l(2696),j=l(61690),F=l(46511),B=l(8077),R=l(83380),_=l(91500);let M=g.memo(e=>{let{editor:t}=e;(0,I.lC)(t);let l=(0,I.CJ)(t),b=(0,R.f)(),y=(0,w.GV)(j.nD),M=t.state.selection,E=(0,g.useMemo)(()=>(0,_.Am)(t,M),[t,M]),T=null==E?void 0:E.attrs.id,O=(0,w.GV)((0,x.No)(T||"")),{currentMediaDrawerSourceKey:P,setMediaDrawerSourceKeyAction:N,isQuickAction:D}=(0,A.Bz)(),L=S.Fn[P],{isConnected:W}=(0,h.u)(),U=!!(W||L.availableOffline),G=(0,w.GV)(j.rp),H=E&&(0,_.Nx)(t,E.type),V=l&&!!(G&&H&&y),q=(0,g.useRef)(null),K=(0,g.useCallback)(()=>{b({isOpen:!1}),M instanceof p.nh&&t.chain().selectNodeAtPos(M.from,!1).focus().run()},[t,M,b]),J=(0,C.N)(t);(0,g.useEffect)(()=>{H||b({isOpen:!1})},[H,b]),(0,g.useEffect)(()=>{V&&setTimeout(()=>{if(!q.current||!U)return;let e=(0,c.ep)(q.current);e&&!(e.length<1)&&(0,m.X)(e[0],{nextTick:!0})},100)},[U,V,t]),(0,g.useEffect)(()=>{E&&(0,_.Nx)(t,E.type)&&(0,z.We)(t)&&!D&&N(E.attrs.source||P)},[E,t,N,P,D]);let $=(0,g.useCallback)(e=>{O&&x.RR.emit("cancelRemoveBg",{id:T||""}),(0,_.vI)({editor:t,selection:M,sourceKey:P,attrs:e,resizeToFit:L.resizeToFit})},[t,O,P,M,T,L.resizeToFit]),Q=(null==E?void 0:E.attrs)||{};v({currentAttributes:Q,updateAttributes:$,editor:t,isMounted:V});let Y=(0,g.useCallback)(()=>{(0,_.vI)({editor:t,selection:M,sourceKey:P,attrs:{source:P},nodeName:"mediaPlaceholder",resetAttrs:!0})},[P,M,t]),X=(0,F.o)(),Z=(null==E?void 0:E.editType)||"node",ee=(0,g.useCallback)(e=>(null==E?void 0:E.mediaType)==="embed"?"embed"===e.nodeName||"video"===e.nodeName:(null==E?void 0:E.mediaType)==="image"?"image"===e.nodeName:!!e.nodeName,[E]),et=S.ez[P];return(0,a.jsxs)(n._,{isOpen:V,onClose:K,size:X,trapFocus:!1,blockScrollOnMount:!1,children:[(0,a.jsx)(o.m,{background:"none"}),(0,a.jsxs)(i.z,{onKeyDown:J,"data-in-editor-focus":!0,"data-testid":"media-drawer","data-test-media-source":P,children:[(0,a.jsx)(r.r,{pl:10,children:(0,a.jsx)(f.x6,{id:"xYilR2"})}),(0,a.jsxs)(s.c,{sx:{scrollbarGutter:"stable both-edges"},children:[(0,a.jsx)(k.r,{isConnected:U,description:(0,a.jsx)(f.x6,{id:"2y7sUG"}),mb:6}),(0,a.jsx)(B.H,{currentSource:L,onChange:e=>N(e,!0),isValidSource:ee}),L&&(0,a.jsx)(d.az,{ref:q,opacity:U?1:.4,pointerEvents:U?"initial":"none",children:(0,a.jsx)(et,{editor:t,updateAttributes:$,currentAttributes:Q,resetToPlaceholder:Y,editType:Z})})]}),(0,a.jsx)(u.s,{"data-testid":"media-drawer-close"})]})]})});M.displayName="MediaDrawer"},8077:(e,t,l)=>{"use strict";l.d(t,{H:()=>k});var a=l(31085),n=l(63341),o=l(18528),i=l(80853),r=l(18651),s=l(80532),d=l(40173),u=l(72821),c=l(48310),m=l(33473),f=l(25420),p=l(27670),g=l(20501),h=l(24221),b=l(14041),y=l(65998),v=l(62216);let k=b.memo(e=>{var t;let{currentSource:l,onChange:b,isValidSource:k}=e,w=null==l?void 0:null===(t=l.image)||void 0===t?void 0:t.src,x=(0,y.mt)();return(0,a.jsxs)(n.W,{children:[(0,a.jsx)(o.I,{as:i.$,w:"100%",textAlign:"start",rightIcon:(0,a.jsx)(h.g,{icon:g.Jt$}),leftIcon:w?(0,a.jsx)(r._,{h:"1em",w:"1em",objectFit:"cover",src:w}):(null==l?void 0:l.icon)?(0,a.jsx)(h.g,{icon:null==l?void 0:l.icon,color:"var(--chakra-colors-trueblue-600)",fixedWidth:!0}):void 0,mb:4,"data-testid":"media-drawer-menu-button",children:(0,a.jsx)(s.az,{noOfLines:1,wordBreak:"break-all",overflowX:"hidden",textOverflow:"ellipsis",children:(null==l?void 0:l.label())||"Source"})}),(0,a.jsx)(d.Z,{children:(0,a.jsx)(u.c,{zIndex:"modalPopover",maxH:"60vh",overflowY:"auto",pos:"relative","data-media-drawer-menu":!0,children:Object.entries(v.jU).map(e=>{var t;let[n,o]=e,i=o.filter(e=>!(e.checkDisabled&&e.checkDisabled())&&!e.disabled&&(!e.featureFlag||!!x[e.featureFlag])&&k(e));return 0===i.length?null:(0,a.jsx)(c.i,{title:null!==(t=v.K4[n]())&&void 0!==t?t:n,type:"radio",onChange:b,value:null==l?void 0:l.key,children:i.map(e=>{let{label:t,key:l,icon:n,image:o,badge:i}=e;return(0,a.jsx)(m.k,{value:l,children:(0,a.jsxs)(f.s,{direction:"row",align:"center",children:[o?(0,a.jsx)(r._,{display:"inline",marginInlineEnd:2,h:"1em",w:"1em",objectFit:"contain",src:o.src}):n?(0,a.jsx)(s.az,{display:"inline",marginInlineEnd:2,color:"trueblue.600",children:(0,a.jsx)(h.g,{icon:n})}):(0,a.jsx)(a.Fragment,{}),t(),i&&(0,a.jsx)(p.E,{marginInlineStart:2,colorScheme:"green",children:i()})]})},l)})},n)})})})]})});k.displayName="MediaDrawerMenu"},95709:(e,t,l)=>{"use strict";l.d(t,{Hy:()=>r,Pj:()=>s,gA:()=>u,kW:()=>d,st:()=>i});var a=l(8796);let n={currentSourceKey:"image.ai-generated",overrideDefault:!1},o=(0,a.Z0)({name:"MediaDrawer",initialState:n,reducers:{setCurrentSourceKey(e,t){e.currentSourceKey=t.payload.sourceKey,void 0!==t.payload.overrideDefault?e.overrideDefault=t.payload.overrideDefault:e.overrideDefault=!1},resetCurrentSourceKey(e){e.currentSourceKey=n.currentSourceKey,e.overrideDefault=n.overrideDefault}}}),{setCurrentSourceKey:i,resetCurrentSourceKey:r}=o.actions,s=e=>e.MediaDrawer.currentSourceKey,d=e=>e.MediaDrawer.overrideDefault,u=o.reducer},83380:(e,t,l)=>{"use strict";l.d(t,{G:()=>r,f:()=>s});var a=l(14041),n=l(88957),o=l(61690),i=l(95709);let r=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=(0,n.KA)();if(!t){console.error("[MediaDrawer].openMediaDrawer: can't open because getStore() returned ".concat(t));return}e&&t.dispatch((0,i.Hy)()),t.dispatch((0,o.Zf)({isEditingMedia:!0}))},s=()=>{let e=(0,n.CU)();return(0,a.useCallback)(t=>{let{isOpen:l,shouldResetSourceKey:a=!0}=t;a&&e.dispatch((0,i.Hy)()),e.dispatch((0,o.Zf)({isEditingMedia:l}))},[e])}},91500:(e,t,l)=>{"use strict";l.d(t,{Am:()=>u,Nx:()=>m,vI:()=>c});var a=l(69e3),n=l(81570),o=l(90406),i=l(63915),r=l(48292),s=l(95580),d=l(62216);let u=(e,t,l)=>{if(t instanceof n.nh){let n=null!=l?l:t.node,u=(0,s.vC)(e,n.type);if(u&&u.config.accessoryImageKey){let e=u.config.accessoryImageKey,l={...n.attrs[e]};if(!l.source&&(0,i.M)(t.$from.parent)){var a,o,d;let n=(0,r.B)(t.$from.parent.attrs.variantKey);if(null===(o=n.defaultAttrs)||void 0===o?void 0:null===(a=o[e])||void 0===a?void 0:a.source)l.source=n.defaultAttrs[e].source;else{let a=(0,s.F2)(t.$from.parent.content).find(t=>{var l;return null===(l=t.attrs[e])||void 0===l?void 0:l.source});l.source=null==a?void 0:null===(d=a.attrs[e])||void 0===d?void 0:d.source}}return{attrs:l,type:n.type,editType:"accessory",mediaType:"image",accesoryKeyPath:e}}return{editType:"node",...n}}return t instanceof n.U3&&t.to-t.from==1&&t.$from.nodeAfter?{editType:"node",...null!=l?l:t.$from.nodeAfter}:t instanceof n.U3&&e.isActive("link")?{attrs:e.getAttributes("link"),type:e.schema.marks.link,mediaType:"embed"}:null},c=e=>{let t,{editor:l,selection:i,sourceKey:r,attrs:s,nodeName:c,resetAttrs:m,resizeToFit:f}=e,{from:p}=i,g=u(l,i);if(g){if(m)t={};else if(g.type instanceof a.sX)t=g.attrs;else{var h;let e=l.state.doc.nodeAt(p);if(!e||e.type!==g.type){console.error("[updateSelectedMedia] Node has moved, cant update");return}t=(null===(h=u(l,i,e))||void 0===h?void 0:h.attrs)||{}}}else{console.error("[updateSelectedMedia] No selectedMedia to update");return}let b={...t,source:r,...s};if(f&&"node"===g.editType&&(b=(0,o.Ez)(b)),(null==g?void 0:g.type.name)==="link"){b.href=b.href||b.sourceUrl;let{from:e,to:t}=i;l.chain().extendMarkRange("link").updateAttributes("link",b).setTextSelection({from:e,to:t}).run();return}if(g.accesoryKeyPath){l.chain().updateAttributesAtPos(p,{[g.accesoryKeyPath]:b}).run();return}let y=d.Fn[b.source],v=c||y.nodeName;v&&l.commands.command(e=>{let{tr:t,state:l}=e,a=l.schema.nodes[v];return!!a&&(t.setNodeMarkup(p,a,b).setSelection(n.nh.create(t.doc,p)).setMeta("annotationEvent",{type:"update-node-attrs",pos:p}),!0)})},m=(e,t)=>{let l=(0,s.vC)(e,t);return!!l&&!!l.config.accessoryImageKey||(t instanceof a.Z6?(0,o.bi)(t):t instanceof a.sX&&"link"===t.name)}},46511:(e,t,l)=>{"use strict";l.d(t,{o:()=>o});var a=l(78354);let n={base:"md","2xl":"lg"},o=()=>(0,a.h5)(n)},9303:(e,t,l)=>{"use strict";l.d(t,{Ht:()=>nl});var a=l(31085),n=l(80532),o=l(62313),i=l(95986),r=l(13236),s=l(81570),d=l(14041),u=l(32899),c=l(88957),m=l(42849),f=l(474),p=l(17835),g=l(56922),h=l(63915),b=l(77583),y=l(61690),v=l(19534),k=l(12790),w=l(65056);let x=e=>{let t=(0,d.useRef)(null),l=(0,k.cq)(),{editor:n,tippyOptions:o,onHide:i,targetElement:r}=e;return(0,d.useEffect)(()=>{n&&n.commands.command(e=>{let{tr:a}=e;return a.setMeta(w.Q2,{element:t.current,tippyOptions:o,panelLifecycle:l,onHide:i,targetElement:r}),!0})},[n,o,l,i,r]),(0,a.jsx)("div",{ref:t,className:e.className,style:{visibility:"hidden"},children:e.children})};var S=l(90406),A=l(2696),C=l(25420),z=l(20501),I=l(3040),j=l(12327),F=l(95905),B=l(80853),R=l(24221),_=l(52177),M=l(59707),E=l(59392);let T=e=>{let{editor:t,handleDelete:l,hasText:n=!1}=e,o=(0,d.useCallback)(()=>{t.chain().deleteSelectionAndSelectNear().run()},[t]);return n?(0,a.jsx)(B.$,{variant:"toolbar",onClick:l||o,color:"red.500",onMouseDown:M.Fw,size:"md",leftIcon:(0,a.jsx)(R.g,{icon:z.yLS}),children:(0,a.jsx)(_.x6,{id:"cnGeoo"})}):(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"cnGeoo"}),icon:z.yLS,onClick:l||o,testId:"delete-node-button",color:"red.500"})};var O=l(11138),P=l(20671),N=l(50201),D=l(67408),L=l(76228),W=l(63341),U=l(18528),G=l(72821),H=l(92515),V=l(57812),q=l(19727),K=l(71792),J=l(96502),$=l(35687),Q=l(61778),Y=l(1602),X=l.n(Y),Z=l(31549),ee=l(49624),et=l(95580);let el=(e,t)=>{let l=new Set;for(let a of e)if(l.add(a[t]),l.size>1)return!1;return[...l][0]},ea=(e,t,l)=>el(function(e,t){let l=function(e,t){if("string"==typeof e){if(!t.marks[e])throw Error("There is no mark type named '".concat(e,"'. Maybe you forgot to add the extension?"));return t.marks[e]}return e}(t,e.schema),{from:a,to:n,empty:o}=e.selection,i=[];return o?(e.storedMarks&&i.push(...e.storedMarks),i.push(...e.selection.$head.marks())):e.doc.nodesBetween(a,n,e=>{i.push(...e.marks)}),i.filter(e=>e.type.name===l.name).map(e=>({...e.attrs}))}(e,t),l);var en=l(48226);let eo=e=>{let{editor:t,isLinkText:l,defaultTextColor:a}=e,n=es(t,a,l),o=ed(t,l),i=l&&t.state.selection.empty,r=(0,d.useCallback)(e=>{i?t.chain().focus().extendMarkRange("link").setHighlightColor(e).setTextSelection({from:t.state.selection.from,to:t.state.selection.to}).run():t.chain().focus().setHighlightColor(e).run()},[t,i]),s=(0,d.useCallback)(e=>{i?t.chain().focus().extendMarkRange("link").setTextColor(e).setTextSelection({from:t.state.selection.from,to:t.state.selection.to}).run():t.chain().focus().setTextColor(e).run()},[t,i]);return{highlightColor:o,resetColorAndHighlight:(0,d.useCallback)(()=>{i?t.chain().focus().extendMarkRange("link").unsetMark("textColor").unsetMark("highlight").setTextSelection({from:t.state.selection.from,to:t.state.selection.to}).run():t.chain().focus().unsetMark("textColor").unsetMark("highlight").run()},[t,i]),setHighlightColor:r,setTextColor:s,textColor:n}},ei=e=>{let{editor:t,defaultTextColor:l,testId:n,disabled:o,useMenuButton:r=!1,isLinkText:s=!1}=e,{textColor:d,highlightColor:u,setHighlightColor:c,setTextColor:m,resetColorAndHighlight:f}=eo({editor:t,isLinkText:s,defaultTextColor:l});return(0,a.jsxs)(W.W,{isLazy:!0,onClose:()=>(0,en.q)(t),children:[r?(0,a.jsx)(Z.v,{color:u.color||d.color||void 0,isDefaultColor:!u.color&&"default"===d.state,disabled:o,"data-testid":n,isMixed:"mixed"===u.state||"mixed"===d.state}):(0,a.jsx)(i.Tz,{placement:"top",label:(0,a.jsx)(_.x6,{id:"76ESgh"}),children:(0,a.jsx)(U.I,{isDisabled:o,as:B.$,variant:"toolbar",rightIcon:(0,a.jsx)(R.g,{icon:z.Jt$,transform:"shrink-6"}),"data-testid":n,onMouseDown:M.Fw,size:"sm",children:(0,a.jsx)(eu,{color:u.color||d.color||void 0})})}),(0,a.jsx)(G.c,{overflow:"hidden",children:(0,a.jsxs)(H.t,{isFitted:!0,variant:"soft-rounded",size:"md",defaultIndex:u.color?1:0,children:[(0,a.jsxs)(V.w,{children:[(0,a.jsx)(q.o,{children:(0,a.jsx)(i.Tz,{label:(0,a.jsx)(_.x6,{id:"xeiujy"}),placement:"top",children:(0,a.jsx)(R.g,{icon:z.jrc})})}),(0,a.jsx)(q.o,{children:(0,a.jsx)(i.Tz,{label:(0,a.jsx)(_.x6,{id:"gtEbeW"}),placement:"top",children:(0,a.jsx)(R.g,{icon:z.nps})})})]}),(0,a.jsxs)(K.T,{children:[(0,a.jsx)(J.K,{p:0,pt:2,children:(0,a.jsx)(ee.b,{currentColor:d.color||null,setColor:m,unsetColor:f,source:"TextColor"})}),(0,a.jsx)(J.K,{p:0,pt:2,children:(0,a.jsx)(ee.b,{currentColor:u.color||"",setColor:c,unsetColor:f,source:"TextHighlight"})})]})]})})]})},er=e=>{let{from:t}=e.state.selection,l=e.view.domAtPos(t),a=l.node instanceof HTMLElement?l.node:l.node.parentElement;if(!a)return null;let n=getComputedStyle(a).getPropertyValue("color");return n&&"rgba(0, 0, 0, 0)"!==n?X()(n).toHexString().toUpperCase():null},es=(e,t,l)=>{let{selection:a,doc:n,schema:o}=e.state,{from:i,to:r}=a,s=l?(0,et.Cm)(n,i,r,o.marks.highlight):n.rangeHasMark(i,r,o.marks.highlight),d=l?(0,et.Cm)(n,i,r,o.marks.textColor):n.rangeHasMark(i,r,o.marks.textColor);if(s)return{state:null,color:null};if(!d)return{state:"default",color:t||er(e)};{let l=ea(e.state,"textColor","hex");return l?{state:null,color:l}:{state:"mixed",color:t||null}}},ed=(e,t)=>{let{selection:l,doc:a,schema:n}=e.state,{from:o,to:i}=l,r=t?(0,et.Cm)(a,o,i,n.marks.highlight):a.rangeHasMark(o,i,n.marks.highlight);if(t?(0,et.Cm)(a,o,i,n.marks.textColor):a.rangeHasMark(o,i,n.marks.textColor))return{state:null,color:null};if(!r)return{state:"default",color:null};{let t=ea(e.state,"highlight","hex");return t?{state:null,color:t}:{state:"mixed",color:null}}},eu=e=>{let{color:t,fixedWidth:l,isChecked:n}=e;return(0,a.jsxs)($.B,{spacing:"2px",children:[(0,a.jsx)(Q.E,{children:n?(0,a.jsx)(L.S,{}):(0,a.jsx)(R.g,{icon:I.jrc,fixedWidth:l,size:t?"sm":void 0,transform:{y:t?3:0}})}),t&&(0,a.jsx)(C.s,{w:5,h:1.5,bg:t,borderRadius:"sm",borderWidth:"1px",borderColor:"blackAlpha.400"})]})};var ec=l(77214),em=l(83380),ef=l(74727),ep=l(48310),eg=l(33473),eh=l(49572),eb=l(12116),ey=l(76304);let ev=()=>({link:{title:j.Ru._({id:"yzF66j"})},preview:{title:j.Ru._({id:"rdUucN"})},inline:{title:j.Ru._({id:"HY4nP5"})}}),ek=e=>{let{editor:t,selection:l,isDisabled:n}=e,o=l instanceof s.U3?"link":l.node.type.name,i="link"===o,r=t.getAttributes(o),{embed:u,source:c}=r,m="embed.twitter"===(0,eb.B)(c||void 0).key,f=ev(),p=(0,d.useCallback)(e=>{if("link"===o&&"link"!==e)t.commands.convertLinkToMedia(e);else if("link"===e){t.commands.convertMediaToLink();return}t.commands.updateAttributes(o,{displayStyle:e})},[t,o]);if("href"in r&&(0,D.hc)(r.href)||m)return null;let g=i?"link":"displayStyle"in r&&r.displayStyle||"inline";return(0,a.jsxs)(W.W,{closeOnSelect:!0,isLazy:!0,autoSelect:!1,children:[(0,a.jsx)(U.I,{isDisabled:n,size:"sm",as:B.$,rightIcon:(0,a.jsx)(R.g,{icon:z.Jt$,transform:"shrink-6"}),variant:"toolbar",pl:2,onMouseDown:M.Fw,"data-testid":"display-style-dropdown",children:f[g].title}),(0,a.jsx)(G.c,{children:(0,a.jsx)(ep.i,{type:"radio",onChange:p,value:g,children:Object.entries(f).map(e=>{let[t,{title:l}]=e;return(0,a.jsx)(eg.k,{value:t,onMouseDown:M.Fw,"data-testid":"display-style-option-".concat(t),children:(0,a.jsx)(Q.E,{children:l})},t)})})})]})},ew=e=>{let{href:t,updateHref:l,unlink:n,editor:i,allowEditMetadata:r=!1}=e,s=(0,d.useRef)(null),[u,m]=(0,d.useState)(t),f=(0,c.GV)(y.bO),p=(0,et.Cf)(t,f),g=e=>{if(!e)return;let t=(0,ec.Se)(e)||(0,D.hc)(e)?e:"http://"+e;if(!(0,ec.AY)(t)){l("");return}l(t)},h=(0,d.useCallback)(()=>{try{window.open(t,"_blank")}catch(e){console.error("(caught) Link Formatting Menu error",e)}},[t]),b=(0,d.useCallback)(e=>{if(!p)return;let l=(0,et.Ww)(t);(0,N.T)(i,e,l)},[i,t,p]);(0,d.useEffect)(()=>{!t&&s.current&&setTimeout(()=>{var e;null==s||null===(e=s.current)||void 0===e||e.focus()})},[t]),(0,d.useEffect)(()=>{m(t)},[t]);let v=(0,em.f)(),k=(0,d.useCallback)(e=>{v({isOpen:!0}),e.stopPropagation()},[v]);return(0,a.jsxs)(o.z,{spacing:2,py:1,mx:2,children:[(0,a.jsx)(P.p,{value:u,ref:s,onChange:e=>m(e.target.value),onBlur:()=>{g(u)},onKeyPress:e=>{"Enter"===e.key&&(g(u),i.commands.focus())},placeholder:j.Ru._({id:"Ilf1mg"}),width:"250px",size:"sm","data-testid":"link-input"}),n&&(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"484LKL"}),icon:z.vev,onClick:n}),p&&(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"9FNPgA"}),icon:z.dmS,onClick:b}),t&&(0,a.jsx)(E.I,{label:p?(0,a.jsx)(_.x6,{id:"RMJwZi"}):(0,a.jsx)(_.x6,{id:"fOj0+R"}),icon:z.vMs,onClick:h}),t&&r&&(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"ePK91l"}),icon:z.MT7,onClick:k})]})},ex=()=>[{name:j.Ru._({id:"bjuYAW"}),key:"solid",icon:I.Cpz},{name:j.Ru._({id:"bCuf07"}),key:"outline",icon:z.Cpz}];var eS=l(16262);let eA=e=>{let{editor:t,attrs:l,selection:n}=e,o=(0,eS._w)(),r=o[l.variant],s=r?r.icon:z.jyJ;return(0,a.jsxs)(W.W,{isLazy:!0,onClose:()=>(0,en.q)(t),children:[(0,a.jsx)(i.Tz,{placement:"top",label:(0,a.jsx)(_.x6,{id:"H8b4pf"}),"aria-label":j.Ru._({id:"H8b4pf"}),children:(0,a.jsx)(U.I,{as:B.$,variant:"toolbar",rightIcon:(0,a.jsx)(R.g,{icon:z.Jt$,transform:"shrink-6"}),size:"sm",onMouseDown:M.Fw,children:(0,a.jsx)(R.g,{icon:s})})}),(0,a.jsx)(G.c,{maxW:"auto",children:(0,a.jsxs)(ef.e,{flex:"row",alignItems:"center",children:[Object.entries(o).map(e=>{let[o,{name:i,icon:r}]=e;return(0,a.jsx)(E.I,{label:i,icon:r,isActive:l.icon&&l.variant===o,onClick:()=>{t.chain().focus().updateAttributes("calloutBox",{variant:o,icon:!0}).selectNodeAtPos(n.from).run()}},i)}),(0,a.jsx)(O.q,{}),(0,a.jsx)(E.I,{label:l.icon?(0,a.jsx)(_.x6,{id:"Cs6LHm"}):(0,a.jsx)(_.x6,{id:"pjF2Hd"}),icon:z.Dfk,isActive:!l.icon,onClick:()=>{t.chain().focus().updateAttributes("calloutBox",{icon:!l.icon}).selectNodeAtPos(n.from).run()}},"icon")]})})]})};var eC=l(57860),ez=l(32202),eI=l(3706),ej=l(67965),eF=l(5377);let eB=new(l(36832)).b;var eR=l(46108),e_=l.n(eR);class eM{constructor({key:e,description:t,classifyExamples:l,classifyReply:a,checkEnabled:n}){this.key=e,this.description=t,this.classifyExamples=l,this.classifyReply=a,this.checkEnabled=n}}var eE=l(25465),eT=l(57450),eO=l(87116),eP=l(33587),eN=l(77914),eD=l(83603),eL=l(32262),eW=l(69e3);let eU=new s.hs("aiModifications");var eG=l(65208);let eH=(e,t)=>{if(!e.content||!e.content[0].content)return null;let l=e.content[0].content.find(e=>e.attrs&&e.attrs.id===t);return l?(e.content[0].content=[l],e):null},eV=(e,t)=>{let l=null;if("html"===t.type)l=(0,eG.S)(t.html,e.schema).slice;else if("json"===t.type){let a=eW.FK.fromJSON(e.schema,t.json);l=new eW.Ji(a,0,0)}else throw Error("Unsupported Modification content type ".concat(t.type));return l},eq=(e,t,l)=>{var a,n;let o=eU.getState(e.state);return o?(null==o?void 0:o.getExistingRangeId(e.state,l))||null||(null===(a=(n=e.commands).setInteractionRange)||void 0===a||a.call(n,t,l),t):t},eK=(e,t)=>{let l=eU.getState(e.state);return(null==l?void 0:l.getRange(e.state,t))||null};class eJ{isApplied(e){let t=e.state.tr,l=null;try{l=this.transact(e,t,!1)}catch(e){return console.error("[isModificationActive] Could not transact modificatioon, returning false",e.message),!1}if(!l)return!1;let a=eK(e,this.rangeId);if(!a)return!1;try{let n=e.state.doc.slice(a.from,a.to),o=t.doc.slice(a.from,a.to),i=l.from===a.from&&l.to===a.to;return n.eq(o)&&i}catch(e){}return!1}getPreviewJson(e){let t=e.state.tr;this.transact(e,t);let l=this.getParentCardId(e,t);return eH(e_()(t.doc.toJSON()),l)}getParentCardId(e,t){let l=eK(e,this.rangeId);if(!l)return null;let a=t.doc.resolve(l.from),n=(0,et.IV)(a,v.jg)[0];return n&&n.node.attrs.id||null}apply(e){let t=e.state.tr;this.transact(e,t),console.debug("[ReplaceContentModification] Applying modification",{modification:this,range:eK(e,this.rangeId)}),e.view.dispatch(t);let l=this.getParentCardId(e,t);(0,eL.OM)({editor:e,cardId:l})}transact(e,t){let l=!(arguments.length>2)||void 0===arguments[2]||arguments[2],a=eK(e,this.rangeId);if(!a)return null;let{state:n}=e;t.replace(a.from,a.to,this.slice).setMeta("applyingAiModification",{rangeId:this.rangeId});let o=t.mapping.map(a.to),i={from:a.from,to:o};if(l){if(n.selection.empty)return t.setSelection(s.LN.near(t.doc.resolve(a.from))),i;if(n.selection instanceof s.nh)return t.setSelection(s.nh.create(t.doc,a.from)),i;let e=s.U3.between(t.doc.resolve(a.from),t.doc.resolve(o));t.setSelection(e)}return i}getContentForTracking(){return this.content}constructor(e,t){this.type="replace-content",this.description=t.description,this.rangeId=t.rangeId,this.content=t.content,this.slice=eV(e,t.content)}}let e$=e=>Array.from(new DOMParser().parseFromString(e,"text/html").body.childNodes).some(e=>1===e.nodeType),eQ=e=>e.slice(-7).map(e=>"User"===e.from?{role:"user",content:e.message}:e.isClassification?{role:"assistant",content:e.message}:e.resp?{role:"assistant",content:e.resp}:null).filter(e=>!!(null==e?void 0:e.content)),eY=()=>j.Ru._({id:"HNDdbS"});class eX extends eM{async getResponseMessages(e){let{editor:t,context:l,rangeId:a,response:{raw:n,suggestion:o,message:i}}=e;if(!o)throw new eD.tF("[SuggestContentTask] No html provided in prompt response",{chatMessage:i,inputMessage:l.message,resp:n,interactionId:l.interactionId});let r=await (0,eP.e)(o,{loadImages:!0});console.debug("[AIChat SuggestContentTask] modify suggestion",{transformedHtml:r,html:o});let s=new eJ(t,{description:j.Ru._({id:"nyQWMb"}),content:{type:"html",html:r},rangeId:a}),d={label:j.Ru._({id:"nyQWMb"}),modification:s,jsonContentPreview:s.getPreviewJson(t)},u=this.getOriginalModifyContentSuggestion(t,l,a);return{messages:[{from:"Designer",type:"suggestContent",resp:n,message:i||j.Ru._({id:"pMSbe+"}),suggestions:[d,u],interactionId:l.interactionId}],suggestionToApply:d}}async runPrompt(e){let t,{input:l,context:a,variables:n,trackFns:o,retries:i=2,history:r}=e;if(this.jsxPrompt&&u.of.get("aiChatJsx")){let{promise:e}=(0,eO.i4)({variables:{html:n.html,message:n.message,outline:n.outline,history:r.map(e=>({role:e.role===eN.VDI.Assistant?"assistant":"user",content:e.content||""}))},interactionId:a.interactionId,workspaceId:a.workspaceId,promptKey:this.jsxPrompt,opts:{timeout:u.of.get("aiRequestTimeouts").suggestContent}});t=await e}else t=await (0,eT.U)(l,a.interactionId,{timeout:u.of.get("aiRequestTimeouts").suggestContent});if(!t)throw new eD.tF("Couldn't get response from prompt",{resp:t,inputMessage:a.message,interactionId:a.interactionId});let s=this.parseResponse(t,n);if(s.shouldRetry){if(i<=0)throw new eD.K$("Could not parse response properly after retries",{chatMessage:eY(),inputMessage:a.message,resp:t,interactionId:a.interactionId});return o.trackRequestRetry({interactionId:a.interactionId,retriesRemaining:i,resp:t}),this.runPrompt({input:l,context:a,retries:i-1,trackFns:o,variables:n,history:r})}return{parsed:s,resp:t}}async run(e){let{editor:t,context:l,addMessage:a,history:n,trackFns:o,themeModificationController:i,provider:r}=e,{html:s,range:d}=this.determineTaskTarget(l.editorContext);o.trackInputContent({taskContext:l,inputContent:s});let u={message:l.message,html:s,outline:l.editorContext.outline},c=eq(t,l.interactionId,d),m=eQ(n||[]),f=this.prompt.prepare({variables:u,history:m,interactionId:l.interactionId,params:{provider:r}});console.debug("[AIChat SuggestContentTask] run",{html:u.html,input:f,suggestHistory:m,range:eK(t,c)});let p=await (0,eE.wo)(f),{parsed:g,resp:h}=await this.runPrompt({input:p,history:m,context:l,variables:u,trackFns:o,retries:1}),{messages:b,suggestionToApply:y}=await this.getResponseMessages({editor:t,context:l,rangeId:c,response:g,themeModificationController:i});console.debug("[AIChat SuggestContentTask] completed",{suggestion:g.suggestion,resp:h,parsed:g,messages:b,suggestionToApply:y}),this.autoApplySuggestion({context:l,editor:t,suggestionToApply:y,resp:h,trackFns:o,themeModificationController:i}),b.forEach(e=>a(e)),o.trackRequestComplete({taskContext:l,outputMessage:g.message,outputContent:g.suggestion,resp:h})}determineTaskTarget(e){return this.getTaskTarget?this.getTaskTarget(e):e.defaultRange}getOriginalModifyContentSuggestion(e,t,l){let a=new eJ(e,{description:j.Ru._({id:"HxF6Fk"}),content:{type:"html",html:this.determineTaskTarget(t.editorContext).html},rangeId:l});return{label:j.Ru._({id:"HxF6Fk"}),modification:a,jsonContentPreview:a.getPreviewJson(e)}}autoApplySuggestion(e){let{context:t,editor:l,suggestionToApply:a,resp:n,trackFns:o,themeModificationController:i}=e;if(a){if(a.modification.isApplied(l,i))throw console.debug("[SuggestContentTask] suggestion does not change the content",a),new eD.hY("Suggestion does not change content",{resp:n,interactionId:t.interactionId,chatMessage:eY()});try{let{modification:e}=a;e.apply(l,i),o.trackSuggestionApplied({interactionId:t.interactionId,suggestionContent:e.getContentForTracking(),suggestionLabel:e.description,suggestionType:e.type,autoApplied:!0})}catch(e){throw new eD.$v("Could not apply suggestion",{interactionId:t.interactionId})}}}constructor(e){super(e),this.prompt=e.prompt,this.jsxPrompt=e.jsxPrompt,this.parseResponse=e.parseResponse||e0,this.getTaskTarget=e.getTaskTarget}}let eZ=RegExp("(.*?)```[A-Za-z]*\\n(.*?)\\n```(.*?)$","ims"),e0=e=>{let t;let l=e.match(eZ),a=[];if(l)a=[l[1],l[3]],t=l[2];else{let l=e.split("```");if(0===l.length)throw Error("Could not extract code from response");if(1===l.length)return e$(l[0])?{suggestion:void 0,raw:e,message:e,shouldRetry:!0}:{suggestion:void 0,raw:e,message:e.replaceAll(/(HTML|code)/gi,"content")};a=[l[0]],t=l[1].trim()}return{suggestion:t,message:a.map(e=>e.trim()).filter(e=>e.length>0).join("\n\n").replaceAll(/(HTML|code)/gi,"content").replaceAll(/(slide)/gi,"card"),raw:e}};new eX({key:"CHANGE_LAYOUT",description:"Change the display of information to use a different layout (like timeline, bullets, boxes, columns, table) or rearrange elements within a layout",classifyExamples:["turn this into a table","make each bullet into a box","could you split this into columns?","make this a timeline","could you make this more visual?","visualize this as a timeline"],classifyReply:"Sure, I'll start reformatting this as a table...",getTaskTarget:e=>"selectionRange"!==e.selectedDefaultRange?e.defaultRange:0===e.selectionRange.html.trim().length?e.cardContent:e.blockRange,prompt:new(l(81768)).F({systemPromptOperation:eN.mc.ChangeContentLayoutSystem,userPromptOperation:eN.mc.ChangeContentLayoutUser,variables:["html","message"],params:{temperature:.7,maxTokens:1e3}})}),l(63587),l(87064),l(45214);var e1=l(91559),e2=l(65998),e6=l(90754),e4=l(24008),e5=l(18588),e3=l(59742),e8=l(57238),e7=l(34363),e9=l(65446),te=l(70323),tt=l(18658),tl=l(2600),ta=l(27670),tn=l(82680),to=l(2241),ti=l(73893),tr=l(78776),ts=l(56824),td=l(18201);let tu=e=>{let{formatLabel:t,icon:l,accentColor:n,onClick:o,exportInProgress:i,exportInProgressNote:r,badge:s,customLabel:d,customInProgressMessage:u}=e,c=(0,ts.dU)("gray.50","whiteAlpha.100"),m=(0,ts.dU)("gray.200","gray.700"),f=(0,ts.dU)("".concat(n,".100"),"".concat(n,".200")),p=(0,ts.dU)("gray.300","gray.600"),g=(0,ts.dU)("var(--chakra-colors-".concat(n,"-300)"),"var(--chakra-colors-".concat(n,"-700)")),h=(0,ts.dU)("var(--chakra-colors-".concat(n,"-700)"),"var(--chakra-colors-".concat(n,"-300)"));return(0,a.jsxs)(C.s,{alignItems:"stretch",overflow:"hidden",onClick:o,borderRadius:"md",border:"1px",borderColor:(0,ts.dU)("gray.200","gray.700"),bgColor:i?m:c,cursor:i?"progress":void 0,disabled:i,as:"button",transitionProperty:"common",transitionDuration:"normal",_hover:i?{}:{boxShadow:"var(--chakra-shadows-md)",borderColor:g,color:h},children:[(0,a.jsx)(C.s,{bgColor:i?p:f,filter:i?"grayscale(1)":void 0,width:14,minH:14,alignItems:"center",justifyContent:"center",fontSize:"2xl",children:l}),(0,a.jsxs)($.B,{alignItems:"flex-start",spacing:0,p:4,justifyContent:"center",children:[!i&&(0,a.jsxs)(Q.E,{fontWeight:"medium",children:[d||(0,a.jsx)(_.x6,{id:"i3Tbgc",values:{formatLabel:t}})," ",s]}),i&&(0,a.jsxs)(Q.E,{fontWeight:"medium",textAlign:"start",children:[u||(0,a.jsx)(_.x6,{id:"wRvCQ6",values:{formatLabel:t}})," ",r]})]}),(0,a.jsx)(td.h,{}),!i&&(0,a.jsx)(C.s,{alignItems:"center",ps:4,pe:6,children:(0,a.jsx)(R.g,{icon:z.a_I,size:"1x"})})]})};var tc=l(23672),tm=l(25369),tf=l(10458);l(82438);let tp=(e,t)=>"".concat(ti.$.API_HOST||"","/export/docs/").concat(e,"/").concat(t),tg=(e,t)=>"".concat(ti.$.API_HOST||"","/share/docs/").concat(e,"/").concat(t),th=async function(e,t,l,a,n,o,i,r){let s=arguments.length>8&&void 0!==arguments[8]&&arguments[8],d=arguments.length>9?arguments[9]:void 0,u=arguments.length>10?arguments[10]:void 0,c=s?tg(e,u):tp(e,l),m=new AbortController;return setTimeout(()=>m.abort(),6e4),fetch(c,{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","share-token":ti.$.SHARE_TOKEN||""},body:JSON.stringify({docContent:t,fileName:n,cardIds:o,cardRanges:i,isCardExport:a,shareMessage:d,googleOauthToken:"google_slides"===l?r:void 0}),signal:m.signal})},tb=e=>{let{doc:t,source:l,editor:n,format:o="pdf",formatLabel:i,fileName:r,cardIds:s,cardRanges:u,socialPost:c=!1,socialPlatform:m,shareMessage:f,interceptFileExport:p}=e,g=(0,ez.d)(),h=(0,d.useRef)(null),b=(0,tf.st)(),[y,v]=(0,d.useState)(!1);if(c&&!m)throw console.error("Unable to export since no social platform provided for the post"),Error("Unable to share post");let k=(0,d.useCallback)(()=>{h.current=g({id:"export-toast-".concat(t.id,"-").concat(o),isClosable:!1,position:"top",duration:null,status:"loading",variant:"light",title:c?(0,a.jsx)(_.x6,{id:"jQGAZQ",values:{formatLabel:i}}):(0,a.jsx)(_.x6,{id:"eWt/TT",values:{formatLabel:i}})})},[null==t?void 0:t.id,g,o,i,c]),w=(0,d.useCallback)(()=>{h.current&&g.update(h.current,{status:"loading",variant:"light",title:c?(0,a.jsx)(_.x6,{id:"iPHeYN"}):(0,a.jsx)(_.x6,{id:"eJOEBy"}),description:(0,a.jsx)(_.x6,{id:"3xBuWT"}),isClosable:!0})},[g,c]),x=(0,d.useCallback)(()=>{h.current&&g.update(h.current,{status:"info",variant:"light",title:(0,a.jsx)(_.x6,{id:"eJOEBy"}),description:c?(0,a.jsx)(_.x6,{id:"c5plBG"}):"google_slides"===o?(0,a.jsx)(_.x6,{id:"/CtF0l"}):(0,a.jsx)(_.x6,{id:"W4zgCP"}),isClosable:!0})},[g,c,o]),S=(0,d.useCallback)(()=>{h.current&&g.update(h.current,{title:c?(0,a.jsx)(_.x6,{id:"sBE71M",values:{formatLabel:i}}):(0,a.jsx)(_.x6,{id:"walT1X"}),status:"error",duration:null,isClosable:!0})},[g,i,c]),A=(0,d.useCallback)(function(e){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"download";if(h.current){let n,o,r,s;switch(l){case"download":n=j.Ru._({id:"pK8dQg"}),r=j.Ru._({id:"QR1/Gm"}),o=j.Ru._({id:"15ewRm"});break;case"social":n=j.Ru._({id:"uhWzJY",values:{formatLabel:i,0:t.title}}),o=j.Ru._({id:"dfykXC"}),s=j.Ru._({id:"NS5YdL"});break;case"web":n=j.Ru._({id:"eLTtkg"}),o=j.Ru._({id:"dfykXC"}),s=j.Ru._({id:"pGVro1",values:{formatLabel:i}})}g.update(h.current,{status:"success",title:n,description:(0,a.jsxs)(Q.E,{children:[r," ",(0,a.jsx)(eI.N,{textDecoration:"underline",target:"_blank",href:e||void 0,onClick:()=>h.current&&g.close(h.current),children:o})," ",s]}),isClosable:!0})}},[t,i,g]);return{handleExport:(0,d.useCallback)(()=>{let e=null==n?void 0:n.getJSON();v(!0),k();let a=setTimeout(w,3e4);null!=p&&p({format:o,exportWaitWarnTimeout:a,showErrorToast:S,showEmailToast:x,showSuccessToast:A,setExportInProgress:v})||th(t.id,e,o,"card_export_menu"===l,r,s,u,void 0,c,f,m).then(async e=>{var a;if(!e.ok)throw console.error("Export failed:",{status:e.status,statusText:e.statusText}),Error("Fetching export failed: ".concat(e.status," ").concat(e.statusText));let n="linkedin"===m?tf.VV.LINKEDIN_POST:"pdf"===o?tf.VV.PDF_EXPORTED:"pptx"===o?tf.VV.PPTX_EXPORTED:"image"===o?tf.VV.PNG_EXPORTED:void 0;n&&(null==b||b.track(n,{doc_id:t.id,source:l}));let i=decodeURIComponent(e.headers.get("x-gamma-download-url")||"")||void 0;if(c&&(i=(await e.json()).url),A(i,c?"social":"download"),c)return;let r=await e.blob(),s=window.URL.createObjectURL(r),d=document.createElement("a"),u=decodeURIComponent((null===(a=(e.headers.get("Content-Disposition")||"").split(";").find(e=>e.includes("filename=")))||void 0===a?void 0:a.replace("filename=","").trim())||"".concat(t.id,".").concat(o));d.download=u,d.href=s,d.style.display="none",document.body.appendChild(d),d.click(),d.remove()}).catch(e=>{"AbortError"===e.name?x():(tm.Cp(e,{extra:{docId:t.id,format:o,source:l}}),tc.yf.logger.error("[useHandleExport] Error exporting doc",{docId:t.id,format:o,source:l},e),S())}).finally(()=>{v(!1),clearTimeout(a)})},[b,null==t?void 0:t.id,n,l,o,r,p,s,u,f,S,k,w,x,A,m,c]),exportInProgress:y}},ty=e=>{let{doc:t,source:l,editor:a,fileName:n,cardIds:o,cardRanges:i}=e,r="https://www.googleapis.com/auth/drive.file",s=(0,d.useRef)(null),u=(0,tf.st)(),c=(0,to.mg)({scope:r,prompt:"",onSuccess:async e=>{let{showErrorToast:d,showEmailToast:c,showSuccessToast:m,setExportInProgress:f,exportWaitWarnTimeout:p}=s.current,g="";if((0,to.DY)(e,r))g=e.access_token;else{d();return}let h=null==a?void 0:a.getJSON(),b="google_slides";th(t.id,h,"google_slides","card_export_menu"===l,n,o,i,g).then(async e=>{let a=await e.json();if(!e.ok)throw console.error("Export failed:",{status:e.status,statusText:e.statusText}),Error("Fetching export failed: ".concat(e.status," ").concat(e.statusText));let n=tf.VV.GSLIDES_EXPORTED;n&&(null==u||u.track(n,{doc_id:t.id,source:l})),m(a.url,"web"),window.open(a.url,"_blank")}).catch(e=>{"AbortError"===e.name?c():(tm.Cp(e,{extra:{docId:t.id,format:b,source:l}}),tc.yf.logger.error("[useHandleExport] Error exporting doc",{docId:t.id,format:b,source:l},e),d())}).finally(()=>{f(!1),clearTimeout(p)})}});return{interceptFileExport:e=>"google_slides"===e.format&&(s.current=e,c(),!0)}};var tv=l(18651);let tk={pdf:{icon:(0,a.jsx)(tv._,{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/pdf-icon.a0dfc5d3.svg",h:"1.35rem",w:"auto"}),accentColor:"red"},pptx:{icon:(0,a.jsx)(tv._,{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/powerpoint-icon.2df39be4.svg",h:"1.5rem",w:"auto"}),accentColor:"orange"},png:{icon:(0,a.jsx)(tv._,{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/png-icon.0a2f46dc.svg",h:"1.45rem",w:"auto"}),accentColor:"purple"},google_slides:{icon:(0,a.jsx)(tv._,{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/google-slides-icon.a22064ae.svg",h:"1.6rem",w:"auto"}),accentColor:"sunglow"}};var tw=l(9335);let tx=e=>{let{cardId:t,format:l,doc:n,editor:o,icon:i,badge:r,accentColor:s,label:d}=e,{handleExport:u,exportInProgress:c}=tb({doc:n,source:"card_export_menu",editor:o,format:l,formatLabel:d,cardIds:[t],interceptFileExport:void 0});return(0,a.jsx)(tu,{onClick:u,icon:i,formatLabel:d,accentColor:s,badge:r,exportInProgress:c,exportInProgressNote:(0,a.jsx)(_.x6,{id:"SJjTti"})})},tS=e=>{let{cardId:t,doc:l,editor:n,icon:o,badge:i,accentColor:r,label:s}=e,{interceptFileExport:d}=ty({doc:l,source:"card_export_menu",editor:n,fileName:l.title,cardIds:[t]}),{handleExport:u,exportInProgress:c}=tb({doc:l,source:"card_export_menu",editor:n,format:"google_slides",formatLabel:s,cardIds:[t],interceptFileExport:d});return(0,a.jsx)(tu,{onClick:u,icon:o,formatLabel:s,accentColor:r,badge:i,exportInProgress:c,exportInProgressNote:(0,a.jsx)(_.x6,{id:"SJjTti"})})},tA=e=>"google_slides"===e.format?(0,a.jsx)(to.G_,{clientId:ti.$.GOOGLE_DRIVE_IMPORT_CLIENT_ID,children:(0,a.jsx)(tS,{...e})}):(0,a.jsx)(tx,{...e}),tC=(0,tr.A)(e=>{let{isOpen:t,onClose:l,cardId:n,editor:o}=e,i=(0,c.GV)(y.Jo),r=(0,e2.u)("googleSlidesExport");return(0,a.jsxs)(e5.aF,{isOpen:t,onClose:l,size:"lg",children:[(0,a.jsx)(e3.m,{}),(0,a.jsxs)(e8.$,{children:[(0,a.jsx)(e7.r,{children:(0,a.jsx)(_.x6,{id:"xRJ+bN"})}),(0,a.jsx)(e9.s,{}),(0,a.jsx)(te.c,{}),(0,a.jsx)(tt.c,{pt:"6",children:(0,a.jsxs)(tl.T,{spacing:4,align:"start",children:[(0,a.jsxs)($.B,{spacing:2,w:"100%",children:[(0,a.jsx)(tA,{cardId:n,format:"image",label:"PNG",icon:tk.png.icon,accentColor:tk.png.accentColor,doc:i,editor:o}),(0,a.jsx)(tA,{cardId:n,format:"pdf",label:"PDF",icon:tk.pdf.icon,accentColor:tk.pdf.accentColor,doc:i,editor:o}),(0,a.jsx)(tA,{cardId:n,format:"pptx",label:"PPTX",icon:tk.pptx.icon,accentColor:tk.pptx.accentColor,doc:i,editor:o}),r&&(0,a.jsx)(tA,{cardId:n,format:"google_slides",label:"Google Slides",icon:tk.google_slides.icon,accentColor:tk.google_slides.accentColor,badge:(0,a.jsx)(ta.E,{colorScheme:"green",children:(0,a.jsx)(_.x6,{id:"isRobC"})}),doc:i,editor:o})]}),(0,a.jsx)(Q.E,{fontSize:"sm",color:"gray.600",children:(0,a.jsx)(_.x6,{id:"8LhjM/",components:{0:(0,a.jsx)(B.$,{variant:"link",as:"span",size:"sm",cursor:"pointer",onClick:()=>{l(),tw.LF.emit(tw.DN.OPEN_PAGE_SETUP,"cards")}})}})})]})}),(0,a.jsx)(tn.j,{children:(0,a.jsx)(ef.e,{children:(0,a.jsx)(B.$,{onClick:()=>{l()},children:(0,a.jsx)(_.x6,{id:"DPfwMq"})})})})]})]})});var tz=l(78872);let tI=(0,d.memo)(e=>{let{isLocked:t,isDark:l=!1}=e;return(0,a.jsxs)(n.az,{as:"span",className:"fa-layers fa-fw",children:[(0,a.jsx)(R.g,{icon:z.CQO}),t&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(R.g,{icon:I.GEE,color:l?"var(--chakra-colors-gray-900)":"var(--chakra-colors-gray-50)",transform:"shrink-3 right-6 down-6"}),(0,a.jsx)(R.g,{icon:I.DW4,transform:"shrink-8 right-6 down-6"})]})]})});tI.displayName="CardLinkIcon";let tj=()=>{var e,t;let l=(0,c.GV)(y.Jo);if(!l)return!1;let a=ti.$.SHARE_TOKEN,n=null===(e=l.accessLinks)||void 0===e?void 0:e.some(e=>""===e.token),o=null===(t=l.accessLinks)||void 0===t?void 0:t.some(e=>null===e.permission);return!!a||!!n&&!o};var tF=l(14e3),tB=l(92405);let tR=e=>{let{attrs:t}=e,l=(0,c.GV)(y.wC),n=(0,c.GV)(y.Jo),o=t.id,i=(0,tB.Io)({cardId:o,docId:null==n?void 0:n.id,isPresentMode:l===tF.w.SLIDE_VIEW}),r=(0,ez.d)(),{onCopy:s}=(0,tz.i)(i),u=(0,d.useCallback)(e=>{var t;if(e.target&&(null===(t=e.target)||void 0===t?void 0:t.closest('[data-testid="open-share"]'))){e.preventDefault();return}s(),r({title:j.Ru._({id:"BVYvMa"}),status:"success",duration:3e3,position:"top"})},[s,r]),m=tj();return(0,a.jsx)(E.I,{onClick:u,label:m?(0,a.jsx)(_.x6,{id:"F0YmUY"}):(0,a.jsxs)($.B,{spacing:"0",children:[(0,a.jsx)(Q.E,{children:(0,a.jsx)(_.x6,{id:"afMspw"})}),(0,a.jsx)(Q.E,{fontSize:"xxs",color:"gray.400",children:(0,a.jsx)(_.x6,{id:"OpeWZK"})})]}),children:(0,a.jsx)(tI,{isLocked:!m})})};var t_=l(9021),tM=l(29383),tE=l(49964),tT=l(31485),tO=l(26813);let tP=e=>{let{editor:t,selection:l,decorations:n}=e,{node:o,from:r}=l,s=o.attrs,u=(0,tT.Bn)(n),c=(0,tE.jh)(s,null==u?void 0:u.layout),m=(0,d.useCallback)(e=>{r&&t.commands.updateAttributesAtPos(r,{fitType:e})},[t,r]),f="fit"===c;return(0,a.jsx)(i.Tz,{label:f?(0,a.jsx)(_.x6,{id:"sShDhp"}):(0,a.jsx)(_.x6,{id:"VPxUGR"}),placement:"top",children:(0,a.jsx)(t_.K,{variant:f?"activeToolbar":"toolbar",size:"sm",icon:(0,a.jsx)(R.g,{icon:z.GZ1}),onClick:()=>m(f?"fill":"fit"),boxSize:7,p:0,my:0,"aria-label":j.Ru._({id:"l1XNCT"}),isActive:f})})};var tN=l(33023),tD=l(19098),tL=l(64444),tW=l(93185),tU=l(97864),tG=l(25676),tH=l(17228),tV=l.n(tH),tq=l(119),tK=l.n(tq),tJ=l(32133),t$=l(45776),tQ=l(96712),tY=l(17539),tX=l(39452);let tZ=e=>{let[t,l]=(0,d.useState)(null);return(0,d.useEffect)(()=>((()=>{let t=new Image;t.src=e,t.onload=()=>{let{naturalWidth:e,naturalHeight:a}=t;l(e/a)}})(),()=>{l(null)}),[e]),t},t0=(e,t,l)=>{let a=e.view.domAtPos(t);if(!a)return;let{node:n,offset:o}=a,i=n.childNodes[o].querySelector("[data-change-focus-point-el]");i&&(i.style.backgroundPosition=l?"".concat(l.x,"% ").concat(l.y,"%"):"")},t1=e=>{var t;return null===(t=(0,tX.um)(e))||void 0===t?void 0:t.backgroundPos},t2=(e,t,l)=>{if(!t||!l)return;let a=(0,tQ.d_)(e.state,l);if(!a){console.error("ChangeFocusPoint - relative pos is null");return}t0(e,a,null);let n=e.state.doc.nodeAt(a);if(!n)return;let o=(0,tX.um)(n),i=(0,tX.wH)(n,{...o,backgroundPos:t});e.commands.updateAttributesAtPos(a,i)},t6=e=>{let{editor:t,pos:l,node:a,imageId:n}=e,o=(0,d.useRef)(null),i=(0,d.useRef)(null),r=(0,d.useRef)(null),[s,u]=(0,d.useState)(!1),m=(0,d.useRef)(),f=(0,c.jL)(),p=(0,d.useCallback)(e=>{let a=o.current;if(a){if(m.current=e,!e){a.style.left="calc(50% - 10px)",a.style.top="calc(50% - 10px)",u(!1);return}a.style.left="calc(".concat(e.x,"% - 10px)"),a.style.top="calc(".concat(e.y,"% - 10px)"),t0(t,l,e),u(50!==e.x||50!==e.y)}},[t,l]),{onOpen:g,onClose:h,isOpen:b}=(0,tN.j)(),y=(0,d.useCallback)(()=>{p(t1(a)),g(),f((0,t$.sI)({id:n}))},[a,g,p,f,n]),v=(0,d.useCallback)(()=>{let e={x:50,y:50};p(e);let a=(0,tQ.JO)(t.state,l);t2(t,e,a)},[p,t,l]),k=(0,d.useCallback)(e=>{let t=i.current;if(!t)return;let l=t.getBoundingClientRect(),a=l.width,n=l.height,o=(e.clientX-l.left)/a,r=(e.clientY-l.top)/n;p({x:tK()(100*tV()(o,0,1),2),y:tK()(100*tV()(r,0,1),2)})},[p]);return(0,d.useEffect)(()=>{let e=o.current,a=i.current;if(!e||!a)return;r.current=(0,tQ.JO)(t.state,l);let n=()=>{a.addEventListener("mousemove",k),window.addEventListener("mouseup",s)},s=()=>{a.removeEventListener("mousemove",k),window.removeEventListener("mouseup",s),t2(t,m.current,r.current)};return e.addEventListener("mousedown",n),()=>{e.removeEventListener("mousedown",n)}},[t,k,l]),(0,d.useEffect)(()=>{let e=i.current;if(!e)return;r.current=(0,tQ.JO)(t.state,l);let a=t=>{e.addEventListener("mousemove",k),window.addEventListener("mouseup",n),k(t)},n=()=>{e.removeEventListener("mousemove",k),window.removeEventListener("mouseup",n),t2(t,m.current,r.current)};return e.addEventListener("mousedown",a),()=>{e.removeEventListener("mousedown",a)}},[t,k,l]),{onOpen:y,onClose:(0,d.useCallback)(()=>{f((0,t$.zs)()),h()},[h,f]),isOpen:b,dotRef:o,dotContainerRef:i,canReset:s,resetDotPosition:v}},t4=e=>{let{node:t,editor:l,pos:o,isDisabled:r=!1}=e,s=(0,tX.um)(t),u=(null==s?void 0:s.src)||(null==s?void 0:s.tempUrl),c=t.attrs.id||(null==s?void 0:s.id),m=tZ(u),f=(0,tJ.d4)((0,t$.CU)(c)),{onClose:p,isOpen:g,onOpen:h,dotRef:b,dotContainerRef:y,canReset:v,resetDotPosition:k}=t6({editor:l,pos:o,node:t,imageId:c});return(0,d.useEffect)(()=>{!g&&f&&h()},[f,g,h]),(0,a.jsxs)(tD.A,{strategy:"absolute",placement:"top",isOpen:g,onClose:p,onOpen:h,children:[(0,a.jsx)(i.Tz,{label:(0,a.jsx)(_.x6,{id:"BmxaoW"}),placement:"top",children:(0,a.jsx)(n.az,{my:1,children:(0,a.jsx)(tL.W,{children:(0,a.jsx)(t_.K,{variant:"toolbar",size:"sm",icon:(0,a.jsx)(R.g,{icon:z.xD0}),boxSize:7,p:0,my:0,isDisabled:r,"aria-label":j.Ru._({id:"BmxaoW"})})})})}),(0,a.jsx)(tW.h,{children:(0,a.jsx)(tU.e,{p:1,children:(0,a.jsxs)(n.az,{ref:y,userSelect:"none",position:"relative",children:[(0,a.jsx)(n.az,{ref:b,borderRadius:"full",boxSize:5,pos:"absolute",zIndex:"overlay",border:"2px solid",borderColor:"gray.100",pointerEvents:"none",boxShadow:"0 0 0 2px rgba(0,0,0,.1)",bg:"white"}),u&&(0,a.jsx)(tG.g,{maxW:"300px",ratio:m||1,position:"relative",children:(0,a.jsx)(tv._,{pointerEvents:"none",src:(0,tY.Ub)(u,tY.p7,s.meta),fallbackSrc:u,objectFit:"cover",position:"absolute",top:0,insetStart:0,width:"100%",height:"100%"})}),(0,a.jsx)(B.$,{opacity:v?1:0,pos:"absolute",bottom:3,insetEnd:3,variant:"plain",size:"xs",onClick:k,children:(0,a.jsx)(_.x6,{id:"OfhWJH"})})]})})})]})};var t5=l(87145),t3=l(1771),t8=l(83272),t7=l(59835),t9=l(28478);let le=e=>{let{icon:t,label:l,children:n,iconProps:o,isHidden:i,...r}=e;return i?null:(0,a.jsxs)($.B,{direction:"row",spacing:8,alignItems:"center",justifyContent:"space-between",...r,children:[(0,a.jsxs)(C.s,{gap:4,alignItems:"center",children:[t&&(0,a.jsx)(R.g,{icon:t,fixedWidth:!0,...o}),(0,a.jsx)(Q.E,{children:l})]}),n]})},lt=e=>{let{icon:t,label:l,onClick:n,colorScheme:o="gray",secondaryIcon:i,secondaryLabel:r,secondaryAction:s,secondaryColorScheme:d="gray"}=e;return(0,a.jsxs)(t9.B,{px:5,py:3,bg:"gray.100",mx:-4,mb:-4,justify:r?"space-between":"center",children:[(0,a.jsx)(t9.Q,{children:r&&s&&(0,a.jsx)(B.$,{variant:"link",size:"sm",colorScheme:d,leftIcon:i?(0,a.jsx)(R.g,{icon:i,fixedWidth:!0}):void 0,onClick:s,onMouseDown:M.Fw,my:0,children:r})}),(0,a.jsx)(t9.Q,{children:(0,a.jsx)(B.$,{variant:"link",size:"sm",colorScheme:o,leftIcon:t?(0,a.jsx)(R.g,{icon:t,fixedWidth:!0}):void 0,onClick:n,onMouseDown:M.Fw,my:0,children:l})})]})},ll=e=>{let{...t}=e;return(0,a.jsx)(te.c,{my:1,...t})},la=e=>{let{children:t,...l}=e;return(0,a.jsx)($.B,{spacing:4,p:4,...l,children:t})},ln="14px",lo="28px",li=e=>{let{label:t,withSidePadding:l=!1,children:n,...o}=e;return(0,a.jsxs)($.B,{direction:"row",spacing:3,...o,children:[t&&(0,a.jsx)($.B,{alignSelf:"center",justifyContent:"start",minWidth:n?"max-content":"100%",h:lo,pl:l?ln:void 0,children:(0,a.jsx)(C.s,{justifyContent:"flex-start",alignItems:"center",width:"100%",height:"100%",children:t})}),n&&(0,a.jsx)($.B,{alignSelf:"center",width:"100%",pr:l?ln:void 0,h:lo,children:(0,a.jsx)(C.s,{justifyContent:"flex-end",alignItems:"center",width:"100%",height:"100%",children:n})})]})},lr=e=>{let{editor:t}=e;return(0,a.jsx)(ef.e,{dir:"ltr",spacing:1,size:"sm",children:F.gj.map(e=>{let{name:l,icon:n,checkActive:o,apply:i}=e;if(o&&i)return(0,a.jsx)(E.I,{label:l(),icon:n,onClick:()=>{i(t)},isActive:o(t),my:0},l())})})};var ls=l(11718);let ld=e=>{let{contributors:t,hiddenContributorIds:l,toggleOneVisibleContributor:n,toggleAllVisibleContributors:o,isDisabled:r=!1}=e,s=(null==l?void 0:l.length)===0;return(0,a.jsxs)(W.W,{isLazy:!0,children:[(0,a.jsx)(U.I,{as:B.$,variant:"plain",size:"sm",boxShadow:"none",minW:"max-content",textAlign:"left",rightIcon:(0,a.jsx)(ls.D,{}),isDisabled:r,children:s?(0,a.jsx)(_.x6,{id:"lZw9AX"}):(0,a.jsx)(_.x6,{id:"8Tg/JR"})}),(0,a.jsx)(G.c,{minWidth:"max-content",padding:0,children:(0,a.jsxs)($.B,{spacing:1,py:3,children:[(0,a.jsx)(li,{label:(0,a.jsx)(_.x6,{id:"lZw9AX"}),withSidePadding:!0,children:(0,a.jsx)(t7.d,{isChecked:s,onChange:o})}),(0,a.jsx)(te.c,{py:2}),(0,a.jsx)(li,{label:(0,a.jsx)(i._x,{children:(0,a.jsx)(Q.E,{children:(0,a.jsx)(_.x6,{id:"8Tg/JR"})})}),withSidePadding:!0}),t.map(e=>(0,a.jsx)(lu,{contributor:e,contributors:t,toggleOneVisibleContributor:n,hiddenContributorIds:l,allVisible:s},e.user.id))]})})]})},lu=e=>{let{contributor:t,contributors:l,toggleOneVisibleContributor:n,hiddenContributorIds:o,allVisible:r}=e,s=l.length-o.length==1&&!o.includes(t.user.id);return(0,a.jsxs)(li,{label:(0,a.jsxs)(C.s,{alignItems:"center",gap:2,children:[(0,a.jsx)(i.Vc,{size:"xs",src:t.user.profileImageUrl,opacity:r?.5:1}),(0,a.jsx)(Q.E,{fontSize:"md",fontFamily:"Inter, sans-serif",opacity:r?.5:1,sx:{cursor:r?"default":"text"},children:t.user.displayName})]}),paddingY:1.25,withSidePadding:!0,children:[(0,a.jsx)(td.h,{w:4}),(0,a.jsx)(t7.d,{isChecked:!o.includes(t.user.id),onChange:()=>n(t.user.id),disabled:s})]})},lc=e=>{let{contributors:t,hiddenContributorIds:l,hasMultipleContributors:n,toggleOneVisibleContributor:o,toggleAllVisibleContributors:i}=e;return(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"YqsXfH"}),icon:z.VFr,children:(0,a.jsx)(ld,{contributors:t,hiddenContributorIds:l,toggleOneVisibleContributor:o,toggleAllVisibleContributors:i,isDisabled:!n})})};var lm=l(11403),lf=l(60524);let lp=e=>{let{children:t,...l}=e,{content:n}=(0,lm.o5)("Popover");return(0,a.jsx)(lf.B.div,{__css:n,p:0,overflow:"hidden",borderWidth:0,minW:"auto",width:"auto",...l,children:t})},lg=()=>({square:{icon:z.Nfw,label:(0,a.jsx)(_.x6,{id:"du/PIl"})},landscape:{icon:z.vti,label:(0,a.jsx)(_.x6,{id:"BZXXSi"})},portrait:{icon:z.b0A,label:(0,a.jsx)(_.x6,{id:"79gnko"})}}),lh=e=>{let{selection:t,editor:l}=e,n=lg(),o=t.node.attrs;return(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"7bRShe"}),icon:z.VGw,children:(0,a.jsx)(ef.e,{children:Object.entries(n).map(e=>{let[n,{icon:i,label:r}]=e;return(0,a.jsx)(E.I,{icon:i,label:r,onClick:()=>{l.chain().updateAttributes("gallery",{dimensions:n}).setNodeSelection(t.from).run()},isActive:o.dimensions===n},n)})})})};var lb=l(1984),ly=l(69951);let lv=e=>{let{selection:t,editor:l}=e,n=t.node.attrs.thumbHeight||ly.Aj,o=(0,d.useCallback)(e=>{l.chain().updateAttributes("gallery",{thumbHeight:e}).setNodeSelection(t.from).focus().run()},[l,t.from]);return(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"Cj2Gtd"}),icon:z.dwj,children:(0,a.jsxs)(lb.Ap,{"aria-label":"gallery-slider",min:ly.pg,max:ly.Vj,step:.25,value:n,onChange:o,w:"120px",focusThumbOnChange:!1,colorScheme:"trueblue",size:"sm",children:[(0,a.jsx)(lb.hB,{children:(0,a.jsx)(lb.hJ,{})}),(0,a.jsx)(lb.OQ,{background:"trueblue.500"})]})})},lk=()=>({flex:{title:(0,a.jsx)(_.x6,{id:"oNVcTP"}),description:(0,a.jsx)(_.x6,{id:"HfsL0F"})},grid:{title:(0,a.jsx)(_.x6,{id:"fY+Mvd"}),description:(0,a.jsx)(_.x6,{id:"Ur6uwh"})},logo:{title:(0,a.jsx)(_.x6,{id:"iG7KNr"}),description:(0,a.jsx)(_.x6,{id:"hcTCev"})}}),lw=e=>{let{selection:t,editor:l}=e,n=t.node.attrs,o=(0,d.useCallback)(e=>{let a="flex"===e&&n.thumbHeight{let[t,{title:l,description:n}]=e;return(0,a.jsxs)(eg.k,{value:t,onMouseDown:M.Fw,"data-testid":"display-style-option-".concat(t),children:[(0,a.jsx)(Q.E,{children:l}),(0,a.jsx)(Q.E,{fontSize:"xs",color:"gray.500",children:n})]},t)})})})]})},lx=e=>{let{selection:t,editor:l}=e,n=t.node.attrs.thumbSpacing||ly.mj,o=(0,d.useCallback)(e=>{l.chain().updateAttributes("gallery",{thumbSpacing:e}).setNodeSelection(t.from).focus().run()},[l,t.from]);return(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"EL5s3L"}),icon:z.dwj,children:(0,a.jsxs)(lb.Ap,{"aria-label":"gallery-slider",min:ly.BA,max:ly.ZX,step:.1,value:n,onChange:o,w:"120px",focusThumbOnChange:!1,colorScheme:"trueblue",size:"sm",children:[(0,a.jsx)(lb.hB,{children:(0,a.jsx)(lb.hJ,{})}),(0,a.jsx)(lb.OQ,{background:"trueblue.500"})]})})},lS=e=>{let{selection:t,editor:l}=e,n=t.node.attrs,o=!0===n.stretchFill||null===n.stretchFill;return(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"57WAKT"}),icon:z.fGk,children:(0,a.jsx)(t7.d,{isChecked:o,onChange:()=>{l.chain().updateAttributes("gallery",{stretchFill:!n.stretchFill}).setNodeSelection(t.from).run()}})})};var lA=l(15355),lC=l(78807),lz=l(802),lI=l(31948),lj=l(2057);let lF=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{none:{label:(0,a.jsx)(_.x6,{id:"gIjBW2"})},expand:{label:(0,a.jsx)(_.x6,{id:"1A3EXy"})},newTab:{label:e?(0,a.jsx)(_.x6,{id:"YdDilE"}):(0,a.jsx)(_.x6,{id:"XGRJzS"})}}},lB=e=>{let{handleClickBehaviorChange:t,currentClickBehavior:l,enableNoClickBehavior:n=!1,canAddLink:o=!1}=e,i=lF(o);return(0,a.jsxs)(W.W,{closeOnSelect:!0,isLazy:!0,autoSelect:!1,children:[(0,a.jsx)(U.I,{as:B.$,"data-testid":"click-behavior-dropdown",size:"sm",rightIcon:(0,a.jsx)(R.g,{fixedWidth:!0,icon:z.Jt$,transform:"shrink-6"}),boxShadow:"none",onMouseDown:M.Fw,children:i[l].label}),(0,a.jsx)(G.c,{zIndex:2,children:(0,a.jsx)(ep.i,{type:"radio",onChange:e=>{t(e)},value:l,children:Object.entries(i).map(e=>{let[t,{label:l}]=e;return"none"!==t||n?(0,a.jsx)(eg.k,{value:t,onMouseOver:M.Fw,onMouseDown:M.Fw,"data-testid":"click-behavior-option-".concat(t),children:(0,a.jsx)(Q.E,{children:l})},t):null})})})]})};var lR=l(76166),l_=l(35436),lM=l(66712),lE=l(70403),lT=l(15072),lO=l(22844),lP=l(85146),lN=l(98903);let lD=(0,d.memo)(e=>{let{label:t,icon:l,isFocused:n,focusedItemEl:i,onClick:r,onMouseMove:s}=e;return(0,a.jsx)(lP.ck,{px:2,py:2,mx:2,borderRadius:"md",ref:n?i:null,bg:n?"trueblue.50":"none",onClick:r,onMouseMove:s,onMouseDown:M.Fw,role:"option",cursor:"pointer",tabIndex:-1,children:(0,a.jsxs)(o.z,{pointerEvents:"none",children:[(0,a.jsx)(R.g,{icon:l,fixedWidth:!0,size:"sm"}),(0,a.jsx)(Q.E,{noOfLines:1,fontSize:"sm",w:"100%",children:t})]})})});lD.displayName="Option";let lL=(0,d.memo)(e=>{let{items:t,inputValue:l,focusedIndex:o,interactionRef:r,isScrollingRef:s,isFiltered:u,onMouseMove:c,onSelectItem:m}=e,f=t.reduce((e,t,l)=>("page"===t.type?e.pages.push({item:t,index:l}):"card"===t.type?e.cards.push({item:t,index:l}):"url"===t.type&&e.url.push({item:t,index:l}),e),{pages:[],cards:[],url:[]}),p=(0,d.useRef)(null),g=(0,d.useRef)(null);return(0,d.useEffect)(()=>{if("keyboard"!==r.current)return;let e=g.current,t=p.current;if(!e||!t)return;let l=t.clientHeight,a=e.offsetTop,n=e.offsetHeight;s.current=!0,t.scrollTo({top:a-l/2+n/2,behavior:"smooth"});let o=setTimeout(()=>{s.current=!1},50);return()=>{clearTimeout(o)}},[o,g,p,r,s]),(0,a.jsx)(n.az,{children:(0,a.jsxs)(lP.B8,{ref:p,pos:"relative",overflowY:"auto",maxH:"min(300px, 50vh)",children:[f.pages.map((e,t)=>{let{item:r,index:s}=e;return(0,a.jsxs)(n.az,{children:[0===t&&(0,a.jsx)(i._x,{ml:4,my:1,children:u?(0,a.jsx)(_.x6,{id:"rXYeDA",values:{inputValue:l}}):(0,a.jsx)(_.x6,{id:"QIUdjp"})}),(0,a.jsx)(lD,{label:lW(r),icon:z.A4h,isFocused:s===o,focusedItemEl:g,onClick:()=>m(r),onMouseMove:()=>c(s)})]},r.docId)}),f.cards.map((e,t)=>{let{item:r,index:s}=e;return(0,a.jsxs)(n.az,{children:[0===t&&(0,a.jsx)(i._x,{ml:4,my:1,children:u?(0,a.jsx)(_.x6,{id:"m+j0l8",values:{inputValue:l}}):(0,a.jsx)(_.x6,{id:"Ccpbzh"})}),(0,a.jsx)(lD,{label:lW(r),icon:z.vti,isFocused:s===o,focusedItemEl:g,onClick:()=>m(r),onMouseMove:()=>c(s)})]},r.cardId)}),f.url.map((e,t)=>{let{item:l,index:r}=e;return(0,a.jsxs)(n.az,{children:[0===t&&(0,a.jsx)(i._x,{ml:4,my:1,children:(0,a.jsx)(_.x6,{id:"wuJqqq"})}),(0,a.jsx)(lD,{label:l.value,icon:z.CQO,isFocused:r===o,focusedItemEl:g,onClick:()=>m(l),onMouseMove:()=>c(r)})]},"custom".concat(r))})]})})});lL.displayName="ListBox";let lW=e=>e.title||("card"===e.type?j.Ru._({id:"gLDJuJ"}):j.Ru._({id:"kveQAJ"})),lU=(e,t)=>lW(t).trim().toLowerCase().includes(e.trim().toLowerCase()),lG=e=>{let t=(0,ec.Se)(e)||(0,D.hc)(e)?e:"https://"+e;return(0,ec.AY)(t)?t:""},lH=e=>{let{items:t,inputValue:l}=e;return(0,d.useMemo)(()=>{let e=lG(l),a=[...t.filter(e=>lU(l,e)),""!==e?{type:"url",value:e}:null].filter(e=>!!e),n=a.length!==t.length;return{filteredItems:a,isFiltered:n}},[t,l])},lV=e=>{let{items:t,inputValue:l,onSelect:a,onRevert:n,popoverRef:o}=e,{isOpen:i,onClose:r,onOpen:s}=(0,tN.j)(),[u,c]=(0,d.useState)(null),m=(0,d.useRef)(null),f=(0,d.useRef)(!1),p=(0,d.useCallback)(()=>{r(),c(null)},[r]),g=(0,d.useCallback)(()=>{l&&(s(),c(0))},[l,s]),h=(0,d.useCallback)(e=>{var t;null!==(t=o.current)&&void 0!==t&&t.contains(e.relatedTarget)||p()},[p,o]),b=(0,d.useCallback)(e=>{a(e),p()},[p,a]),y=(0,d.useCallback)(e=>{switch(m.current="keyboard",e.key){case"Enter":case"Tab":{if(null===u)return;e.preventDefault();let l=t[u];l?b(l):p();return}case"Escape":e.preventDefault(),p(),n();return;case"ArrowDown":e.preventDefault(),i?c(e=>((null!=e?e:0)+1)%t.length):(s(),c(0));return;case"ArrowUp":e.preventDefault(),i?c(e=>{let l=(null!=e?e:0)-1;return l<0?t.length-1:l}):(s(),c(t.length-1));return}},[n,p,i,u,t,b,s]),v=(0,d.useCallback)(e=>{f.current||(m.current="mouse",c(e))},[]);return{isOpen:i,onClose:r,onOpen:s,focusedIndex:u,setFocusedIndex:c,handleSelectItem:b,onMouseMove:v,onKeyDown:y,onBlur:h,onFocus:g,interactionRef:m,isScrollingRef:f}},lq=(0,d.memo)(e=>{let{items:t,onSelect:l,onRevert:n,inputValue:o,setInputValue:i,inputRef:r}=e,s=(0,d.useRef)(null),{filteredItems:u,isFiltered:c}=lH({items:t,inputValue:o}),{onKeyDown:m,onMouseMove:f,focusedIndex:p,setFocusedIndex:g,interactionRef:h,isOpen:b,onClose:y,onOpen:v,onBlur:k,onFocus:w,handleSelectItem:x,isScrollingRef:S}=lV({items:u,onSelect:l,onRevert:n,popoverRef:s,inputValue:o}),A=(0,d.useCallback)(e=>{i(e.target.value),b||v(),g(0)},[b,v,g,i]),C=(0,d.useCallback)(()=>{b||(v(),g(0))},[b,v,g]);return(0,a.jsxs)(tD.A,{isLazy:!0,isOpen:b,onClose:y,autoFocus:!1,returnFocusOnClose:!1,matchWidth:!0,placement:"bottom",children:[(0,a.jsx)(lN.d,{children:(0,a.jsx)(P.p,{ref:r,size:"sm",placeholder:j.Ru._({id:"BHFH/3"}),value:o,onKeyDown:m,onFocus:w,onBlur:k,onChange:A,onClick:C})}),(0,a.jsx)(tW.h,{ref:s,w:"100%",h:"100%",display:0===u.length?"none":void 0,tabIndex:-1,_focusVisible:{outline:"none"},children:(0,a.jsx)(lL,{items:u,isFiltered:c,onSelectItem:x,onMouseMove:f,inputValue:o,focusedIndex:p,interactionRef:h,isScrollingRef:S})})]})});lq.displayName="PageAwareLinkComboBox";var lK=l(35147),lJ=l(30503);let l$=e=>{let{site:t}=e;return{linkablePages:null==t?void 0:t.routes.map(e=>{var t;return{docId:e.docId,title:null===(t=e.doc)||void 0===t?void 0:t.title}})}},lQ=e=>{let{href:t,linkablePages:l}=e;if(!t)return null;let a=(0,lJ.uT)(t);if(!a)return{href:t};let{docId:n,cardId:o}=a;return{...n&&(null==l?void 0:l.find(e=>e.docId===n))||null,href:t,cardId:o}},lY=e=>{let{href:t}=e,l=(0,c.GV)(lK.Gd);return(0,d.useMemo)(()=>{let{linkablePages:e}=l$({site:l}),a=lQ({href:t,linkablePages:e}),n=(null==a?void 0:a.docId)&&(null==l?void 0:l.id)&&(0,tB.pF)({docId:null==a?void 0:a.docId})||t,o=null==e?void 0:e.some(e=>e.docId===(null==a?void 0:a.docId));return{linkablePages:e,existingLink:a,newTabUrl:n,isPageLink:o}},[t,l])},lX=e=>{var t;let{href:l,inputValue:r,setInputValue:s,setHref:u,clearHref:m,inputRef:f,onCloseFocusRef:p}=e,g=(0,c.GV)(y.sX),h=(0,c.GV)(lO.rZ),{existingLink:b,linkablePages:v}=lY({href:l}),k=(0,d.useMemo)(()=>[...(v||[]).map(e=>({type:"page",docId:e.docId,title:e.title})),...h.map(e=>({type:"card",cardId:e.id,title:e.title}))],[v,h]),w=null==b?void 0:b.title,x=null!==(t=null==b?void 0:b.cardId)&&void 0!==t?t:void 0,{title:S}=(0,lT.d)({cardId:x}),A=(0,d.useCallback)(e=>{var t;e&&(u("url"===e.type?e.value:"page"===e.type?(0,tB.LN)({docId:e.docId,docTitle:e.title,absolute:!0}):(0,tB.Io)({cardId:e.cardId,docId:g})),null==p||null===(t=p.current)||void 0===t||t.focus({preventScroll:!0}))},[g,u,p]),C=(null==b?void 0:b.href)&&!b.docId;if(!b||C)return(0,a.jsx)(lq,{items:k,inputValue:r,setInputValue:s,inputRef:f,onSelect:A,onRevert:()=>{var e;s(l),null==p||null===(e=p.current)||void 0===e||e.focus()}});{let e=x?S||(0,a.jsx)(_.x6,{id:"gLDJuJ"}):w||(0,a.jsx)(_.x6,{id:"kveQAJ"});return(0,a.jsx)(o.z,{spacing:1,children:(0,a.jsx)(lE.vw,{pr:1,children:(0,a.jsxs)(o.z,{spacing:1,children:[(0,a.jsx)(R.g,{icon:x?z.vti:z.A4h}),(0,a.jsx)(i.Tz,{label:e,placement:"top",children:(0,a.jsx)(n.az,{noOfLines:1,children:e})}),m&&(0,a.jsx)(i.Tz,{label:(0,a.jsx)(_.x6,{id:"484LKL"}),placement:"top",children:(0,a.jsx)(t_.K,{size:"xs",minHeight:4,height:4,variant:"ghost","aria-label":j.Ru._({id:"484LKL"}),icon:(0,a.jsx)(R.g,{icon:z.yYc}),onMouseDown:M.Fw,onClick:()=>{m(),s("")}})})]})})})}},lZ="link-input-invalid-url",l0=e=>{let{editor:t,href:l,updateHref:o,clearHref:r,removeLink:s,isEmbedLink:u=!1}=e,[m,f]=(0,d.useState)(l),p=(0,d.useRef)(null),g=(0,d.useRef)(null),h=(0,ez.d)(),b=m!==l,v=!!(t.multipageEnabled||t.isSiteNavbarEditor),k=(0,c.GV)(y.bO),w=(0,et.Cf)(l,k),{newTabUrl:x}=lY({href:l});(0,d.useEffect)(()=>{f(l)},[l]),(0,d.useEffect)(()=>{!l&&p.current&&setTimeout(()=>{var e;null==p||null===(e=p.current)||void 0===e||e.focus()})},[l]);let S=(0,d.useCallback)(e=>{if(!e)return;let t=e;if(u){let l=(0,lM.Sf)(e);l&&(t=l)}if(t=(0,ec.Se)(t)||(0,D.hc)(t)?t:"https://"+t,!(0,ec.AY)(t)){o(""),h.isActive(lZ)||h({id:lZ,title:(0,a.jsx)(_.x6,{id:"sBZMWb"}),description:(0,a.jsx)(_.x6,{id:"jEw0Mr"}),status:"error",position:"top",duration:3e3,isClosable:!0});return}o(t),f(t)},[u,h,o]),A=(0,d.useCallback)(e=>{if(w){let a=(0,et.Ww)(l);(0,N.T)(t,e,a)}else try{window.open(x,"_blank")}catch(e){console.error("(caught) LinkInput2 error going to URL",e)}},[w,t,l,x]);return(0,a.jsxs)(C.s,{gap:2,justify:"space-between",alignItems:"center",children:[v&&!u?(0,a.jsxs)(C.s,{flex:1,children:[(0,a.jsx)(lX,{href:l,inputValue:m,setInputValue:f,setHref:S,clearHref:r,inputRef:p,onCloseFocusRef:g}),(0,a.jsx)(n.az,{w:"0",h:"0",ref:g,tabIndex:-1})]}):(0,a.jsxs)(lR.M,{children:[(0,a.jsx)(P.p,{"data-testid":"link-input",ref:p,value:m,placeholder:j.Ru._({id:"Ilf1mg"}),onChange:e=>{f(e.target.value)},onKeyUp:e=>{"Enter"===e.key&&(e.preventDefault(),S(m),t.commands.focus())},size:"sm"}),m.length>0&&b&&(0,a.jsx)(l_.t,{top:"50%",transform:"translateY(-50%)",children:(0,a.jsx)(i.Tz,{placement:"top",label:(0,a.jsx)(_.x6,{id:"tfDRzk"}),children:(0,a.jsx)(t_.K,{"aria-label":j.Ru._({id:"tfDRzk"}),variant:"ghost",size:"xs",onClick:()=>{S(m)},icon:(0,a.jsx)(R.g,{icon:z.e68})})})})]}),(0,a.jsxs)(ef.e,{spacing:1,size:"sm",onMouseDown:M.Fw,children:[s&&(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"484LKL"}),icon:z.vev,onClick:s,my:0}),l&&(0,a.jsx)(E.I,{label:w?(0,a.jsx)(_.x6,{id:"088Oxr"}):(0,a.jsx)(_.x6,{id:"fOj0+R"}),icon:w?z.dmS:z.vMs,onClick:A,my:0})]})]})};var l1=l(33683);let l2=e=>{let{buttonList:t}=e,l=t.filter(e=>!e.isHidden),o=1===l.length,r=l.length<=5?5:4,s=l.slice(0,r),d=l.slice(r,l.length);return(0,a.jsxs)(ef.e,{size:"sm",width:"100%",children:[s.map(e=>{let{key:t,label:l,ariaLabel:r,action:s,icon:d,customIcon:u,isDisabled:c=!1,isLoading:m=!1}=e;return d||u?(0,a.jsx)(i.Tz,{label:l,placement:"top",children:(0,a.jsx)(n.az,{flex:o?void 0:1,width:o?"33%":void 0,tabIndex:c?-1:void 0,children:(0,a.jsx)(t_.K,{"aria-label":r,icon:u||(0,a.jsx)(R.g,{icon:d,fixedWidth:!0}),onClick:s,w:"100%",isDisabled:c,isLoading:m,onMouseDown:M.Fw,shadow:"none"})})},t):null}),!!d.length&&(0,a.jsxs)(W.W,{children:[(0,a.jsx)(i.Tz,{placement:"top",label:(0,a.jsx)(_.x6,{id:"3Siwmw"}),children:(0,a.jsx)(U.I,{as:t_.K,"aria-label":j.Ru._({id:"3Siwmw"}),icon:(0,a.jsx)(R.g,{icon:z.Dwc,fixedWidth:!0}),flex:1,shadow:"none"})}),(0,a.jsx)(G.c,{children:d.map(e=>{let{key:t,label:l,action:n,icon:o,customIcon:i}=e;return(0,a.jsx)(l1.D,{icon:i||o&&(0,a.jsx)(R.g,{icon:o,fixedWidth:!0}),onClick:n,children:l},t)})})]})]})},l6=()=>({inset:{title:j.Ru._({id:"Jn5DbR"})},circle:{title:j.Ru._({id:"7xMmki"})}}),l4=e=>{let{clipType:t,onChange:l}=e;return t?(0,a.jsxs)(lj.ms,{children:[(0,a.jsx)(lj.gf,{size:"sm",borderRadius:"full",minWidth:"105px",rightIcon:(0,a.jsx)(R.g,{icon:z.Jt$,transform:"shrink-6"}),variant:"toolbar",ps:2,onMouseDown:M.Fw,children:l6()[t].title}),(0,a.jsx)(lj.Q5,{children:Object.entries(l6()).map(e=>{let[o,{title:i}]=e;return(0,a.jsx)(lj.tJ,{value:o,fontSize:"sm",fontWeight:600,icon:(0,a.jsx)(n.az,{visibility:o===t?"visible":"hidden",children:(0,a.jsx)(R.g,{icon:z.e68})}),onMouseDown:M.Fw,onClick:()=>{l(o)},children:(0,a.jsx)(Q.E,{children:i})},o)})})]}):null},l5={expand:z.bMI,newTab:z.Ju_,none:z.IPg};var l3=l(24643),l8=l(13934);let l7=e=>{let{editor:t,selection:l,handleDuplicate:n}=e,o=(0,d.useCallback)(()=>{t.chain().insertContentAt(l.from+l.node.nodeSize,l.node.toJSON()).selectInsertedNode().run()},[t,l]);return(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"euc6Ns"}),icon:z.$3n,onClick:n||o,testId:"duplicate-node-button"})},l9=e=>{let{editor:t,label:l,icon:n}=e;return(0,a.jsx)(E.I,{label:l,onClick:()=>{t.chain().selectParentNode().run()},children:n?(0,a.jsx)(R.g,{icon:n}):(0,a.jsx)(R.g,{icon:z.Hmw,flip:"horizontal"})})},ae={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/layout-3-cols.478d87d6.svg",height:25,width:20,blurWidth:0,blurHeight:0},at={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/layout-30-70.019e8aa0.svg",height:25,width:20,blurWidth:0,blurHeight:0},al={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/layout-4-cols.bc7869e3.svg",height:25,width:20,blurWidth:0,blurHeight:0},aa={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/layout-50-50.a28ea4d4.svg",height:25,width:20,blurWidth:0,blurHeight:0},an={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/layout-70-30.abcf64e9.svg",height:25,width:20,blurWidth:0,blurHeight:0},ao=()=>[{name:j.Ru._({id:"oCWIE5"}),testId:"layout-preset-5050",image:aa,value:[50,50]},{name:j.Ru._({id:"eWUI4Z"}),testId:"layout-preset-7030",image:an,value:[70,30]},{name:j.Ru._({id:"hOcihM"}),testId:"layout-preset-3070",image:at,value:[30,70]},{name:j.Ru._({id:"OnuuaA"}),testId:"layout-preset-3col",image:ae,value:[33.33,33.33,33.34]},{name:j.Ru._({id:"hexbw8"}),testId:"layout-preset-4col",image:al,value:[25,25,25,25]}];var ai=l(33919),ar=l(23231);let as=()=>({link:{title:(0,a.jsx)(_.x6,{id:"yzF66j"})},button:{title:(0,a.jsx)(_.x6,{id:"hxBFty"})},preview:{title:(0,a.jsx)(_.x6,{id:"rdUucN"})},inline:{title:(0,a.jsx)(_.x6,{id:"KKBlUU"})}}),ad=e=>{let{editor:t,selection:l,isDisabled:n}=e,o=(0,r.KP)(e=>"button"===e.type.name)(l),i=l instanceof s.U3?o?"button":"link":l.node.type.name,u="link"===i,c="button"===i,m=t.getAttributes(i),f=c?"button":u?"link":"displayStyle"in m&&m.displayStyle||"inline",p=(0,d.useCallback)(e=>{if(i===e)return;let l="inline"===e||"preview"===e;switch(i){case"link":l?t.commands.convertLinkToMedia(e):"button"===e&&t.commands.convertLinkToButton();break;case"button":"link"===e?t.commands.convertButtonToLink():l&&t.commands.convertButtonToMedia(e);break;default:"link"===e?t.commands.convertMediaToLink():"button"===e?t.commands.convertMediaToButton():t.commands.updateAttributes(i,{displayStyle:e})}},[t,i]),g=as();return(0,a.jsxs)(W.W,{closeOnSelect:!0,isLazy:!0,autoSelect:!1,children:[(0,a.jsx)(U.I,{as:B.$,"data-testid":"display-style-dropdown",isDisabled:n,size:"sm",rightIcon:(0,a.jsx)(R.g,{fixedWidth:!0,icon:z.Jt$,transform:"shrink-6"}),boxShadow:"none",onMouseDown:M.Fw,children:g[f].title}),(0,a.jsx)(G.c,{zIndex:2,children:(0,a.jsx)(ep.i,{type:"radio",onChange:p,value:f,children:Object.entries(g).map(e=>{let[t,{title:l}]=e;return(0,a.jsx)(eg.k,{value:t,onMouseDown:M.Fw,"data-testid":"display-style-option-".concat(t),children:(0,a.jsx)(Q.E,{children:l})},t)})})})]})},au=e=>{let{editor:t,selection:l}=e,{href:n}=t.getAttributes("button"),{isPageLink:o}=lY({href:n}),i=(0,c.GV)(y.SJ),r=(0,t3.jO)(i),u=(0,t3.Ik)(r),m=(0,ai.yh)(r),f=t.getAttributes("button").color,p=l.$from.node(-1),g=ar.Dn[p.type.name],h=(0,ar.vf)().filter(e=>g.variants.includes(e.key)),b=(0,d.useCallback)(()=>t.commands.handleButtonDelete(!1),[t]),v=(0,d.useCallback)(e=>{t.commands.updateAttributes("button",{color:e})},[t]);return(0,a.jsxs)(la,{overflow:"hidden",children:[g.linkDropdownEnabled&&n&&(l instanceof s.U3||l instanceof s.nh)&&(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"/SVg/B"}),icon:z.n2$,children:(0,a.jsx)(ad,{editor:t,selection:l,isDisabled:o})}),(0,a.jsx)(l0,{href:n||"",updateHref:e=>{t.commands.updateAttributes("button",{href:e})},clearHref:()=>{t.commands.updateAttributes("button",{href:""})},editor:t}),h.length>=2&&(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"1CalO6"}),icon:z.Cpz,children:(0,a.jsx)(ef.e,{spacing:1,size:"sm",onMouseDown:M.Fw,children:h.map(e=>{let{name:l,icon:n,key:o}=e;return(0,a.jsx)(E.I,{label:l,icon:n,onClick:()=>{t.commands.updateAttributes("button",{variant:o})},isActive:t.isActive("button",{variant:o}),my:0},l)})})}),g.alignEnabled&&(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"0j+RGO"}),icon:z.ecg,children:(0,a.jsx)(ef.e,{dir:"ltr",spacing:0,size:"sm",onMouseDown:M.Fw,children:F.gj.map(e=>{let{name:l,icon:n,checkActive:o,apply:i}=e;if(o&&i)return(0,a.jsx)(E.I,{label:l(),icon:n,onClick:()=>{i(t)},isActive:o(t),my:0},l())})})}),g.colorEnabled&&(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"jZlrte"}),icon:z.wIs,children:(0,a.jsx)(ef.e,{spacing:0,size:"sm",onMouseDown:M.Fw,children:(0,a.jsxs)(W.W,{isLazy:!0,children:[(0,a.jsx)(Z.v,{color:f||u,isDefaultColor:null===f||f===u}),(0,a.jsx)(G.c,{overflow:"hidden",children:(0,a.jsx)(ee.b,{currentColor:f||(m?null:u),setColor:v,source:"ButtonColor"})})]})})}),(0,a.jsx)(lt,{label:(0,a.jsx)(_.x6,{id:"cnGeoo"}),icon:z.yLS,onClick:b,colorScheme:"red"})]})};var ac=l(91500);let am="embed-formatting-invalid-error",af=e=>{let{existingLink:t,handleRemoveClick:l}=e,r=(null==t?void 0:t.href)&&!t.docId,{title:s,href:d,cardId:u}=t||{},m=(0,c.GV)((0,lO.F1)(u||""));return r?(0,a.jsx)(o.z,{spacing:2,children:(0,a.jsxs)(lR.M,{size:"sm",children:[(0,a.jsx)(P.p,{size:"sm",isReadOnly:!0,value:d}),(0,a.jsx)(l_.t,{children:(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"/PoNoq"}),icon:z.MT7,onClick:()=>l("url")})})]})}):(0,a.jsx)(o.z,{spacing:1,children:(0,a.jsx)(lE.vw,{children:(0,a.jsxs)(o.z,{spacing:1,children:[(0,a.jsx)(R.g,{icon:u?z.vti:z.A4h}),(0,a.jsx)(i.Tz,{label:u?m:s,placement:"top",children:(0,a.jsx)(n.az,{noOfLines:1,children:u?m:s})}),(0,a.jsx)(i.Tz,{label:j.Ru._({id:"/PoNoq"}),placement:"top",children:(0,a.jsx)(t_.K,{size:"xxs",variant:"ghost","aria-label":j.Ru._({id:"/PoNoq"}),icon:(0,a.jsx)(R.g,{icon:z.MT7}),onClick:()=>l(u?"cards":"pages")})})]})})})},ap=e=>{let{title:t,url:l,updateHref:n,icon:o,fallbackTitle:r}=e;return(0,a.jsx)(i.Tz,{label:t,placement:"top",children:(0,a.jsx)(B.$,{w:"100%",onClick:()=>{n(l)},variant:"ghost",colorScheme:"gray",fontWeight:"500",px:2,size:"sm",justifyContent:"flex-start",leftIcon:(0,a.jsx)(R.g,{icon:o}),children:(0,a.jsx)(Q.E,{textAlign:"left",w:"100%",noOfLines:1,display:"inline",children:t||r})},l)})},ag=e=>{let{title:t,docId:l,updateHref:n}=e,o=(0,tB.LN)({docId:l,docTitle:t,absolute:!0});return(0,a.jsx)(ap,{title:t,url:o,updateHref:n,icon:z.A4h,fallbackTitle:(0,a.jsx)(_.x6,{id:"kveQAJ"})})},ah=e=>{let{items:t,updateHref:l}=e,[n]=(0,d.useState)(""),o=(0,d.useRef)(null),i=t.filter(e=>{var t;return null===(t=e.title)||void 0===t?void 0:t.toLowerCase().includes(n.toLowerCase())});return(0,d.useEffect)(()=>{var e;(null==o?void 0:o.current)&&(null==o||null===(e=o.current)||void 0===e||e.focus())},[]),(0,a.jsxs)($.B,{mx:-4,children:[(0,a.jsx)(Q.E,{color:"gray.500",fontSize:"sm",fontWeight:"600",children:(0,a.jsx)(_.x6,{id:"QIUdjp"})}),(0,a.jsx)($.B,{spacing:0,children:i.map(e=>(0,a.jsx)(ag,{updateHref:l,title:e.title,docId:e.docId},e.docId))})]})},ab=e=>{let{updateHref:t,title:l,cardId:n}=e,o=(0,c.GV)(y.sX),i=(0,tB.Io)({cardId:n,docId:o});return(0,a.jsx)(ap,{title:l,url:i,updateHref:t,icon:z.vti,fallbackTitle:(0,a.jsx)(_.x6,{id:"gLDJuJ"})})},ay=e=>{let{items:t,updateHref:l}=e,n=(0,d.useRef)(null);return(0,d.useEffect)(()=>{var e;(null==n?void 0:n.current)&&(null==n||null===(e=n.current)||void 0===e||e.focus())},[]),(0,a.jsxs)($.B,{mx:-4,children:[(0,a.jsx)(Q.E,{color:"gray.500",fontSize:"sm",fontWeight:"600",children:(0,a.jsx)(_.x6,{id:"L8qw04"})}),(0,a.jsx)($.B,{spacing:0,children:null==t?void 0:t.map(e=>(0,a.jsx)(ab,{updateHref:l,title:e.title,cardId:e.id},e.id))})]})},av=e=>{let{updateHref:t,initialHref:l}=e,n=(0,d.useRef)(null),[o,i]=(0,d.useState)(!1),[r,s]=(0,d.useState)(l||""),u=e=>{if(!e)return;let l=(0,ec.Se)(e)||(0,D.hc)(e)?e:"http://"+e;(0,ec.AY)(l)&&t(l)};return(0,d.useEffect)(()=>{var e;(null==n?void 0:n.current)&&(null==n||null===(e=n.current)||void 0===e||e.focus())},[]),(0,a.jsxs)($.B,{mx:-2,children:[(0,a.jsxs)(lR.M,{size:"sm",children:[(0,a.jsx)(P.p,{ref:n,size:"sm",value:r,placeholder:"Paste a link and hit enter",onChange:e=>{s(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&r.trim().length>0&&(e.preventDefault(),u(r))},onFocus:()=>i(!0),onBlur:()=>i(!1)}),r.length>0&&(0,a.jsx)(l_.t,{bottom:0,top:"auto",children:(0,a.jsx)(t_.K,{"aria-label":j.Ru._({id:"hQRttt"}),variant:"ghost",size:"xs",onClick:()=>u(r),icon:(0,a.jsx)(R.g,{icon:z.e68})})})]}),r.length>0&&o&&(0,a.jsx)(Q.E,{w:"100%",fontSize:"xxs",color:"gray.500",children:(0,a.jsx)(_.x6,{id:"j6RzX0"})})]})},ak=e=>{let{updateHref:t,initialTab:l,initialHref:o}=e,{linkablePages:i}=l$({site:(0,c.GV)(lK.Gd)}),r=(0,c.GV)(lO.rZ),s=(null==i?void 0:i.length)&&i.length>0;return(0,a.jsx)(n.az,{children:(0,a.jsxs)(H.t,{size:"sm",variant:"soft-rounded",isFitted:!0,colorScheme:"trueblue",defaultIndex:"pages"===l?0:"url"===l?1:2,children:[(0,a.jsxs)(V.w,{children:[s&&(0,a.jsx)(q.o,{children:(0,a.jsx)(_.x6,{id:"wRR604"})}),(0,a.jsx)(q.o,{children:(0,a.jsx)(_.x6,{id:"IagCbF"})}),(0,a.jsx)(q.o,{children:(0,a.jsx)(_.x6,{id:"Ccpbzh"})})]}),(0,a.jsxs)(K.T,{children:[s&&(0,a.jsx)(J.K,{maxH:"min(300px, 50vh)",overflowY:"auto",children:(0,a.jsx)(ah,{items:i,updateHref:t})}),(0,a.jsx)(J.K,{maxH:"min(300px, 50vh)",overflowY:"auto",children:(0,a.jsx)(av,{updateHref:t,initialHref:o})}),(0,a.jsx)(J.K,{maxH:"min(300px, 50vh)",overflowY:"auto",children:(0,a.jsx)(ay,{items:r,updateHref:t})})]})]})})},aw=e=>{let{editor:t,selection:l}=e,n=(0,c.GV)(lK.Gd),{linkablePages:i}=l$({site:n}),[s,u]=(0,d.useState)("pages"),[m,f]=(0,d.useState)(null),p=t.getAttributes("button").href||"",g=(0,d.useCallback)(()=>t.commands.handleButtonDelete(!1),[t]),h=l.$from.node(-1),b=ar.Dn[h.type.name],y=(0,ar.vf)().filter(e=>b.variants.includes(e.key)),v=lQ({href:p,linkablePages:i}),k=(null==v?void 0:v.docId)&&(null==n?void 0:n.id)&&(0,tB.pF)({docId:null==v?void 0:v.docId})||p;return(0,a.jsxs)($.B,{w:v?void 0:"320px",minW:"min(80vw, 320px)",maxW:"50vw",maxH:"max(30vh, 400px)",children:[(0,a.jsxs)(o.z,{justify:"space-between",pt:1,borderBottomWidth:v?0:1,mx:-2,px:2,children:[y.length>=2&&y.map(e=>{let{name:l,icon:n,key:o}=e;return(0,a.jsx)(E.I,{label:l,icon:n,onClick:()=>{t.commands.updateAttributes("button",{variant:o})},isActive:t.isActive("button",{variant:o})},l)}),b.alignEnabled&&(0,a.jsx)(C.s,{dir:"ltr",children:F.gj.map(e=>{let{name:l,icon:n,checkActive:o,apply:i}=e;if(o&&i)return(0,a.jsx)(E.I,{label:l(),icon:n,onClick:()=>{i(t)},isActive:o(t)},l())})}),v&&(0,a.jsx)(af,{existingLink:v,handleRemoveClick:e=>{if(u(e),"url"===e&&f(p),t.chain().updateAttributes("button",{href:null}).run(),(0,r.KP)(e=>"navbarLinks"===e.type.name||"navbarButtons"===e.type.name)(l)){let e=(0,r.KP)(e=>"button"===e.type.name)(l);e&&t.commands.selectNodeAtPos(e.start+1)}}}),(0,a.jsx)(td.h,{}),v&&!v.cardId&&(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"Ky3sBN"}),icon:z.AaJ,onClick:()=>window.open(k,"_blank")}),(0,a.jsx)(T,{editor:t,handleDelete:g})]}),!v&&(0,a.jsx)(ak,{updateHref:e=>{if(t.chain().updateAttributes("button",{href:e}).run(),(0,r.KP)(e=>"navbarLinks"===e.type.name||"navbarButtons"===e.type.name)(l)){let e=(0,r.KP)(e=>"button"===e.type.name)(l);e&&t.commands.selectNodeAtPos(e.start+1)}},initialTab:s,initialHref:m})]})};var ax=l(48292),aS=l(48365),aA=l(40452),aC=l(75621),az=l(65641),aI=l(34095),aj=l(40173);let aF=e=>{let{editor:t,testId:l,disabled:n,icon:o,label:r}=e;return t.shouldUseLiteMenus?null:(0,a.jsxs)(W.W,{isLazy:!0,onClose:()=>(0,en.q)(t),children:[(0,a.jsx)(i.Tz,{placement:"top",label:r,children:(0,a.jsx)(U.I,{isDisabled:n,as:B.$,variant:"toolbar","data-testid":l,onMouseDown:M.Fw,rightIcon:(0,a.jsx)(R.g,{icon:z.Jt$,transform:"shrink-6"}),children:o&&(0,a.jsx)(R.g,{icon:o})})}),(0,a.jsx)(aj.Z,{children:(0,a.jsx)(G.c,{minW:"auto",zIndex:"modalPopover",dir:"ltr",children:F.gj.map(e=>{let{key:l,name:n,shortcut:o,icon:i,checkActive:r,apply:s}=e;return(0,a.jsx)(E.I,{icon:i,label:n(),onClick:()=>null==s?void 0:s(t),isActive:null==r?void 0:r(t),testId:l,shortcut:o},l)})})})]})};var aB=l(48637),aR=l(16723),a_=l(59277),aM=l(77256);let aE=()=>({list:{label:j.Ru._({id:"Ci8I/9"})},wrap:{label:j.Ru._({id:"T4+jD7"})}}),aT=()=>{let e=(0,aM.Vo)();return[{key:"toggle",name:()=>j.Ru._({id:"JFciKP"}),icon:z.ijD,node:"toggle",description:()=>j.Ru._({id:"rhfAX6"}),apply:t=>{(0,aM.Jb)(e.toggle,tf.oU.FORMATTING_MENU),t.chain().wrapWithToggle().run()},group:"wrap"},{key:"convertToNestedCard",name:()=>j.Ru._({id:"lOmsEK"}),node:"card",description:()=>j.Ru._({id:"gRMoQV"}),icon:z.ViY,apply:t=>{(0,aM.Jb)(e.insertCardInside,tf.oU.FORMATTING_MENU),t.chain().convertToNestedCard().run()},checkDisabled:e=>!e.schema.nodes.card||!(0,et.pO)(e,"card"),group:"wrap"},{key:"blockquote",name:()=>j.Ru._({id:"OLMhPm"}),node:"blockquote",description:()=>j.Ru._({id:"2yuhT7"}),icon:z.R9H,shortcut:"> Quote",apply:e=>e.chain().wrapWithAnnotations("blockquote").run(),checkDisabled:e=>!(0,et.pO)(e,"blockquote"),group:"wrap"},{key:"calloutBox",name:()=>j.Ru._({id:"1E4ojF"}),node:"calloutBox",description:()=>j.Ru._({id:"4Wf98Z"}),icon:z.iW_,apply:e=>e.chain().wrapWithAnnotations("calloutBox",{variant:"info"}).run(),checkDisabled:e=>!(0,et.pO)(e,"calloutBox"),group:"wrap"},{key:"listToCards",name:()=>j.Ru._({id:"FJ18tL"}),icon:z.vGi,description:()=>j.Ru._({id:"hWesxP"}),group:"list",apply:e=>e.commands.listToCards(),checkDisabled:e=>!(0,aR.Jx)(e)},...(0,a_.P3)()]};var aO=l(17119),aP=l(12554),aN=l(89284),aD=l(80917),aL=l(33795),aW=l(60443);let aU=[[{key:"textColor",name:()=>j.Ru._({id:"MapzEo"}),icon:z.jrc,shortcut:"Mod+Shift+H",enabledForTables:!0,checkDisabled:aP.NO}],[{key:"bold",name:()=>j.Ru._({id:"KmydK6"}),mark:"bold",icon:I.l5I,shortcut:"Mod+B",enabledForTables:!0},{key:"italic",name:()=>j.Ru._({id:"pzutoc"}),mark:"italic",icon:z.SIw,shortcut:"Mod+I",enabledForTables:!0},{key:"underline",name:()=>j.Ru._({id:"YyXtnN"}),mark:"underline",icon:z.chs,shortcut:"Mod+U",enabledForTables:!0},{key:"strike",name:()=>j.Ru._({id:"WhOsNE"}),mark:"strike",icon:z.$6A,shortcut:"Mod+Shift+X"},{key:"code",name:()=>j.Ru._({id:"EWPtMO"}),mark:"code",icon:z.jTw,shortcut:"Mod+E"},{key:"math",name:()=>j.Ru._({id:"l8rp1O"}),apply:e=>e.commands.convertToMathInline(),icon:z.Dkf,featureFlag:"math",shortcut:"$$",checkDisabled:()=>!0},{key:"removeFormatting",name:()=>j.Ru._({id:"bj5jMy"}),icon:z.Dkb,apply:e=>e.chain().unsetAllMarks().focus().run(),enabledForTables:!0}],[{key:"link",name:()=>j.Ru._({id:"yzF66j"}),mark:"link",icon:z.CQO,shortcut:"Mod+K"},{key:"footnote",name:()=>j.Ru._({id:"ONAJuB"}),icon:z.sxe,apply:e=>{(0,aD.J)((0,aN.Vo)().footnote,tf.oU.FORMATTING_MENU),e.chain().toggleFootnote().run()},checkActive:e=>e.isActive("footnoteLabel"),shortcut:"Mod+Alt+F",checkDisabled:e=>(0,eh.Q)(e)||!(0,et.pO)(e,"footnote")||(0,aP.NO)(e)}],[{key:"numbered",name:()=>j.Ru._({id:"M3G9ZD"}),icon:z.Tsj,node:"numbered",checkActive:e=>(0,aL.Lf)(e,aW.e.Numbered),shortcut:"Mod+/ or Mod+Shift+7",apply:e=>e.chain().toggleListItems({variant:aW.e.Numbered}).focus().run()},{key:"bullet",name:()=>j.Ru._({id:"ynb7Kh"}),icon:z.pch,node:"bullet",checkActive:e=>(0,aL.Lf)(e,aW.e.Bullet),apply:e=>e.chain().toggleListItems({variant:aW.e.Bullet}).focus().run(),shortcut:"Mod+. or Mod+Shift+8"},{key:"todo",name:()=>j.Ru._({id:"rCIbrq"}),icon:z.AgW,node:"todo",checkActive:e=>(0,aL.Lf)(e,aW.e.Todo),shortcut:"Mod+, or Mod+Shift+9",apply:e=>{let{from:t,to:l}=e.state.selection;e.chain().toggleListItems({variant:aW.e.Todo}).run(),requestAnimationFrame(()=>e.chain().focus().setTextSelection({from:t,to:l}).run())}}],[{key:"alignText",name:()=>j.Ru._({id:"6Hkcin"}),icon:z.ecg}],[{key:"convertText",name:()=>j.Ru._({id:"cXIM1U"}),checkDisabled:e=>!!e.shouldUseLiteMenus,icon:z.VH5},{key:"rewriteText",name:()=>j.Ru._({id:"C4t1b/"}),icon:I.p7g,checkDisabled:e=>!!e.shouldUseLiteMenus,featureFlag:"aiRewrite",needsConnection:!0}],[{key:"comment",name:()=>j.Ru._({id:"oFsfkI"}),icon:z.DN2,checkDisabled:e=>(0,eh.Q)(e)||(0,aP.NO)(e)||!!e.shouldUseLiteMenus,needsConnection:!0,apply:e=>{let{selection:t}=e.state,{from:l,to:a}=t,[n]=(0,et.TK)(e.state.doc.resolve(l),(e,t)=>(0,aO.cE)(t));if(!n){console.warn("[TEXT_FORMATTING_COMMANDS] Add comment - Unable to find annotatable parent for this selection");return}let o=(0,et.r$)(e.state.doc,l,a,e=>"footnote"!==e.type.name&&"cardNotes"!==e.type.name,"__BLOCK_SEPARATOR_PLACEHOLDER").split("__BLOCK_SEPARATOR_PLACEHOLDER").join("

");tw.LF.emit(tw.DN.CREATE_COMMENT_FROM_SELECTION,{selectionPos:l,parentPos:n.pos,text:o})}}]],aG=function(e,t){var l;let a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!!(t.needsConnection&&a||t.featureFlag&&!e2.of.get(t.featureFlag)||(null===(l=t.checkDisabled)||void 0===l?void 0:l.call(t,e)))||(t.node?!(0,et.aq)(e,t.node):!!t.mark&&!(0,et.Au)(e,t.mark))},aH=e=>{let{editor:t,testId:l,disabled:n,icon:o,label:r}=e,{isInOfflineMode:s}=(0,e1.u)(),d=aT().filter(e=>e.apply&&!aG(t,e,s));return 0===d.length?null:(0,a.jsxs)(W.W,{isLazy:!0,onClose:()=>(0,en.q)(t),children:[(0,a.jsx)(i.Tz,{placement:"top",label:r,children:(0,a.jsx)(U.I,{isDisabled:n,as:B.$,variant:"toolbar","data-testid":l,onMouseDown:M.Fw,rightIcon:(0,a.jsx)(R.g,{icon:z.Jt$,transform:"shrink-6"}),children:o&&(0,a.jsx)(R.g,{icon:o})})}),(0,a.jsx)(aj.Z,{children:(0,a.jsx)(G.c,{maxH:"min(25em, 45vh)",overflowY:"auto",maxW:"400px",children:Object.entries(aE()).map(e=>{let[l,{label:n}]=e,o=d.filter(e=>e.group===l);return 0===o.length?null:(0,a.jsx)(aB.r,{title:n,children:o.map(e=>{let{key:l,icon:n,name:o,description:i,apply:r}=e;return(0,a.jsxs)(l1.D,{value:l,icon:(0,a.jsx)(R.g,{icon:n,fixedWidth:!0}),onClick:()=>r(t),"data-testid":"text-convert-menu-".concat(l),children:[(0,a.jsx)(Q.E,{children:o()}),i&&(0,a.jsx)(Q.E,{color:"gray.400",fontSize:"sm",children:i()})]},l)})},l)})})})]})};var aV=l(87809),aq=l.n(aV);let aK=()=>({rephrase:{label:j.Ru._({id:"bKWhYP"})},visualize:{label:j.Ru._({id:"6n7jtr"})},reformat:{label:j.Ru._({id:"ILEG4I"})}}),aJ=[{key:"rephrase.better",type:"rephrase",name:()=>j.Ru._({id:"zD3xDw"}),icon:z.DKF,featureFlag:"aiRewrite",description:()=>j.Ru._({id:"YePdJg"}),apply:()=>{tw.LF.emit("queueDesignPartnerTask",{message:j.Ru._({id:"8nKskd"})})}},{key:"rephrase.expand",type:"rephrase",name:()=>j.Ru._({id:"K1q3tl"}),icon:z.t6y,description:()=>j.Ru._({id:"Y2Kk1Q"}),apply:()=>{tw.LF.emit("queueDesignPartnerTask",{message:j.Ru._({id:"HyVgOT"})})},featureFlag:"aiRewrite"},{key:"rephrase.condense",type:"rephrase",name:()=>j.Ru._({id:"rqoYwb"}),icon:z.nr0,description:()=>j.Ru._({id:"+ZW8bU"}),apply:()=>{tw.LF.emit("queueDesignPartnerTask",{message:j.Ru._({id:"70o6lh"})})},featureFlag:"aiRewrite"},{key:"visualize.keypoints",type:"visualize",name:()=>j.Ru._({id:"n+v3I1"}),description:()=>j.Ru._({id:"E9axcX"}),icon:z.bef,node:"smartLayout",apply:()=>{tw.LF.emit("queueDesignPartnerTask",{message:j.Ru._({id:"bXgpVx"})})}},{key:"visualize.images",type:"visualize",name:()=>j.Ru._({id:"laUyeH"}),description:()=>j.Ru._({id:"ADlAam"}),icon:z.yvG,apply:()=>{tw.LF.emit("queueDesignPartnerTask",{message:j.Ru._({id:"p2oHY3"})})}},{key:"visualize.timeline",type:"visualize",name:()=>j.Ru._({id:"Oh+9k8"}),description:()=>j.Ru._({id:"Qx1qQH"}),icon:z.v6v,apply:()=>{tw.LF.emit("queueDesignPartnerTask",{message:j.Ru._({id:"4ReFRy"})})}},{key:"reformat.columns",type:"reformat",name:()=>j.Ru._({id:"KyPPwt"}),description:()=>j.Ru._({id:"52Y/fs"}),icon:z.fq7,node:"gridLayout",apply:()=>{tw.LF.emit("queueDesignPartnerTask",{message:j.Ru._({id:"Y0UR8y"})})}},{key:"reformat.table",type:"reformat",name:()=>j.Ru._({id:"84sVti"}),description:()=>j.Ru._({id:"CxvNve"}),icon:z.w97,node:"table",apply:()=>{tw.LF.emit("queueDesignPartnerTask",{message:j.Ru._({id:"rU0fs4"})})}},{key:"reformat.toggles",type:"reformat",name:()=>j.Ru._({id:"aRUmvo"}),icon:z.Ke8,node:"toggle",description:()=>j.Ru._({id:"914Ln8"}),apply:()=>{tw.LF.emit("queueDesignPartnerTask",{message:j.Ru._({id:"rivjMe"})})}}],a$=()=>Object.entries(aq()(aJ,"type")),aQ=e=>{let{editor:t,testId:l,disabled:n,icon:o,label:r}=e,s=(0,ez.d)(),{isInOfflineMode:d}=(0,e1.u)();return(0,a.jsxs)(W.W,{isLazy:!0,onClose:()=>(0,en.q)(t),children:[(0,a.jsx)(i.Tz,{placement:"top",label:r,children:(0,a.jsx)(U.I,{isDisabled:n,as:B.$,variant:"toolbar","data-testid":l,onMouseDown:M.Fw,color:"trueblue.500",rightIcon:(0,a.jsx)(R.g,{icon:z.Jt$,transform:"shrink-6"}),children:o&&(0,a.jsx)(R.g,{icon:o})})}),(0,a.jsx)(aj.Z,{children:(0,a.jsx)(G.c,{maxH:"min(25em, 45vh)",overflowY:"auto",maxW:"450px",children:a$().map(e=>{let[l,n]=e,{label:o,featureFlag:i}=aK()[l];if(i&&!e2.of.get(i))return;let r=n.map(e=>{if(!(!e.apply||aG(t,e,d)))return(0,a.jsxs)(l1.D,{value:e.key,icon:(0,a.jsx)(R.g,{icon:e.icon,fixedWidth:!0}),onClick:()=>aY(e,t,s),children:[(0,a.jsx)(Q.E,{children:e.name()}),e.description&&(0,a.jsx)(Q.E,{color:"gray.400",fontSize:"sm",children:e.description()})]},e.key)}).filter(Boolean);return r.length?(0,a.jsx)(aB.r,{title:o,children:r},l):null})})})]})},aY=(e,t,l)=>{let{apply:n}=e;if(!n)return;let i=n(t);if(!i)return;let r=l({position:"top",isClosable:!1,duration:null,status:"loading",variant:"subtle",title:(0,a.jsx)(_.x6,{id:"j4ZLea"})});i.then(()=>{l.close(r);let e=l({title:(0,a.jsxs)(o.z,{children:[(0,a.jsxs)(Q.E,{noOfLines:1,children:[(0,a.jsx)(_.x6,{id:"hAmdL3"})," "]}),(0,a.jsx)(eI.N,{textDecoration:"underline",onClick:()=>{(0,ej.tN)(t.state),l.close(e)},children:(0,a.jsx)(_.x6,{id:"9uI/rE"})})]}),status:"success",duration:3e3,position:"top"})}).catch(e=>{l.close(r),l({title:(0,a.jsx)(_.x6,{id:"mTQLsL"}),description:e.message,status:"error",duration:3e3,position:"top"})})};var aX=l(81575);let aZ=e=>{let{label:t,leftIcon:l,rightIcon:n,isSticky:o,onClick:i,isDisabled:r}=e,s=(0,ts.dU)("gray.50","gray.800");return(0,a.jsx)(C.s,{mt:2,bg:s,mx:-2,mb:-2,position:o?"sticky":"static",bottom:o?-2:"auto",children:(0,a.jsx)(B.$,{colorScheme:"gray",variant:"link",size:"sm",mx:"auto",leftIcon:l,rightIcon:n,onClick:i,isDisabled:r,w:"100%",py:3,children:t})})};var a0=l(7203),a1=l(45965),a2=l(30138),a6=l(18733);let a4=(e,t)=>!!t&&(e||!t.startsWith("/")),a5=e=>{let{editor:t}=e,{isInOfflineMode:l}=(0,e1.u)(),n=(0,c.GV)(y.SJ),{bodyFont:i,headingFont:r}=n,s=e=>{t.chain().focus().setFontSize(e).run()},u=(0,et.zi)(t,"heading"),m=(0,et.zi)(t,"title"),f=(0,et.zi)(t,"body"),p=(0,d.useCallback)(()=>{n.workspaceId?(0,a0.vd)({theme:n}):(0,a0.L6)({theme:n})},[n]);if(!f&&!u&&!m)return null;let g=(0,a2.Xw)(t),h="default",b=(0,a6.o)("default");h=t.isActive("title")?(0,a6.bn)(t.getAttributes("title").level)||"default":t.isActive("heading")?(0,a6.bZ)(t.getAttributes("heading").level)||"default":1===g.length&&g[0]||"default",b=(0,a6.o)(h)||b;let v=e=>"".concat(Math.sqrt(e),"em"),k=(0,aP.NO)(t),w=!!t.extensionManager.extensions.find(e=>"slashMenu"===e.name);return(0,a.jsxs)(W.W,{closeOnSelect:!0,isLazy:!0,children:[(0,a.jsx)(U.I,{size:"sm",as:B.$,rightIcon:(0,a.jsx)(R.g,{icon:z.Jt$,transform:"shrink-6"}),variant:"toolbar",pl:2,children:b.label}),(0,a.jsxs)(G.c,{maxH:"min(60em, 45vh)",overflowY:"auto",minW:"260px",children:[f&&(0,a.jsx)(ep.i,{type:"radio",value:h,children:(0,a1.QD)().filter(e=>{let[t]=e;return!(k&&"default"!==t)}).map(e=>{let[t,{label:l,size:n,flagged:r,shortcut:d}]=e,u=a4(w,d);return(0,a.jsx)(eg.k,{value:t,onClick:()=>s(t),children:(0,a.jsxs)(o.z,{children:[(0,a.jsx)(Q.E,{fontFamily:i,fontSize:v(n),children:l}),u&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(td.h,{}),(0,a.jsx)(Q.E,{color:"gray.400",children:d})]})]})},t)})}),u&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(aX.N,{}),(0,a.jsx)(ep.i,{type:"radio",value:h,children:(0,a1.KG)().reverse().map(e=>{let[t,{label:l,size:n,shortcut:i}]=e,d=a4(w,i);return(0,a.jsx)(eg.k,{value:t,onClick:()=>s(t),children:(0,a.jsxs)(o.z,{children:[(0,a.jsx)(Q.E,{fontSize:v(n),fontWeight:"bold",fontFamily:r,children:l}),d&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(td.h,{}),(0,a.jsx)(Q.E,{color:"gray.400",children:i})]})]})},t)})})]}),m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(aX.N,{}),(0,a.jsx)(ep.i,{type:"radio",value:h,children:(0,a1.Y5)().map(e=>{let[t,{label:l,size:n,shortcut:i}]=e,d=a4(w,i);return(0,a.jsx)(eg.k,{value:t,onClick:()=>s(t),children:(0,a.jsxs)(o.z,{children:[(0,a.jsx)(Q.E,{fontSize:v(n),fontWeight:"bold",fontFamily:r,children:l}),d&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(td.h,{}),(0,a.jsx)(Q.E,{color:"gray.400",children:i})]})]})},t)})})]}),(0,a.jsx)(aZ,{label:(0,a.jsx)(_.x6,{id:"gJpKw8"}),leftIcon:(0,a.jsx)(R.g,{icon:z.tiU,fixedWidth:!0}),onClick:p,isDisabled:l})]})]})},a3=e=>{let{editor:t,filterBy:l}=e,{isInOfflineMode:n}=(0,e1.u)(),o="rtl"===(0,F.CY)(t)?"alignRight":"alignLeft",i=()=>{let e=F.gj.find(e=>e.alignment===(0,F.F0)(t));if(e)return e.icon;let l=F.gj.find(e=>e.key===o);return(null==l?void 0:l.icon)||z.ecg};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ef.e,{isAttached:!0,onMouseDown:M.Fw,children:(0,a.jsx)(a5,{editor:t})},"text"),aU.map((e,o)=>(0,a.jsx)(ef.e,{spacing:0,size:"sm",onMouseDown:M.Fw,_empty:{display:"none"},children:e.filter(e=>{let a=!aG(t,e,n);return l?a&&e[l]:a}).map(e=>{let{key:l,name:n,shortcut:o,icon:r,mark:s,node:d,checkActive:u,apply:c}=e,m=c||(s?e=>e.chain().toggleMark(s).focus().run():()=>{}),f=u?u(t):s?t.isActive(s):d?t.isActive(d):void 0;return"textColor"===l?(0,a.jsx)(ei,{shortcut:o,icon:r,editor:t},l):"rewriteText"===l?(0,a.jsx)(aQ,{editor:t,shortcut:o,icon:r,testId:l,label:n()},l):"convertText"===l?(0,a.jsx)(aH,{editor:t,shortcut:o,icon:r,testId:l,label:n()},l):"alignText"===l?(0,a.jsx)(aF,{editor:t,shortcut:o,icon:i(),testId:l,label:n()},l):(0,a.jsx)(E.I,{label:n(),shortcut:o,isActive:f,onClick:()=>m(t),icon:r,testId:l},l)})},o))]})};var a8=function(e){return e.enabledForTables="enabledForTables",e}({});let a7=e=>{let{editor:t,selection:l}=e,n=l.isRowSelection(),i=l.isColSelection(),d=n&&i,u=(0,r.KP)(aI.hj)(l);u&&s.nh.create(t.state.doc,null==u?void 0:u.pos);let c=Math.min(l.$anchorCell.pos,l.$headCell.pos),m=Math.max(l.$anchorCell.pos,l.$headCell.pos),{colMinPercent:f,newColSize:p}=t.schema.nodes[az.X.name].spec,g=l.getTableNode(),h=(0,aC.cG)(g.attrs.colWidths,p,f);return(0,a.jsxs)(o.z,{spacing:1,children:[(0,a.jsx)(a3,{editor:t,filterBy:a8.enabledForTables}),(0,a.jsx)(O.q,{}),n&&!d&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"1ct6G/"}),onClick:()=>{t.commands.addRowBefore(),requestAnimationFrame(()=>{t.commands.focus(c)})},testId:"add-row-before-button",children:(0,a.jsx)(R.g,{icon:z.UiS})}),(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"JUmxSq"}),onClick:()=>{t.commands.addRowAfter(),requestAnimationFrame(()=>{t.chain().focus(m).goToNextCell().run()})},testId:"add-row-after-button",children:(0,a.jsx)(R.g,{icon:z.UiS,rotation:180})}),(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"0cspe/"}),icon:z.yLS,onClick:()=>t.chain().focus().deleteRow().run(),color:"red.500",testId:"delete-row-button"})]}),i&&!d&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"mwcRkO"}),onClick:()=>{let{left:e}=(0,b._t)(t.state.selection);t.commands.addColumnBefore(e),requestAnimationFrame(()=>{t.commands.focus(c)})},isDisabled:!h,testId:"add-col-before-button",children:(0,a.jsx)(R.g,{icon:z.UiS,rotation:270})}),(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"/93cy4"}),onClick:()=>{let{left:e}=(0,b._t)(t.state.selection);t.commands.addColumnAfter(e),requestAnimationFrame(()=>{t.chain().focus(c).goToNextCell().run()})},isDisabled:!h,testId:"add-col-after-button",children:(0,a.jsx)(R.g,{icon:z.UiS,rotation:90})}),(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"GAohqx"}),icon:z.yLS,onClick:()=>{t.commands.deleteColumn(),requestAnimationFrame(()=>{t.commands.focus(c)})},color:"red.500",testId:"delete-col-button"})]}),d&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"SOkhdm"}),icon:z.yC$,onClick:()=>t.commands.equalizeColumns(),testId:"equalize-columns-button"}),(0,a.jsx)(O.q,{}),(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"HSI88F"}),icon:z.yLS,onClick:()=>t.chain().focus().deleteTable().run(),color:"red.500",testId:"delete-table-button"})]})]})},a9=[{component:a7,predicate:e=>e instanceof b.rn&&e.isColSelection(),offsetPx:16},{component:a7,predicate:e=>e instanceof b.rn&&e.isRowSelection(),offsetPx:12},{component:e=>{let{editor:t,selection:l}=e,n=(0,c.GV)(y.SJ),o=l.node,i=(0,t3.Ik)((0,t3.VH)(n));return o?(0,a.jsx)(t8.z,{attributes:o.attrs,updateAttributes:e=>{t.chain().updateAttributes("chart",e).focus().run()},accentColor:i,setEditing:()=>{t.commands.editSelectedChart()},editor:t,inline:!0}):null},predicate:e=>{var t,l;return e instanceof s.nh&&(null===(l=e.node)||void 0===l?void 0:null===(t=l.type)||void 0===t?void 0:t.name)==="chart"},isPopover:!0},{component:e=>{let{editor:t,selection:l}=e,n=t.getAttributes("link").href||"",o=!t.shouldUseLiteMenus;return(0,a.jsxs)(a.Fragment,{children:[o&&n&&(0,a.jsx)(ek,{editor:t,selection:l}),o&&!l.empty&&(0,a.jsx)(ei,{editor:t}),(0,a.jsx)(ew,{href:n,updateHref:e=>t.commands.updateSurroundingLink(e),unlink:()=>{t.commands.removeSurroundingLink()},editor:t,allowEditMetadata:o&&!(0,D.hc)(n)})]})},predicate:(e,t)=>e instanceof s.U3&&t.isActive("link")&&!t.multipageEnabled&&!u.of.get("linksV2")},{component:e=>{let{editor:t,selection:l}=e,n=(0,c.GV)(y.SJ),o=t.getAttributes("link").href||"",i=!t.shouldUseLiteMenus,{isPageLink:r}=lY({href:o}),s=(0,t3.Ik)((0,t3.Jh)(n)),u=(0,d.useCallback)(e=>{t.commands.updateSurroundingLink(e)},[t]),m=(0,em.f)(),f=(0,d.useCallback)(e=>{t.view.focus(),m({isOpen:!0}),e.stopPropagation()},[t,m]);return(0,a.jsxs)(la,{children:[i&&o&&!(0,D.hc)(o)&&(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"/SVg/B"}),icon:z.CQO,children:(0,a.jsx)(ad,{editor:t,selection:l,isDisabled:r})}),(0,a.jsx)(l0,{href:o,updateHref:u,clearHref:()=>{t.commands.updateSurroundingLink("")},removeLink:()=>t.commands.removeSurroundingLink(),editor:t}),i&&(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"0j+RGO"}),icon:z.ecg,children:(0,a.jsx)(ef.e,{dir:"ltr",spacing:0,size:"sm",onMouseDown:M.Fw,children:F.gj.map(e=>{let{name:l,key:n,icon:o,shortcut:i,checkActive:r,apply:s}=e;if(r&&s)return(0,a.jsx)(E.I,{label:l(),shortcut:i,isActive:r(t),onClick:()=>{s(t)},icon:o,testId:n,my:0},n)})})}),i&&(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"jZlrte"}),icon:z.wIs,children:(0,a.jsx)(ei,{editor:t,useMenuButton:!0,isLinkText:!0,defaultTextColor:s})}),i&&!(0,D.hc)(o)&&(0,a.jsx)(lt,{label:(0,a.jsx)(_.x6,{id:"sxkWRg"}),onClick:f,icon:z.BH7})]})},predicate:(e,t)=>e instanceof s.U3&&t.isActive("link")&&u.of.get("linksV2"),isPopover:!0},{component:e=>{let{editor:t,selection:l}=e,n=t.getAttributes("link").href||"",[o,i]=(0,d.useState)("pages"),[r,s]=(0,d.useState)(n),[u,c]=(0,d.useState)(!1),{existingLink:m,isPageLink:f,newTabUrl:p}=lY({href:n});return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)($.B,{direction:"column",minW:"min(80vw, 320px)",maxW:"50vw",maxH:"max(30vh, 400px)",children:[(0,a.jsxs)($.B,{direction:"row",justify:"space-between",mx:-2,px:2,borderBottom:!n||u?"1px solid var(--chakra-colors-blackAlpha-100)":void 0,children:[n&&(0,a.jsx)(ek,{editor:t,selection:l,isDisabled:!!f}),!l.empty&&(0,a.jsx)(ei,{editor:t}),m&&!u&&(0,a.jsx)(af,{existingLink:m,handleRemoveClick:e=>{i(e),"url"===e&&s(n),f&&t.commands.updateSurroundingLink(""),c(!0)}}),m&&!m.cardId&&(0,a.jsx)(E.I,{label:f?(0,a.jsx)(_.x6,{id:"Ky3sBN"}):(0,a.jsx)(_.x6,{id:"Alx2/L"}),icon:z.AaJ,onClick:()=>window.open(p,"_blank")}),(0,a.jsx)(td.h,{}),(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"484LKL"}),icon:z.vev,onClick:()=>t.commands.removeSurroundingLink()})]}),(!m||u)&&(0,a.jsx)(ak,{updateHref:e=>{t.commands.updateSurroundingLink(e),c(!1)},initialTab:o,initialHref:r})]})})},predicate:(e,t)=>e instanceof s.U3&&t.isActive("link")&&!!t.multipageEnabled&&!u.of.get("linksV2")},{component:e=>{let{editor:t}=e,l=t.getAttributes("button").href||"",n=(0,d.useCallback)(()=>t.commands.handleButtonDelete(!1),[t]);return(0,a.jsxs)(o.z,{px:2,children:[ex().map(e=>{let{name:l,icon:n,key:o}=e;return(0,a.jsx)(E.I,{label:l,icon:n,onClick:()=>{t.commands.updateAttributes("button",{variant:o})},isActive:t.isActive("button",{variant:o})},l)}),(0,a.jsx)(O.q,{}),(0,a.jsx)(C.s,{dir:"ltr",children:F.gj.map(e=>{let{name:l,icon:n,checkActive:o,apply:i}=e;if(o&&i)return(0,a.jsx)(E.I,{label:l(),icon:n,onClick:()=>{i(t)},isActive:o(t)},l())})}),(0,a.jsx)(ew,{href:l,updateHref:e=>t.commands.updateAttributes("button",{href:e}),editor:t,allowEditMetadata:!1}),(0,a.jsx)(O.q,{}),(0,a.jsx)(T,{editor:t,handleDelete:n})]})},predicate:(e,t)=>t.isActive("button")&&!t.multipageEnabled&&!t.isSiteNavbarEditor&&!u.of.get("linksV2")},{component:au,predicate:(e,t)=>t.isActive("button")&&!t.isSiteNavbarEditor&&u.of.get("linksV2"),isPopover:!0},{component:aw,predicate:(e,t)=>t.isActive("button")&&!!t.multipageEnabled&&!u.of.get("linksV2")},{component:e=>{let{editor:t,selection:l}=e,{node:n,from:o}=l,i=e=>!!n&&JSON.stringify(e)===JSON.stringify(n.attrs.colWidths),{verticalAlign:r}=t.getAttributes("gridCell"),s=(0,d.useCallback)(e=>{t.chain().updateAttributes("gridCell",{verticalAlign:e===r?null:e}).selectNodeAtPos(l.from).focus().run()},[t,l,r]);return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(ef.e,{spacing:1,size:"sm",alignItems:"center",children:[(0,a.jsxs)(lj.ms,{isLazy:!0,children:[(0,a.jsx)(lj.gf,{as:B.$,variant:"toolbar",rightIcon:(0,a.jsx)(R.g,{icon:z.Jt$}),size:"sm","data-testid":"layout-preset-dropdown",children:(0,a.jsx)(_.x6,{id:"6v+N4U",values:{0:n.childCount}})}),(0,a.jsx)(lj.Q5,{"data-in-editor-focus":!0,fontSize:"md",children:ao().map(e=>{let{testId:l,name:n,image:r,value:s}=e;return(0,a.jsx)(lj.tJ,{"data-testid":l,icon:i(s)?(0,a.jsx)(L.S,{w:"2rem"}):(0,a.jsx)(tv._,{h:"1rem",w:"2rem",objectFit:"cover",src:r.src}),onClick:()=>{o&&t.commands.useLayoutPreset(o,s)},children:n},n)})})]}),(0,a.jsx)(E.I,{onClick:()=>s("start"),isActive:"start"===r,label:j.Ru._({id:"/Q0jUh"}),children:(0,a.jsx)(l3.a_t,{})}),(0,a.jsx)(E.I,{onClick:()=>s("center"),isActive:"center"===r,label:j.Ru._({id:"QhuQN2"}),children:(0,a.jsx)(l3.o9M,{})}),(0,a.jsx)(E.I,{onClick:()=>s("end"),isActive:"end"===r,label:j.Ru._({id:"EPnxoe"}),children:(0,a.jsx)(l3.Awj,{})}),(0,a.jsx)(O.q,{}),(0,a.jsx)(T,{editor:t})]})})},predicate:e=>e instanceof s.nh&&(0,f.X6)(e.node)},{component:e=>{let{editor:t,selection:l,decorations:n}=e,{isInOfflineMode:i}=(0,e1.u)(),{node:r,from:s}=l,{attrs:u,isNested:c,isFirstCard:m}=(0,e4.f)({node:r,decorations:n,editor:t}),{isOpen:f,onOpen:p,onClose:g}=(0,e6.E)({id:"downloadCardAsImageDisclosure"}),h=(0,d.useCallback)(()=>{null==t||t.commands.duplicateCard(s)},[t,s]),b=(0,d.useCallback)(()=>{null==t||t.commands.unnestCard(s)},[t,s]),y=(0,d.useCallback)(()=>{null==t||t.chain().mergeCardsAtPos(s).focus().run()},[t,s]),v=(0,ez.d)(),k=(0,d.useCallback)(()=>{let e=t.state.doc.nodeAt(s),l=e&&(0,eF.getCardTitle)(e.toJSON());t.chain().deleteCard(s).focus().run();let n=j.Ru._({id:"0MWv65",values:{displayTitle:l?'"'.concat(l,'"'):"card"}}),i=j.Ru._({id:"9uI/rE"}),r=v({title:(0,a.jsxs)(o.z,{children:[(0,a.jsx)(Q.E,{noOfLines:1,children:n}),(0,a.jsx)(eI.N,{textDecoration:"underline",onClick:()=>{(0,ej.tN)(t.state),v.close(r)},children:i})]}),status:"info",duration:3e3,position:"top"})},[t,s,v]),w=(0,e2.u)("aiCardDesigner"),x=(0,d.useCallback)(()=>{var e;let t=null===(e=l.node)||void 0===e?void 0:e.attrs.id;if(!t)return;let a=prompt("What do you want to change?","Translate this to Spanish please");a&&eB.emit("openSuggestionEditor",{cardId:t,userMessage:a})},[l]);return(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)(ef.e,{spacing:1,size:"sm",alignItems:"center",children:[(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"BTDPLo"}),testId:"duplicate-card",onClick:h,icon:z.$3n}),c&&(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"b+J8Wt"}),testId:"merge-into-parent-card",onClick:b,icon:z.ndq}),!c&&!m&&(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"kV34zB"}),testId:"merge-into-card-above",onClick:y,icon:z.INu}),w&&(0,a.jsx)(E.I,{onClick:x,icon:z.ESE,label:"Design with AI"}),(0,a.jsx)(tR,{attrs:u}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"xRJ+bN"}),testId:"download-card",onClick:p,icon:z.a_I,isDisabled:i}),(0,a.jsx)(tC,{isOpen:f,onClose:g,cardId:u.id,editor:t})]}),(0,a.jsx)(T,{editor:t,handleDelete:k})]})})},predicate:e=>e instanceof s.nh&&(0,v.jg)(e.node),offsetPx:0},{component:e=>{var t;let{editor:l,selection:n,decorations:o}=e,{node:s,from:d}=n,u=(0,tT.Bn)(o),c=s.attrs,m=(0,tE.jh)(c,null==u?void 0:u.layout),f=(0,tE.JH)(c,null==u?void 0:u.layout),p=(null===(t=c.background)||void 0===t?void 0:t.type)===tO.h.IMAGE,g=(0,r.eL)(l.state.doc.resolve(d),v.jg),h=s.attrs.background.type===tO.h.IMAGE;return(0,a.jsx)(ef.e,{spacing:1,size:"sm",alignItems:"center",children:"accent"===c.itemId&&(0,a.jsxs)(a.Fragment,{children:[f&&(0,a.jsx)(tP,{editor:l,selection:n,decorations:o}),h&&(0,a.jsx)(t4,{editor:l,pos:d,node:s,isDisabled:"fit"===m}),p&&(0,a.jsx)(t5.g,{editor:l,selection:n,decorations:o}),(f||h)&&(0,a.jsx)(O.q,{}),(0,a.jsx)(i.Tz,{label:p?(0,a.jsx)(_.x6,{id:"XQFMOm"}):(0,a.jsx)(_.x6,{id:"P5MuiB"}),placement:"top",children:(0,a.jsx)(t_.K,{onClick:()=>{let e=null==g?void 0:g.node.attrs.id;e&&tM.R.emit("toggleEditBackgroundDrawer",{openDrawer:!0,cardId:e})},variant:"toolbar",size:"sm",icon:(0,a.jsx)(R.g,{icon:z.MT7}),boxSize:7,p:0,"aria-label":p?j.Ru._({id:"Ov693i"}):j.Ru._({id:"B6vyEa"})})}),(0,a.jsx)(O.q,{}),(0,a.jsx)(i.Tz,{label:p?(0,a.jsx)(_.x6,{id:"sGYCGx"}):(0,a.jsx)(_.x6,{id:"6vLq+T"}),placement:"top",children:(0,a.jsx)(t_.K,{onClick:()=>(0,tE.kB)(l,d,p),variant:"toolbar",size:"sm",icon:p?(0,a.jsx)(R.g,{icon:z.K3F}):(0,a.jsx)(R.g,{icon:z.yLS}),color:"red.500",boxSize:7,p:0,"aria-label":p?j.Ru._({id:"sGYCGx"}):j.Ru._({id:"6vLq+T"})})})]})})},predicate:e=>e instanceof s.nh&&(0,m.wL)(e.node),offsetPx:6},{component:e=>{let{editor:t,selection:l}=e,n=l.$from.parent.childCount{t.chain().updateAttributes("gridCell",{verticalAlign:e===o?null:e}).selectNodeAtPos(l.from).focus().run()},[t,o,l]);return(0,a.jsxs)(ef.e,{spacing:1,size:"sm",alignItems:"center",children:[(0,a.jsx)(l9,{editor:t,label:j.Ru._({id:"NFoeBH"}),icon:z.tjk}),n&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(O.q,{}),(0,a.jsx)(E.I,{label:j.Ru._({id:"bZ9ges"}),icon:z.UiS,iconRotation:270,onClick:()=>{t.chain().insertContentAt(l.from,l8.e).run()},testId:"add-col-before-button"}),(0,a.jsx)(E.I,{label:j.Ru._({id:"7ibPpM"}),icon:z.UiS,iconRotation:90,onClick:()=>{t.chain().insertContentAt(l.from+l.node.nodeSize,l8.e).run()},testId:"add-col-after-button"}),(0,a.jsx)(l7,{editor:t,selection:l})]}),(0,a.jsx)(E.I,{onClick:()=>i("start"),isActive:"start"===o,label:j.Ru._({id:"/Q0jUh"}),children:(0,a.jsx)(l3.a_t,{})}),(0,a.jsx)(E.I,{onClick:()=>i("center"),isActive:"center"===o,label:j.Ru._({id:"QhuQN2"}),children:(0,a.jsx)(l3.o9M,{})}),(0,a.jsx)(E.I,{onClick:()=>i("end"),isActive:"end"===o,label:j.Ru._({id:"EPnxoe"}),children:(0,a.jsx)(l3.Awj,{})}),(0,a.jsx)(O.q,{}),(0,a.jsx)(T,{editor:t,handleDelete:()=>{t.chain().selectInsideNodeAtPos(l.from).handleLayoutDelete(!0,!1).run()}})]})},predicate:e=>e instanceof s.nh&&(0,f.NJ)(e.node)},{component:e=>{let{editor:t,selection:l,decorations:n}=e,{node:i}=l,{options:r,variantKey:s}=i.attrs,u=(0,ax.B)(s),c=(0,d.useCallback)(e=>{t.commands.updateNestedAttributesAtPos(l.from,e)},[t,l.from]),m=(0,d.useCallback)(e=>{c({variantKey:e})},[c]);return(0,a.jsxs)(o.z,{spacing:2,children:[(0,a.jsxs)(lj.ms,{isLazy:!0,children:[(0,a.jsx)(lj.gf,{as:B.$,variant:"toolbar",rightIcon:(0,a.jsx)(R.g,{icon:z.Jt$,transform:"shrink-6"}),leftIcon:(0,a.jsx)(R.g,{icon:u.icon,fixedWidth:!0}),size:"sm","data-testid":"smart-layout-variant-dropdown",children:u.name()}),(0,a.jsx)(lj.Q5,{maxH:"min(25em, 45vh)",overflowY:"auto","data-in-editor-focus":!0,fontSize:"md",children:(0,ax.a)().map(e=>{let{key:t,name:l,icon:n,disabled:o,featureFlag:i}=e;if(o||i&&!e2.of.get(i))return null;let r=s===t;return(0,a.jsx)(lj.tJ,{"data-test-variant-option":t,icon:r?(0,a.jsx)(L.S,{}):(0,a.jsx)(R.g,{icon:n,fixedWidth:!0}),onClick:()=>m(t),children:l()},t)})})]}),(0,a.jsx)(O.q,{}),(0,a.jsx)(ef.e,{size:"sm",children:u.options.map(e=>{var o,s;let d=(0,aA.Rv)(n);if(e.checkEnabled&&!e.checkEnabled(i.attrs,d))return null;let u=null!==(s=r[e.key])&&void 0!==s?s:null===(o=e.defaultValue)||void 0===o?void 0:o.call(e,{ctx:"menu"});return(0,a.jsx)(e.Control,{value:u,updateValue:(a,n)=>{c({options:{...r,[e.key]:a}}),n&&i.forEach((n,o)=>{t.commands.updateNestedAttributesAtPos(l.from+o+1,{options:{...n.attrs.options,[e.key]:a}})})},editor:t,option:e},e.key)})}),(0,a.jsx)(O.q,{}),(0,a.jsx)(T,{editor:t})]})},predicate:e=>e instanceof s.nh&&(0,h.M)(e.node)},{component:e=>{let{editor:t,selection:l}=e,{node:n,from:o}=l,i=n.attrs.id,r=l.$from.parent,{startRemoveBg:s,isRemovingBg:u}=(0,lz.D9)({editor:t,id:i}),c=(0,d.useCallback)(()=>{t.chain().insertSmartLayoutCell(l.from).run()},[t,l.from]),m=(0,d.useCallback)(()=>{t.chain().insertSmartLayoutCell(l.from+l.node.nodeSize).run()},[t,l.from,l.node]),{options:f,image:p}=l.node.attrs,g=(0,d.useCallback)(e=>{t.commands.updateNestedAttributesAtPos(l.from,e)},[t,l.from]),b=(0,d.useCallback)(()=>{t.chain().handleSmartLayoutDelete().run()},[t]),y=(0,em.f)(),v=(0,d.useCallback)(e=>{t.view.focus(),y({isOpen:!0}),e.stopPropagation()},[t,y]);if(!r||!(0,h.M)(r))return console.error("SmartLayoutCellFormattingMenu: parent is not a smartLayout"),null;let k=(0,aS.$o)(r.attrs),w=(0,ax.B)(r.attrs.variantKey),x=(0,S.XJ)((null==p?void 0:p.src)||(null==p?void 0:p.tempUrl)),A="imagesText"===w.key&&!x&&(null==p?void 0:p.src),C="imagesText"===w.key||"iconsText"===w.key;return(0,a.jsxs)(ef.e,{spacing:1,size:"sm",alignItems:"center",children:[(0,a.jsx)(l9,{editor:t,label:j.Ru._({id:"NFoeBH"}),icon:w.icon}),(0,a.jsx)(O.q,{}),C&&(0,a.jsxs)(a.Fragment,{children:[A&&(0,a.jsx)(t4,{editor:t,pos:o,node:n}),A&&(0,a.jsx)(t5.j,{onClick:s,disabled:u}),(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"XQFMOm"}),icon:z.MT7,onClick:v}),(0,a.jsx)(O.q,{})]}),(0,a.jsx)(E.I,{label:j.Ru._({id:"w7mkyz"}),iconRotation:"bottom"===k?void 0:270,icon:z.UiS,onClick:c,testId:"add-col-before-button"}),(0,a.jsx)(E.I,{label:j.Ru._({id:"1e37Dl"}),icon:z.UiS,iconRotation:"bottom"===k?180:90,onClick:m,testId:"add-col-after-button"}),(0,a.jsx)(l7,{editor:t,selection:l}),w.cellOptions.length>0?(0,a.jsx)(O.q,{}):null,(0,a.jsx)(ef.e,{size:"sm",children:w.cellOptions.map(e=>{var l,i;if(e.checkEnabled&&!e.checkEnabled(n.attrs))return null;let r=null!==(i=f[e.key])&&void 0!==i?i:null===(l=e.defaultValue)||void 0===l?void 0:l.call(e,{ctx:"menu"});return(0,a.jsx)(e.Control,{value:r,updateValue:t=>{g({options:{...f,[e.key]:t}})},editor:t,option:e,pos:o},e.key)})}),(0,a.jsx)(O.q,{}),(0,a.jsx)(T,{editor:t,handleDelete:b})]})},predicate:e=>e instanceof s.nh&&(0,h.q)(e.node)},{component:e=>{let{selection:t,editor:l}=e,n=0===t.node.childCount,i=t.node.attrs.thumbHeight||ly.Aj,r=(0,d.useCallback)(e=>{l.chain().updateAttributes("gallery",{thumbHeight:e}).setNodeSelection(t.from).focus().run()},[l,t.from]);return(0,a.jsxs)(o.z,{spacing:2,me:2,children:[!n&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Q.E,{fontSize:"sm",fontWeight:"600",children:(0,a.jsx)(_.x6,{id:"Cj2Gtd"})}),(0,a.jsxs)(lb.Ap,{"aria-label":"gallery-slider",min:5,max:15,step:.25,value:i,onChange:r,w:"120px",focusThumbOnChange:!1,colorScheme:"trueblue",size:"sm",children:[(0,a.jsx)(lb.hB,{children:(0,a.jsx)(lb.hJ,{})}),(0,a.jsx)(lb.OQ,{background:"trueblue.500"})]}),(0,a.jsx)(O.q,{}),(0,a.jsx)(ef.e,{dir:"ltr",spacing:0,size:"sm",onMouseDown:M.Fw,_empty:{display:"none"},children:F.gj.map(e=>{let{key:n,name:o,shortcut:i,icon:r,apply:s,checkActive:d}=e;return l&&s&&d?(0,a.jsx)(E.I,{shortcut:i,icon:r,label:o(),onClick:e=>{s(l),l.chain().setNodeSelection(t.from).run()},isActive:d(l),testId:n},n):null})}),(0,a.jsx)(O.q,{})]}),(0,a.jsx)(T,{editor:l})]})},predicate:e=>e instanceof s.nh&&(0,p.Pb)(e.node)&&!u.of.get("galleryV2")},{component:e=>{let{selection:t,editor:l}=e,o=0===t.node.childCount,{layout:r,stretchFill:s}=t.node.attrs,u=(0,d.useCallback)(()=>{l.chain().deleteSelectionAndSelectNear().run()},[l]);return o?null:(0,a.jsx)(n.az,{minW:"300px",children:(0,a.jsxs)(la,{children:[!o&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)($.B,{w:"100%",direction:"row",justify:"space-between",alignItems:"flex-start",children:(0,a.jsx)(i._x,{children:(0,a.jsx)(_.x6,{id:"U+kFad"})})}),(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"rdU729"}),icon:z.yOA,children:(0,a.jsx)(lw,{editor:l,selection:t})}),"grid"===r&&(0,a.jsx)(lh,{editor:l,selection:t}),"flex"===r&&(0,a.jsx)(lS,{editor:l,selection:t}),(0,a.jsx)(lv,{editor:l,selection:t}),"logo"===r&&(0,a.jsx)(lx,{editor:l,selection:t}),"flex"===r&&!(!0===s||null===s)&&(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"0j+RGO"}),icon:z.ecg,children:(0,a.jsx)(ef.e,{dir:"ltr",spacing:0,size:"sm",onMouseDown:M.Fw,_empty:{display:"none"},children:F.gj.map(e=>{let{key:n,name:o,shortcut:i,icon:r,apply:s,checkActive:d}=e;if(!l||!s||!d)return null;let u=d(l);return(0,a.jsx)(E.I,{shortcut:i,icon:r,label:o(),onClick:()=>{s(l),l.chain().setNodeSelection(t.from).run()},isActive:u,testId:n},n)})})})]}),(0,a.jsx)(lt,{label:(0,a.jsx)(_.x6,{id:"cnGeoo"}),icon:z.yLS,colorScheme:"red",onClick:u})]})})},predicate:e=>e instanceof s.nh&&(0,p.Pb)(e.node)&&u.of.get("galleryV2"),isPopover:!0},{component:e=>{let{editor:t,selection:l}=e,n=l.node.attrs;return(0,a.jsxs)(ef.e,{spacing:2,size:"sm",flex:"row",alignItems:"center",children:[(0,a.jsx)(eA,{editor:t,attrs:n,selection:l}),(0,a.jsx)(eC.a,{color:n.color||void 0,setColor:e=>{t.chain().focus().updateAttributes("calloutBox",{color:e}).selectNodeAtPos(l.from).run()},editor:t,analyticsSource:"CalloutBox"}),(0,a.jsx)(O.q,{}),(0,a.jsx)(T,{editor:t})]})},predicate:e=>e instanceof s.nh&&"calloutBox"===e.node.type.name},{component:e=>{let{editor:t,selection:l}=e,n=l.node.type.name,{fullWidthBlock:o}=t.getAttributes(n),i=(0,d.useCallback)(e=>{var l,a;e.stopPropagation(),null===(l=(a=t.commands).editSelectedDrawingBlock)||void 0===l||l.call(a)},[t]);return(0,a.jsxs)(ef.e,{spacing:0,size:"sm",alignItems:"center",dir:"ltr",children:[F.gj.map(e=>{let{name:l,icon:i,checkActive:r,apply:s}=e;if(r&&s)return(0,a.jsx)(E.I,{label:l(),icon:i,onClick:()=>{s(t),o&&t.commands.updateAttributes(n,{fullWidthBlock:!1})},isActive:!o&&r(t)},l())}),(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"ePK91l"}),icon:z.MT7,onClick:i}),(0,a.jsx)(O.q,{}),(0,a.jsx)(T,{editor:t})]})},predicate:e=>e instanceof s.nh&&("drawing"===e.node.type.name||"diagram"===e.node.type.name)},{component:e=>{let{editor:t,selection:l}=e,{fullWidthBlock:n}=l.node.attrs,i=(0,em.f)(),r=(0,d.useCallback)(e=>{t.view.focus(),i({isOpen:!0}),e.stopPropagation()},[t,i]),s=(0,eh.Q)(t),u=(0,p.qK)(l.$from);return(0,a.jsxs)(o.z,{spacing:0,children:[!u&&!s&&(0,a.jsxs)(C.s,{dir:"ltr",children:[F.gj.map(e=>{let{name:o,icon:i,checkActive:r,apply:s}=e;if(r&&s)return(0,a.jsx)(E.I,{label:o(),icon:i,onClick:()=>{s(t),n&&t.commands.updateAttributes(l.node.type.name,{fullWidthBlock:!1})},isActive:!n&&r(t)},o())}),(0,a.jsx)(O.q,{})]}),(0,a.jsxs)(ef.e,{spacing:0,size:"sm",alignItems:"center",children:[(0,a.jsxs)(a.Fragment,{children:[u&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l9,{editor:t,label:j.Ru._({id:"+v0hYZ"}),icon:z.Qyz}),(0,a.jsx)(O.q,{})]}),(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"ePK91l"}),icon:z.MT7,onClick:r,testId:"edit-button"})]}),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(O.q,{}),(0,a.jsx)(T,{editor:t})]})]})]})},predicate:e=>e instanceof s.nh&&"mediaPlaceholder"===e.node.type.name},{component:e=>{let{editor:t,selection:l}=e,{resize:i,fullWidthBlock:r,id:s,src:u,tempUrl:m,href:f,clickBehavior:g}=l.node.attrs,{isInOfflineMode:h}=(0,e1.u)(),{enterZoom:b}=(0,ey.RL)(s),y=(0,em.f)(),v=(0,d.useCallback)(e=>{t.view.focus(),y({isOpen:!0}),e.stopPropagation()},[t,y]),k=(0,S.gk)(g),w=(0,d.useCallback)(e=>{t.commands.updateAttributes(t$._V.name,{clickBehavior:e})},[t]),x=(0,d.useCallback)(e=>{t.commands.updateAttributes(t$._V.name,{href:e})},[t]),{setCropClipType:A,confirmCrop:B,cancelCrop:T,startCrop:O,resetCrop:P}=(0,lC.E)(t),N=(0,c.GV)(t$.$k),D=(0,d.useCallback)(()=>{(0,p.wG)(l)},[l]),L=(0,eh.Q)(t),W=(0,p.qK)(l.$from),U=(0,S.XJ)(u||m),G=!W&&!L,H=!U,V=(0,c.GV)((0,t$.iZ)(s)),{startRemoveBg:q,isRemovingBg:K}=(0,lz.D9)({editor:t,id:s}),J=!!((null==i?void 0:i.clipPath)&&(null==i?void 0:i.clipType)),$=(0,d.useCallback)(()=>{K&&t$.RR.emit("cancelRemoveBg",{id:s}),t.chain().deleteSelectionAndSelectNear().run()},[t,s,K]),Q=(0,d.useMemo)(()=>[{key:"zoom",ariaLabel:j.Ru._({id:"ACjxWW"}),label:(0,a.jsx)(_.x6,{id:"ACjxWW"}),action:b,icon:z.bMI},{key:"addComment",ariaLabel:j.Ru._({id:"oFsfkI"}),label:(0,a.jsx)(_.x6,{id:"oFsfkI"}),action:D,icon:z.DN2,isHidden:L,isDisabled:h},{key:"crop",ariaLabel:j.Ru._({id:"qKx+US"}),label:(0,a.jsx)(_.x6,{id:"qKx+US"}),action:()=>{O({id:s,clipType:null==i?void 0:i.clipType})},icon:z.K1P,isHidden:!G,isDisabled:K},{key:"removeBackground",canRemoveBackground:H,ariaLabel:j.Ru._({id:"YOCRHt"}),label:(0,a.jsxs)(C.s,{alignItems:"center",justifyContent:"center",children:[(0,a.jsx)(_.x6,{id:"ylbfBl"}),(0,a.jsx)(lA.G,{type:"removeBackground",ms:2,color:"gray.400"})]}),customIcon:(0,a.jsxs)(n.az,{as:"span",className:"fa-layers fa-fw",children:[(0,a.jsx)(R.g,{icon:z.sAw,size:"lg"}),(0,a.jsx)(R.g,{icon:I.X46,size:"xs",transform:"shrink-5"})]}),action:q,isHidden:!H,isDisabled:h,isLoading:K},{key:"editGallery",ariaLabel:j.Ru._({id:"ATVjaW"}),label:(0,a.jsx)(_.x6,{id:"+v0hYZ"}),action:()=>{t.chain().selectParentNode().run()},icon:z.Qyz,isHidden:!W},{key:"edit",ariaLabel:j.Ru._({id:"ePK91l"}),label:(0,a.jsx)(_.x6,{id:"ePK91l"}),action:v,icon:z.MT7}],[D,H,G,v,t,b,s,L,W,h,K,null==i?void 0:i.clipType,O,q]);return(0,a.jsxs)(la,{children:[!V&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l2,{buttonList:Q}),(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"0j+RGO"}),icon:z.ecg,isHidden:!G,children:(0,a.jsx)(ef.e,{dir:"ltr",spacing:0,size:"sm",onMouseDown:M.Fw,children:F.gj.map(e=>{let{name:l,key:n,icon:o,shortcut:s,checkActive:d,apply:u}=e;if(d&&u)return(0,a.jsx)(E.I,{label:l(),shortcut:s,isActive:!r&&d(t),onClick:()=>{u(t),r&&t.commands.updateAttributes(t$._V.name,{fullWidthBlock:!1,resize:{...i,width:null}})},isDisabled:K,icon:o,testId:n,my:0},n)})})}),(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"S58tkK"}),icon:l5[k],children:(0,a.jsx)(lB,{currentClickBehavior:k,handleClickBehaviorChange:w,enableNoClickBehavior:!0,canAddLink:!0})}),"newTab"===k&&(0,a.jsx)(l0,{editor:t,href:f||"",updateHref:x,clearHref:()=>{x("")}}),(0,a.jsx)(lt,{label:(0,a.jsx)(_.x6,{id:"cnGeoo"}),icon:z.yLS,onClick:$,colorScheme:"red",secondaryLabel:(0,lI.bT)(l.node)?(0,a.jsx)(_.x6,{id:"5eaf8Z"}):void 0,secondaryAction:(0,lI.bT)(l.node)?()=>(0,lI.LQ)(t):void 0,secondaryIcon:(0,lI.bT)(l.node)?z.ub2:void 0})]}),G&&V&&(0,a.jsxs)(o.z,{alignSelf:"stretch",my:-3,mx:-2,zIndex:"menu",children:[(0,a.jsx)(l4,{clipType:N,onChange:e=>{A({clipType:e})}}),(0,a.jsxs)(ef.e,{spacing:0,size:"sm",alignItems:"center",children:[(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"6Z0nnS"}),icon:z.ub2,isDisabled:!J,onClick:()=>{P({id:s})},my:0}),(0,a.jsx)(E.I,{color:"red.500",label:(0,a.jsx)(_.x6,{id:"7Bn152"}),icon:z.Jyw,onClick:()=>{T({id:s})},my:0}),(0,a.jsx)(E.I,{color:"green.500",label:(0,a.jsx)(_.x6,{id:"ryQtQS"}),icon:z.e68,onClick:()=>{B({id:s})},my:0})]})]})]})},predicate:e=>e instanceof s.nh&&"image"===e.node.type.name,isPopover:!0},{component:e=>{let{editor:t,selection:l}=e,n=(0,em.f)(),o=(0,d.useCallback)(e=>{n({isOpen:!0}),e.stopPropagation()},[n]),i=(0,eh.Q)(t),r=(0,p.qK)(l.$from),s=(0,d.useCallback)(()=>{(0,p.wG)(l)},[l]),{enterZoom:u}=(0,ey.RL)(l.node.attrs.id);return(0,a.jsxs)(ef.e,{spacing:0,size:"sm",alignItems:"center",children:[!r&&(0,a.jsx)(ek,{editor:t,selection:l}),(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"ACjxWW"}),icon:z.bMI,onClick:u}),!i&&(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"oFsfkI"}),icon:z.DN2,onClick:s}),(0,a.jsx)(E.I,{label:(0,a.jsx)(_.x6,{id:"ePK91l"}),icon:z.MT7,onClick:o}),(0,a.jsx)(O.q,{}),(0,a.jsx)(T,{editor:t})]})},predicate:e=>e instanceof s.nh&&(0,S._Y)(e.node)&&!u.of.get("linksV2")},{component:e=>{let{editor:t,selection:l}=e,n=(0,ez.d)(),o=(0,em.f)(),i=(0,d.useCallback)(e=>{t.view.focus(),o({isOpen:!0}),e.stopPropagation()},[t,o]),r=(0,d.useCallback)(()=>{t.chain().deleteSelectionAndSelectNear().run()},[t]),s=(0,d.useCallback)(e=>{"none"!==e&&t.commands.updateAttributes(l.node.type.name,{clickBehavior:e})},[t,l]),u=(0,d.useCallback)(e=>{let o="embed.custom";(0,lM.Yq)(e,e=>{o=e.source||o,(0,ac.vI)({editor:t,selection:l,attrs:e,sourceKey:o})}).catch(e=>{n.isActive(am)||n({id:am,title:(0,a.jsx)(_.x6,{id:"MWOB3g"}),description:(0,a.jsx)(_.x6,{id:"iEFpL0"}),status:"error",position:"top",duration:3e3,isClosable:!0}),console.error("[caught] EmbedVideoFormattingMenu error fetching URL",e)})},[t,n,l]),c=t.getAttributes(l.node.type.name),m="displayStyle"in c&&c.displayStyle||"inline",f=(0,S.Zj)(c),g=(0,p.qK)(l.$from),h="video"===l.node.type.name,b=(0,S.eb)(c,"preview"===m&&!g),y=c.source?(0,eb.B)(c.source):null,v="inline"===m&&(h||(null==y?void 0:y.inlineInteractive))&&!g;return(0,a.jsxs)(la,{children:[!g&&(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"/SVg/B"}),icon:"inline"===m?z.c9S:z.$qH,children:(0,a.jsx)(ad,{editor:t,selection:l})}),(0,a.jsx)(l0,{href:f||"",updateHref:u,editor:t,isEmbedLink:!0}),!v&&(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"S58tkK"}),icon:"newTab"===b?z.Ju_:z.bMI,children:(0,a.jsx)(lB,{currentClickBehavior:b,handleClickBehaviorChange:s})}),(0,a.jsx)(lt,{label:(0,a.jsx)(_.x6,{id:"cnGeoo"}),icon:z.yLS,onClick:r,colorScheme:"red",secondaryAction:i,secondaryIcon:z.BH7,secondaryLabel:(0,a.jsx)(_.x6,{id:"sxkWRg"})})]})},predicate:e=>e instanceof s.nh&&(0,S._Y)(e.node)&&u.of.get("linksV2"),isPopover:!0},{component:e=>{let{editor:t,selection:l}=e,{nested:n}=l.node.attrs;return(0,a.jsxs)(ef.e,{spacing:0,size:"sm",children:[(0,a.jsx)(E.I,{testId:"toc-top-level-cards",label:(0,a.jsx)(_.x6,{id:"RiLgqi"}),icon:z.ITF,onClick:()=>{t.commands.updateAttributes("tableOfContents",{nested:!1})},isActive:!n}),(0,a.jsx)(E.I,{testId:"toc-nested-cards",label:(0,a.jsx)(_.x6,{id:"nTkST4"}),icon:z.QLL,onClick:()=>{t.commands.updateAttributes("tableOfContents",{nested:!0})},isActive:n})]})},predicate:e=>e instanceof s.nh&&"tableOfContents"===e.node.type.name},{component:e=>{let{editor:t}=e,{showTime:l=!0,hiddenContributorIds:n=[]}=t.getAttributes("contributors"),o=(0,c.GV)(y.zB)||[],{toggleShowTime:r,toggleOneVisibleContributor:s,toggleAllVisibleContributors:u}=function(e){return{toggleShowTime:(0,d.useCallback)(()=>{e.commands.toggleShowTime()},[e]),toggleOneVisibleContributor:(0,d.useCallback)(t=>{e.commands.toggleOneContributorVisibility(t)},[e]),toggleAllVisibleContributors:(0,d.useCallback)(()=>{e.commands.toggleAllContributorsVisibility()},[e])}}(t),m=o.length>1,f=(0,d.useCallback)(()=>{t.chain().deleteSelectionAndSelectNear().run()},[t]);return(0,a.jsxs)(la,{children:[(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"0j+RGO"}),icon:z.ecg,children:(0,a.jsx)(lr,{editor:t})}),(0,a.jsx)(le,{label:(0,a.jsx)(_.x6,{id:"4ep6pq"}),icon:z.a$,children:(0,a.jsx)(t7.d,{isChecked:l,onChange:r})}),m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ll,{}),(0,a.jsx)(lc,{contributors:o,hasMultipleContributors:m,hiddenContributorIds:n,toggleOneVisibleContributor:s,toggleAllVisibleContributors:u})]}),(0,a.jsxs)(Q.E,{fontSize:"xs",color:"gray.700",textAlign:"center",children:[(0,a.jsx)(_.x6,{id:"Xqn2KO"})," ",(0,a.jsx)(i.qT,{label:(0,a.jsx)(_.x6,{id:"CYpThg"})})]}),(0,a.jsx)(lt,{label:(0,a.jsx)(_.x6,{id:"cnGeoo"}),icon:z.yLS,colorScheme:"red",onClick:f})]})},predicate:e=>e instanceof s.nh&&"contributors"===e.node.type.name,isPopover:!0},{component:a3,predicate:e=>e instanceof s.U3}],ne=[{component:aw,predicate:(e,t)=>{var l,a;let n=null===(l=document)||void 0===l?void 0:l.activeElement,o=!!(null==n?void 0:n.closest('[data-active-menu="navigation"]')),i=!!(null==n?void 0:n.closest("[data-navbar-editor]"));return(o||i)&&t.isActive("button")&&!!t.isSiteNavbarEditor&&!t.multipageEnabled&&!u.of.get("linksV2")&&!(null===(a=document)||void 0===a?void 0:a.querySelector("[".concat(g.hu,"]")))}},{component:au,predicate:(e,t)=>{var l,a;let n=null===(l=document)||void 0===l?void 0:l.activeElement,o=!!(null==n?void 0:n.closest('[data-active-menu="navigation"]')),i=!!(null==n?void 0:n.closest("[data-navbar-editor]"));return(o||i)&&t.isActive("button")&&!!t.isSiteNavbarEditor&&!t.multipageEnabled&&u.of.get("linksV2")&&!(null===(a=document)||void 0===a?void 0:a.querySelector("[".concat(g.hu,"]")))},isPopover:!0}],nt={backgroundColor:"white",shadow:"lg"},nl=e=>{let{editor:t,scrollingParentSelector:l,menuContext:s,appendToSelector:u}=e;(0,A.lC)(t);let{hideTooltips:m,GammaTooltipHiderContext:f}=(0,i.ku)(),p=(0,c.GV)(y.Du),g=t.state.selection,h=!p&&("navigation"===s?ne:a9).find(e=>e.predicate(g,t)),b=[];try{(0,r.BQ)(t.state.selection)&&(b=(0,v.j5)(t,t.state.selection.from))}catch(e){console.error("[FormattingMenu] unable to find decorations at ".concat(t.state.selection.from),e.message)}let k=(0,d.useMemo)(()=>({maxWidth:"none",zIndex:"var(--chakra-zIndices-popover)",placement:"top",appendTo:u?()=>document.querySelector(u):void 0,popperOptions:{modifiers:[{name:"flip",options:{fallbackPlacements:["top","top-start","top-end","bottom","bottom-start","bottom-end"]}},{name:"preventOverflow",options:{boundary:l?document.querySelector(l):void 0,altAxis:!0}}]}}),[l,u]),w="navigation"===s?"navigation":"editor";return(0,a.jsx)(f,{children:(0,a.jsx)(i.L8,{isDark:!1,children:(0,a.jsxs)(x,{editor:t,onHide:m,tippyOptions:k,children:[h&&h.isPopover&&(0,a.jsx)(lp,{"data-in-editor-focus":!0,"data-active-menu":w,"data-testid":"formatting-menu",color:"var(--chakra-colors-chakra-body-text)",fontFamily:"Inter, sans-serif",children:(0,a.jsx)(h.component,{editor:t,selection:g,decorations:b})}),h&&!h.isPopover&&(0,a.jsx)(n.az,{"data-active-menu":w,borderRadius:"xl",...nt,w:"auto",minW:"0px",h:"fit-content",position:"relative",bottom:h.offsetPx?"".concat(h.offsetPx,"px"):"0","data-in-editor-focus":!0,"data-testid":"formatting-menu",color:"var(--chakra-colors-chakra-body-text)",fontFamily:"Inter, sans-serif",children:(0,a.jsx)(o.z,{spacing:3,px:2,minH:10,children:(0,a.jsx)(h.component,{editor:t,selection:g,decorations:b})})})]})})})}},11138:(e,t,l)=>{"use strict";l.d(t,{q:()=>i});var a=l(31085),n=l(35789),o=l(70323);let i=()=>(0,a.jsx)(n.o,{h:"20px",children:(0,a.jsx)(o.c,{mx:1,borderColor:"gray.300",orientation:"vertical"})})},87145:(e,t,l)=>{"use strict";l.d(t,{g:()=>g,j:()=>p});var a=l(31085),n=l(25420),o=l(80532),i=l(20501),r=l(3040),s=l(24221),d=l(52177),u=l(15355),c=l(31485),m=l(802),f=l(59392);let p=e=>{let{onClick:t=()=>{},...l}=e;return(0,a.jsx)(f.I,{label:(0,a.jsxs)(n.s,{alignItems:"center",justifyContent:"center",children:[(0,a.jsx)(d.x6,{id:"ylbfBl"}),(0,a.jsx)(u.G,{type:"removeBackground",ml:2,color:"gray.400"})]}),onClick:t,...l,children:(0,a.jsxs)(o.az,{as:"span",className:"fa-layers fa-fw",children:[(0,a.jsx)(s.g,{icon:i.sAw,size:"lg"}),(0,a.jsx)(s.g,{icon:r.X46,size:"xs",transform:"shrink-5"})]})})},g=e=>{let{editor:t,decorations:l}=e,n=(0,c.Bn)(l),{startRemoveBg:o,isRemoveBgLoading:i}=(0,m.D9)({editor:t,id:null==n?void 0:n.cardId});return(0,a.jsx)(p,{onClick:o,disabled:i})}},54363:(e,t,l)=>{"use strict";l.d(t,{Ht:()=>a.Ht});var a=l(9303)},48226:(e,t,l)=>{"use strict";l.d(t,{e:()=>o,q:()=>n});var a=l(26813);let n=e=>{setTimeout(()=>{e.commands.focus()})},o=(e,t,l)=>{var n;(null===(n=l.background)||void 0===n?void 0:n.type)===a.h.NONE?e.commands.updateAttributesAtPos(t,l):e.commands.updateNestedAttributesAtPos(t,l)}},92448:(e,t,l)=>{"use strict";l.d(t,{a:()=>h,B:()=>B});var a=l(31085),n=l(80532),o=l(18651),i=l(27670),r=l(24221),s=l(95986),d=l(14041),u=l(91559),c=l(15355),m=l(23832),f=l(10458),p=l(77256),g=l(38234);let h=(0,d.forwardRef)((e,t)=>{let{query:l,editor:h}=e,{isInOfflineMode:b}=(0,u.u)(),y=(0,m.n)(p.E1).filter(e=>{if((0,p.gT)(h,e,void 0,b))return!1;let{name:t,keywords:a=[]}=e;return t().toLowerCase().includes(l.toLowerCase())||a.find(e=>e.startsWith(l.toLowerCase()))}),v=(0,d.useCallback)(e=>{if(!y[e])return;let{execute:t}=y[e],a=h.state.selection;h.chain().deleteRange({from:a.from-l.length-1,to:a.to}).run(),(0,p.Jb)(y[e],f.oU.SLASH_MENU),t(h)},[h,y,l.length]),{selectedIndex:k,selectedItemEl:w}=(0,g.Rj)({ref:t,selectItem:v,options:y});return y.length>0?(0,a.jsx)(n.az,{"data-slash-menu-dropdown":!0,children:(0,a.jsx)(s.qF,{children:(0,a.jsx)(s.QE,{width:"375px",children:y.map((e,t)=>{let{name:l,icon:n,iconStyle:d,image:u,shortcut:m,creditType:f,badge:p}=e;return(0,a.jsxs)(s.nh,{ref:t===k?w:null,icon:u?(0,a.jsx)(o._,{mt:1,h:"1.5em",w:"1.25em",objectFit:"contain",src:u.src}):n?(0,a.jsx)(r.g,{icon:n,rotation:null==d?void 0:d.rotation,size:"1x",fixedWidth:!0,color:"var(--chakra-colors-trueblue-600)"}):(0,a.jsx)(a.Fragment,{}),tabIndex:t===k?0:-1,onClick:()=>v(t),command:m,children:[l(),f&&(0,a.jsx)(c.G,{type:f,colorScheme:"blackAlpha",bg:"whiteAlpha.800"}),p&&(0,a.jsx)(i.E,{ml:2,colorScheme:"green",children:p()})]},t)})})})}):(0,a.jsx)(a.Fragment,{})});var b=l(62313),y=l(61778),v=l(26848),k=l(74727),w=l(9021),x=l(52177),S=l(65998),A=l(3601),C=l(49572),z=l(59707),I=l(89284);let j=["image.custom","table2","columns","insertCardInside","embed.custom"],F=()=>j.map(e=>(0,I.bO)().find(t=>t.key===e)).filter(Boolean),B=e=>{let{editor:t,dir:l}=e,{isInOfflineMode:n}=(0,u.u)(),o=(0,S.u)("aiAutocomplete")&&!(0,C.Q)(t)&&!n,i=(0,m.n)(F),{selection:d}=t.state;return d.empty?(0,a.jsxs)(b.z,{spacing:4,dir:l,color:"gray.400","data-print-hidden":!0,position:"absolute",inset:"0",contentEditable:!1,overflow:"hidden",fontFamily:"Inter, sans-serif",fontSize:"0.8em",onMouseDown:z.Fw,pointerEvents:"none",userSelect:"none","data-guider-highlight":"slash-menu-prompt",className:"slash-menu-prompt",children:[(0,a.jsx)(y.E,{whiteSpace:"nowrap",children:o?(0,a.jsx)(x.x6,{id:"UfUEJ5",values:{AUTOCOMPLETE_INPUT_SHORTCUT:A.H},components:{0:(0,a.jsx)(v.u,{}),1:(0,a.jsx)(v.u,{})}}):(0,a.jsx)(x.x6,{id:"HGRFT/",components:{0:(0,a.jsx)(v.u,{})}})}),(0,a.jsx)(k.e,{isAttached:!0,variant:"ghost",size:"xs",spacing:1,pointerEvents:"auto",colorScheme:"gray",transitionProperty:"opacity",transitionDuration:"normal",_hover:{opacity:1},children:i.map(e=>{let{name:l,shortcut:o,icon:i,execute:d,key:u,creditType:m}=e;return!(0,p.gT)(t,e,!1,n)&&(0,a.jsx)(s.Tz,{placement:"top",shortcut:o,label:(0,a.jsxs)(a.Fragment,{children:[l()," ",m&&(0,a.jsx)(c.G,{type:m})]}),children:(0,a.jsx)(w.K,{"aria-label":l(),onClick:()=>{(0,p.Jb)(e,f.oU.BLOCK_PROMPT),d(t)},icon:(0,a.jsx)(r.g,{icon:i}),color:"inherit"})},u)})})]}):null}},2057:(e,t,l)=>{"use strict";l.d(t,{Q5:()=>v,gf:()=>y,ms:()=>b,tJ:()=>k});var a=l(31085),n=l(33023),o=l(95863),i=l(11403),r=l(80853),s=l(56077),d=l(60524),u=l(7499),c=l(95986),m=l(14041);let[f,p]=(0,s.q)({strict:!1,name:"DropdownContext"}),[g,h]=(0,s.q)({name:"DropdownStylesContext",errorMessage:"useDropdownStyles returned is 'undefined'. Seems you forgot to wrap the components in \"\" "}),b=e=>{let{isOpen:t,onClose:l,onToggle:r}=(0,n.j)(),s=(0,i.o5)("Dropdown",e),d=(0,o.E)({placement:"bottom-start"}),u=(0,m.useMemo)(()=>({isOpen:t,onClose:l,onToggle:r,popper:d}),[t,l,r,d]);return(0,a.jsx)(f,{value:u,children:(0,a.jsx)(g,{value:s,children:(0,a.jsx)(c.qF,{...e})})})},y=e=>{let{children:t,as:l,...n}=e,{popper:o,onToggle:i}=p(),s=l||r.$;return(0,a.jsx)(s,{...n,ref:o.referenceRef,onClick:(0,u.Hj)(e.onClick,i),children:(0,a.jsx)(d.B.span,{__css:{pointerEvents:"none",flex:"1 1 auto",justifyContent:"flex-start",display:"flex",minW:0},children:t})})},v=e=>{var t,l;let{children:n,...o}=e,{isOpen:i,popper:r}=p(),s=h();if(!i)return null;let u=r.getPopperProps({...e,style:{visibility:i?"visible":"hidden",...e.style}});return(0,a.jsx)(d.B.div,{...o,mt:2,minWidth:"var(--chakra-sizes-48)",ref:r.popperRef,...u,__css:{zIndex:null!==(l=e.zIndex)&&void 0!==l?l:null===(t=s.list)||void 0===t?void 0:t.zIndex},children:(0,a.jsx)(c.QE,{children:n})})},k=e=>{let{onToggle:t}=p();return(0,a.jsx)(c.nh,{...e,onClick:(0,u.Hj)(e.onClick,t)})}},57860:(e,t,l)=>{"use strict";l.d(t,{a:()=>h});var a=l(31085),n=l(63341),o=l(18528),i=l(80853),r=l(72821),s=l(20501),d=l(24221),u=l(95986),c=l(52177),m=l(12327),f=l(49624),p=l(59707),g=l(48226);let h=e=>{let{editor:t,color:l,setColor:h,analyticsSource:b}=e;return(0,a.jsxs)(n.W,{isLazy:!0,onClose:()=>(0,g.q)(t),children:[(0,a.jsx)(u.Tz,{placement:"top",label:(0,a.jsx)(c.x6,{id:"XAIjEI"}),"aria-label":m.Ru._({id:"XAIjEI"}),children:(0,a.jsx)(o.I,{as:i.$,variant:"toolbar",rightIcon:(0,a.jsx)(d.g,{icon:s.Jt$,transform:"shrink-6"}),size:"sm",onMouseDown:p.Fw,children:(0,a.jsx)(d.g,{icon:s.fyG})})}),(0,a.jsx)(r.c,{overflow:"hidden",children:(0,a.jsx)(f.b,{currentColor:l||null,setColor:h,source:b})})]})}},59392:(e,t,l)=>{"use strict";l.d(t,{I:()=>d});var a=l(31085),n=l(80853),o=l(24221),i=l(95986);l(14041);var r=l(35015),s=l(59707);let d=e=>{let{label:t,shortcut:l,disabled:i=!1,color:r,isActive:d=!1,onClick:c,icon:m,iconRotation:f,testId:p,children:g,...h}=e,b=(0,a.jsx)(n.$,{isDisabled:i,color:r,variant:d?"activeToolbar":"toolbar",onClick:c,"data-testid":p,onMouseDown:s.Fw,size:"sm",...h,children:m?(0,a.jsx)(o.g,{icon:m,rotation:f,fixedWidth:!0}):g||null});return t?(0,a.jsx)(u,{label:t,shortcut:l,children:b}):b},u=e=>{let{label:t,shortcut:l,children:n}=e;return(0,a.jsx)(i.Tz,{placement:"top",portalProps:{containerRef:(0,r.EC)()},label:t,shortcut:l,children:n})}},9335:(e,t,l)=>{"use strict";l.d(t,{DN:()=>n,LF:()=>i});var a=l(36832),n=function(e){return e.CREATE_COMMENT_FROM_SELECTION="createCommentFromSelection",e.OPEN_POPUP_COMMENT="openPopupComment",e.POPUP_COMMENT_TOGGLED="popupCommentToggled",e.OPEN_THEME_DRAWER="openThemeDrawer",e.OPEN_PAGE_SETUP="openPageSetup",e.OPEN_PRESENT_MODE_CONTEXT_MENU="openPresentModeContextMenu",e}({});class o extends a.b{}let i=new o},3601:(e,t,l)=>{"use strict";l.d(t,{H:()=>a,g:()=>n});let a="+++",n="/continue"},26884:(e,t,l)=>{"use strict";l.d(t,{Ll:()=>n,bi:()=>i,cn:()=>o,vL:()=>s,xu:()=>r});var a=l(99742);let n=e=>t=>{let l=t.getAttribute("bookmark");if(!l)return!1;let a=e.bookmarks[l];return!!a&&a.attrs},o=e=>t=>{let l=t.getAttribute("bookmark");if(!l)return!1;let a=e.bookmarks[l];return!!a&&a.content},i=(e,t)=>e.bookmarks[t],r=()=>({bookmarks:{}}),s=(e,t)=>{let l=d.generateBookmarkId();return e.bookmarks[l]=t,l},d={generateBookmarkId:()=>(0,a.Ak)(5)}},65202:(e,t,l)=>{"use strict";l.d(t,{q:()=>a});let a=new(l(81570)).hs("annotation")},57284:(e,t,l)=>{"use strict";l.d(t,{u:()=>lk});var a=l(31085),n=l(80532),o=l(81313),i=l(95986),r=l(99742),s=l(14041),d=l(91559),u=l(65998),c=l(88957),m=l(82257),f=l(2696),p=l(58599),g=l(61690),h=l(42391),b=l(44507),y=l(62849),v=l(4468);let k=e=>{let{editor:t,decorations:l}=e,a=l.filter(e=>!!e.spec.isMobileAnnotation),[n,o]=(0,s.useState)(null),i=(0,s.useRef)(null);return(0,s.useEffect)(()=>{if(0===a.length){null!==i.current&&(document.removeEventListener("touchstart",i.current),i.current=null,o(null));return}i.current||(o({left:a[0].spec.offsetX,top:a[0].spec.offsetY}),i.current=e=>{e.target.closest(".mobile-add-comment-widget")||t.commands.setMobileAddBlockComment(null)},document.addEventListener("touchstart",i.current))},[t,a]),n};var w=l(32202),x=l(32133),S=l(9335),A=l(32262),C=l(60490),z=l(12327),I=l(13236),j=l(87809),F=l.n(j),B=l(40074),R=l.n(B),_=l(66652),M=l.n(_),E=l(46343),T=l.n(E),O=l(77914),P=l(40201),N=l(19534),D=l(96712),L=l(19463),W=l(87835),U=l.n(W);let G=(e,t)=>{for(let l of e){if(l.id===t)return t;for(let e of l.replies||[])if(e.id===t)return l.id}return null},H=e=>{let{reactions:t,emoji:l,user:a}=e,n=t.find(e=>e.emoji===l);return n&&n.reactions.find(e=>{var t;return e.emoji===l&&(null===(t=e.users)||void 0===t?void 0:t.find(e=>e.id===(null==a?void 0:a.id)))})||null},V=e=>{let{reactions:t,emoji:l,user:a}=e;return!!H({reactions:t,emoji:l,user:a})},q=e=>{let{reactions:t,emoji:l}=e,a=t.find(e=>e.emoji===l);return a&&a.reactions.find(e=>e.emoji===l)||null},K=e=>U()(e.reactions.flatMap(e=>e.users),"id"),J=(0,b.Xb)()?"bottom":"top";function $(e){return e?e.reduce((e,t)=>(t.targetId&&(e[t.targetId]?e[t.targetId].push(t):e[t.targetId]=[t]),e),{}):null}let Q=e=>e.filter(e=>!!e.spec.isAnnotation),Y=e=>(0,c.GV)(t=>{let l=(0,g.Jo)(t),a=$(((null==l?void 0:l.comments)||[]).filter(e=>e.status===O.EB6.Open));if(!a)return[];let n=Q(e);return M()(n,e=>{let{spec:t}=e;return a[t.id]}).filter(Boolean)},T()),X=e=>e.filter(e=>!!e.spec.isDraftComment).map(e=>e.spec.comment),Z=e=>{let{draftComment:t,clearDraftComment:l,editor:a}=e,[n]=(0,O.eRM)(),o=(0,w.d)(),i=a.gammaDocId,{user:r}=(0,C.ur)();return e=>{var s;if(!t)return;let{relativePos:d,targetId:u}=t,c=(0,D.d_)(a.state,d);if(!c)throw Error("Could not save comment, null pos from relativePos");let m=(0,I.eL)(a.state.doc.resolve(c),N.jg),f=a.view.state.doc.nodeAt(c),p=t.targetHtml||(0,P.Lo)(f,["footnote","footnoteLabel","cardNotes"]),g=t.targetHtml||(0,P.V6)(f,["footnote","footnoteLabel","cardNotes"]);a.commands.addAnnotation({id:u,pos:c});let h={targetId:u,docId:i,cardId:null==m?void 0:null===(s=m.node)||void 0===s?void 0:s.attrs.id,content:e,targetHtml:p,targetText:g};n({variables:{input:h},update:(e,t)=>{let{data:l}=t;e.writeFragment({id:"Doc:".concat(i),fragment:L.Mi,fragmentName:"DocCommentsCreate",data:{comments:[null==l?void 0:l.createComment]}})},optimisticResponse:{createComment:{id:"temp-id",commentId:"",__typename:"Comment",...h,content:JSON.parse(JSON.stringify(e)),user:r,archived:!1,reactions:[],replies:[],status:O.EB6.Open,createdTime:new Date().toISOString(),updatedTime:new Date().toISOString()}}}),o({title:z.Ru._({id:"4kSebh"}),status:"success",duration:5e3,isClosable:!1,position:J}),l()}},ee=(e,t)=>{(0,s.useEffect)(()=>{let l=!0,a=a=>{let{selectionPos:n,parentPos:o,text:i}=a;l&&e()===o&&t({targetHtml:i,getPos:()=>n})};return S.LF.on(S.DN.CREATE_COMMENT_FROM_SELECTION,a),()=>{S.LF.on(S.DN.CREATE_COMMENT_FROM_SELECTION,a),l=!1}},[e,t])},et=e=>{let{showComment:t,comments:l,blockAllowsCommenting:a,highlightDuration:n=4e3}=e,[o,i]=(0,s.useState)(null);return(0,s.useEffect)(()=>{let e=!0,o=o=>{let{commentId:r,highlightComment:s=!1}=o;if(!e||!a)return;let d=G(l,r);d&&(t(d),s&&(i(r),setTimeout(()=>{e&&i(null)},n)))};return S.LF.on(S.DN.OPEN_POPUP_COMMENT,o),()=>{S.LF.off(S.DN.OPEN_POPUP_COMMENT,o),e=!1}},[l,a,n,t]),o},el=e=>{let t=(0,x.wA)(),l=(0,c.GV)((0,g.iZ)(e)),a=(0,s.useRef)(null),[n,o]=(0,s.useState)(!1),i=(0,s.useCallback)(e=>{a.current=e,o(!!e)},[]),r=(0,s.useCallback)(()=>{a.current=l,o(!!l)},[l]),d=(0,s.useCallback)(()=>{var l;if(!a.current||!(null===(l=a.current.text)||void 0===l?void 0:l.length)){t((0,g.zq)({id:e}));return}t((0,g.rR)({id:e,reply:a.current}))},[e,t]),u=(0,s.useRef)(d);return(0,s.useEffect)(()=>{u.current=d},[d]),(0,s.useEffect)(()=>(r(),()=>{u.current()}),[]),{hasLocalDraftReply:n,initialDraftReply:a.current,updateLocalDraftReply:i}},ea=e=>(0,c.GV)(t=>{let l=(0,g.Jo)(t),a=$((null==l?void 0:l.reactions)||[]);if(!a)return[];let n=Q(e),o=M()(n,e=>{let{spec:t}=e;return a[t.id]}).filter(Boolean),i=F()(o,"emoji"),r=[];for(let[e,t]of Object.entries(i)){let l=t.reduce((e,t)=>e+t.count,0);r.push({emoji:e,count:l,reactions:t})}return R()(r.filter(e=>e.count>0),"count").reverse()},T());var en=l(62313),eo=l(3040),ei=l(25420),er=l(35687),es=l(27559),ed=l(20501),eu=l(52177),ec=l(63373),em=l(64130),ef=l(59707),ep=l(80853),eg=l(27670),eh=l(24221);let eb=(0,s.memo)(e=>{let{isMobile:t,icon:l,badgeCount:n,tooltip:o,children:r,...s}=e;t&&delete s._hover;let d=(0,a.jsx)(en.z,{className:"block-comment-button-wrapper",children:(0,a.jsxs)(ep.$,{variant:"custom",borderRadius:"full",size:"sm",bgGradient:"none",color:"yellow.600",boxSize:t?10:8,border:t?"":"1px solid white",transitionProperty:"common",transitionDuration:"normal",_hover:t?{}:{bgGradient:"linear(to-b, yellow.300, yellow.400)",color:"yellow.700"},...s,children:[l&&(0,a.jsx)(eh.g,{size:t?"lg":"sm",icon:l}),r&&r,void 0!==n&&(0,a.jsx)(eg.E,{colorScheme:"yellow",borderRadius:"full",pos:"absolute",bottom:-1,right:-1,shadow:"base","data-testid":"badge-count",children:n})]})});return o?(0,a.jsx)(i.Tz,{placement:"left",label:o,children:d}):d});eb.displayName="GenericBlockCommentButton";var ey=l(31201);let ev="350px",ek="temp-id";var ew=l(45930);let ex=e=>{let{comments:t,reactions:l,draftComment:a}=e;if(a&&a.text.trim().length>0)return"draft";if(0===t.length)return 0===l.length?"fresh":"reactions-only";if(1===t.length)return"single-thread";if(t.length>1)return"multiple-threads";throw Error("Invalid button state")},eS=e=>{let{comments:t,reactions:l}=e,a={};return t.forEach(e=>{a[e.id]=[e.user],e.replies.forEach(t=>{a[e.id].push(t.user)})}),Object.entries(a).forEach(e=>{let[t,l]=e;a[t]=U()(l,"id")}),a},eA=e=>{let{reactions:t}=e,l={};return t.forEach(e=>{l[e.emoji]=U()(e.reactions.flatMap(e=>e.users),"id")}),l},eC=e=>{let{comments:t,reactions:l,draftComment:a}=e;return{state:ex({comments:t,reactions:l,draftComment:a}),allCount:t.reduce((e,t)=>{var l;return e+((null===(l=t.replies)||void 0===l?void 0:l.length)||0)},0)+l.reduce((e,t)=>e+t.count,0)+t.length,overflowReactionCount:Math.max(0,l.length-7)}},ez=e=>{let{comments:t,reactions:l}=e,a=l.flatMap(e=>e.reactions.map(e=>e.users)).flat(),n=t.map(e=>e.user).concat(t.map(e=>e.replies.map(e=>e.user)).flat()).filter(Boolean),o=eS({comments:t,reactions:l}),i=U()([...n,...a],"id"),r=[],s=eA({reactions:l});return t.forEach(e=>{r.push(o[e.id])}),{allAvatars:i,reactionAvatars:s,commentAvatars:r}},eI=e=>{let{popup:t,isMobile:l,isHovered:a,comments:n,reactions:o,draftComment:i,enableReactions:r}=e,{state:d}=eC({comments:n,reactions:o,draftComment:i}),u=l||r&&a||!r&&a&&"fresh"!==d||null!==t;return(0,s.useEffect)(()=>{l||(u?document.body.classList.add("is-taking-action"):document.body.classList.remove("is-taking-action"))},[u,l]),{isExpanded:u}},ej=e=>{let{isOpen:t,popupRef:l,onClose:a}=e;(0,ey.j)({ref:l,handler:e=>{var l,n,o,i,r,s,d;(0,b.mG)()&&!(null==e?void 0:null===(l=e.target)||void 0===l?void 0:l.closest(".".concat(ew.V," [data-controls-toggle-button]")))||!t||(null==e?void 0:null===(n=e.target)||void 0===n?void 0:n.closest("[data-controls-toggle-button]"))||(null==e?void 0:null===(o=e.target)||void 0===o?void 0:o.closest('[data-target-name="emoji-list"]'))||(null==e?void 0:null===(i=e.target)||void 0===i?void 0:i.closest('[data-target-name="mention-list"]'))||(null==e?void 0:null===(r=e.target)||void 0===r?void 0:r.closest('[data-target-name="reaction-emoji-picker"]'))||(null==e?void 0:null===(s=e.target)||void 0===s?void 0:s.closest(".chakra-menu__menu-list"))||(null==e?void 0:null===(d=e.target)||void 0===d?void 0:d.closest('[data-target-name="doc-mention-popup"]'))||a()}})},eF=e=>{let{editor:t,getPos:l}=e,a=t.view.nodeDOM(l()),[n,o]=(0,s.useState)(null);return((0,s.useLayoutEffect)(()=>{o((null==a?void 0:a.offsetHeight)||100)},[]),null===n)?null:Math.min(n,128)};var eB=l(61778),eR=l(43342),e_=l(27372);let eM=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30;return e.length?1===e.length?e[0]:2===e.length?e.join(" and "):e.length<=t?"".concat([e.slice(0,e.length-1).join(", "),e[e.length-1]].join(", and ")):"".concat([e.slice(0,t).join(", "),"".concat(e.length-t," ").concat(e.length-t>1?"others":"other")].join(", and ")):null},eE=e=>{let{users:t,selfUserId:l}=e;return eM(t?[...t].sort(e=>(null==e?void 0:e.id)===l?-1:1).map(e=>(null==e?void 0:e.id)===l?"You":(null==e?void 0:e.displayName)||""):[])},eT=(0,e_.P)(n.az),eO=(0,s.memo)(e=>{let{emojis:t,rtlEnabled:l}=e;return(0,a.jsx)(a.Fragment,{children:null==t?void 0:t.map((e,n)=>0===n?(0,a.jsx)(eT,{initial:{x:l?"-6px":"6px",y:"5px"},textShadow:(null==t?void 0:t.length)>1?"0px 1px 3px rgba(0,0,0,.4)":"none",fontSize:"20px",position:"absolute",zIndex:1,children:(0,a.jsx)("em-emoji",{size:0,native:!0,id:e})},n):1===n?(0,a.jsx)(eT,{zIndex:0,initial:{x:l?"-10px":"10px",y:"6px",scale:.7},animate:{scale:.7,rotate:"10deg",x:l?"-18px":"18px",y:"-3px"},position:"absolute",children:(0,a.jsx)("em-emoji",{size:0,native:!0,id:e})},n):2===n?(0,a.jsx)(eT,{zIndex:0,initial:{x:l?"-10px":"10px",y:"6px",scale:.7},animate:{scale:.7,rotate:"-10deg",x:l?"3px":"-3px",y:"16px"},position:"absolute",children:(0,a.jsx)("em-emoji",{size:0,native:!0,id:e})},n):3===n?(0,a.jsx)(eT,{zIndex:0,initial:{x:l?"-10px":"10px",y:"6px",scale:.7},animate:{scale:.7,rotate:"-10deg",x:l?"3px":"-3px",y:"-3px"},position:"absolute",children:(0,a.jsx)("em-emoji",{size:0,native:!0,id:e})},n):null)})});eO.displayName="EmojiCluster";let eP=(0,e_.P)(n.az),eN=(0,s.memo)(e=>{let{emoji:t,emojiCluster:l,isMobile:o,user:r,canReact:d,reaction:u,badgeCount:c,onClick:m,...f}=e,p=(0,em.fW)(),g=K(u),h=!!g.find(e=>e.id===(null==r?void 0:r.id)),b=eE({users:g,selfUserId:(null==r?void 0:r.id)||""}),y=(0,a.jsxs)(n.az,{alignContent:"center",children:[(0,a.jsx)(eu.x6,{id:"mRnNF/",values:{usersLabel:b,emoji:t},components:{0:(0,a.jsx)(eB.E,{as:"span",color:"gray.300"})}}),d&&(0,a.jsx)(eB.E,{display:"block",color:"gray.500",children:h?(0,a.jsx)(eu.x6,{id:"fb/FjL"}):(0,a.jsx)(eu.x6,{id:"AG3H1y"})})]}),v=(0,a.jsx)(en.z,{className:"block-comment-button-wrapper",children:(0,a.jsxs)(ep.$,{variant:"ghost",borderRadius:"full",size:"sm",boxSize:o?10:8,transitionProperty:"common",transitionDuration:"normal",...h?{bg:"gray.100",borderColor:o?"blackAlpha.200":"gray.200"}:{},...f,onClick:e=>{d&&m&&m(e)},pos:"relative",children:[(0,a.jsx)(s.Suspense,{fallback:(0,a.jsx)(eR.y,{size:"sm"}),children:(0,a.jsxs)(eB.E,{pos:"absolute",inset:0,as:"span",sx:{".emoji-mart-emoji":{fontSize:"1em",span:{cursor:"inherit",fontSize:"1em !important"},":hover::before":o?{}:{backgroundColor:"transparent"}}},fontSize:o?"1.5em":"1.25em",children:[!l&&(0,a.jsx)(eP,{initial:{x:p?"-6px":"6px",y:"5px"},fontSize:"20px",position:"absolute",zIndex:1,children:(0,a.jsx)("em-emoji",{size:0,native:!0,id:t})}),(0,a.jsx)(ec.N,{children:(0,a.jsx)(eO,{emojis:l,rtlEnabled:p})})]})}),void 0!==c&&(0,a.jsx)(eg.E,{colorScheme:"yellow",borderRadius:"full",pos:"absolute",bottom:-1,insetEnd:-1,shadow:"base",zIndex:1,children:c})]})});return y?(0,a.jsx)(i.Tz,{placement:"left",label:y,children:v}):v});eN.displayName="ReactionButton";let eD={bg:"yellow.600",color:"yellow.100",_hover:{bg:"yellow.600",color:"yellow.100"}},eL={bg:"yellow.100",color:"yellow.800"},eW="linear(to-b, yellow.200, yellow.300)",eU=e=>{e.stopPropagation()},eG=(0,s.memo)(e=>{let{user:t,userCanComment:l,isExpanded:o,isMobile:i,comments:r,reactions:s,draftComment:d,onClickThread:u,onClickAddComment:c,onClickAddReaction:m,onClickReactionsOverflow:f,onClickExistingReaction:p,onClosePopup:g,hideAddCommentButton:h=!1,viewingCommentId:b,enableReactions:y,blockAllowsCommenting:v,...k}=e,w=(0,em.fW)(),{state:x,allCount:S,overflowReactionCount:A}=eC({comments:r,reactions:s,draftComment:d}),C=[];if(!o)switch(x){case"draft":C.push((0,a.jsx)(eb,{isMobile:i,icon:ed.I$7,onClick:c,bg:o?"gray.100":"white",_hover:eL,color:"gray.600"},"draft"));break;case"fresh":C.push((0,a.jsx)(eb,{isMobile:i,icon:eo.vdI,bg:o?"gray.100":"white",_hover:eL,color:"gray.600",bgGradient:eW,tooltip:(0,a.jsx)(eu.x6,{id:"oFsfkI"}),"data-testid":"create-comment-button",onClick:c},"fresh"));break;case"reactions-only":if(s.length>0){let e=s[0],n=s.reduce((e,t)=>(e.push(t.emoji),e),[]);C.push((0,a.jsx)(eN,{isMobile:i,onClick:t=>{p(e),t.stopPropagation()},reaction:e,user:t,badgeCount:S,emoji:e.emoji,"data-testid":"reaction-".concat(e.emoji),emojiCluster:n,canReact:l&&v},e.emoji))}break;case"single-thread":C.push((0,a.jsx)(eb,{isMobile:i,icon:eo.DN2,bgGradient:eW,badgeCount:S,"data-testid":"single-thread"},"first-thread"));break;case"multiple-threads":C.push((0,a.jsx)(eb,{isMobile:i,bgGradient:eW,icon:eo.q9p,badgeCount:S,"data-testid":"multiple-threads"},"first-thread"))}return(o&&(r.forEach((e,t)=>{let l=null!==b&&e.id===b,n=l?eD:{},o=l?()=>g():()=>u(e);C.push((0,a.jsx)(eb,{isMobile:i,icon:eo.DN2,badgeCount:e.replies.length+1,bgGradient:eW,onClick:o,"data-testid":"thread-".concat(t),...n},0===t?"first-thread":"thread-".concat(t)))}),y&&(s.slice(0,7).forEach(e=>{C.push((0,a.jsx)(eN,{isMobile:i,onClick:t=>{p(e),t.stopPropagation()},"data-testid":"reaction-".concat(e.emoji),reaction:e,user:t,badgeCount:e.count,emoji:e.emoji,canReact:l&&v},e.emoji))}),A>0&&C.push((0,a.jsxs)(eb,{isMobile:i,onClick:()=>{f()},bg:"gray.100",color:"yellow.800",_hover:eL,children:["+",A]},"reactions-overflow"))),"draft"===x?C.push((0,a.jsx)(eb,{isMobile:i,icon:ed.I$7,tooltip:(0,a.jsx)(eu.x6,{id:"x8Zuns"}),onClick:c,bg:o?"gray.100":"white",_hover:eL,"data-testid":"create-comment-button-draft",color:"gray.600"},"draft")):h||i||C.push((0,a.jsx)(eb,{isMobile:i,icon:eo.vdI,transform:w?"scaleX(-1)":"",bgGradient:eW,tooltip:(0,a.jsx)(eu.x6,{id:"oFsfkI"}),onClick:c,bg:o?"gray.100":"white",_hover:eL,"data-testid":"create-comment-button",color:"gray.600"},"fresh")),y&&l&&!h&&!i&&C.push((0,a.jsx)(eb,{isMobile:i,icon:eo.Q3O,transform:w?"scaleX(-1)":"",bgGradient:eW,onClick:()=>{m()},tooltip:(0,a.jsx)(eu.x6,{id:"9OEgyT"}),"data-testid":"add-reaction-button",bg:"gray.100",_hover:eL,color:"gray.600"},"add-reaction"))),i)?(0,a.jsx)(ei.s,{className:"block-comments-inner-stack",userSelect:"none",transitionProperty:"all",transitionDuration:"fast",flexDir:"row",flexWrap:"wrap",onClick:eU,children:C}):(0,a.jsxs)(er.B,{className:"block-comments-inner-stack",userSelect:"none",spacing:0,width:"34px",transitionProperty:"all",transitionDuration:"fast",onClick:eU,borderRadius:"full",boxShadow:"0 0 0 2px rgba(0,0,0,.1)",bg:"white",border:"1px solid transparent",onMouseDown:ef.Fw,"data-testid":"block-comments-buttons",...k,children:[(0,a.jsx)(n.az,{children:C[0]}),(0,a.jsx)(es.S,{in:o,startingHeight:0,transitionEnd:{enter:{overflow:"initial"}},children:(0,a.jsx)(ec.N,{children:C.length>1&&(0,a.jsx)(er.B,{spacing:1,children:C.slice(1)})})})]})});eG.displayName="BlockCommentsButtons";let eH=(0,s.memo)(e=>{let{onClickAddComment:t,onClickAddReaction:l,...o}=e;return(0,a.jsx)(n.az,{className:"mobile-add-comment-widget",pos:"absolute",transform:"translate(-50%,-50%) scale(1)",mt:-6,background:"white",p:"4px",borderRadius:"full",shadow:"lg",transitionProperty:"common",transitionDuration:"normal",transitionTimingFunction:"cubic-bezier(0.34, 1.56, 0.64, 1);",zIndex:9,...o,children:(0,a.jsxs)(en.z,{spacing:1,children:[(0,a.jsx)(eb,{isMobile:!0,icon:eo.vdI,bg:"white",_hover:eL,color:"gray.600",bgGradient:eW,onClick:()=>{t()}},"fresh"),(0,a.jsx)(eb,{isMobile:!0,icon:eo.Q3O,bgGradient:eW,onClick:()=>{l()},bg:"white",_hover:eL,color:"gray.600"},"add-reaction")]})})});eH.displayName="MobileAddCommentWidget";var eV=l(31595),eq=l(48574);let eK=(0,s.memo)(e=>{let{comments:t,reactions:l,isExpanded:n,avatarMax:o=4}=e,{allAvatars:i,reactionAvatars:r,commentAvatars:s}=ez({comments:t,reactions:l});return(0,a.jsxs)(er.B,{className:"avatar-group-popup",spacing:1,transitionProperty:"common",transitionDuration:"fast",onClick:e=>{e.stopPropagation()},p:"1px",ps:3,userSelect:"none",children:[!n&&(0,a.jsx)(eV.Z,{max:o,style:{fontSize:"var(--chakra-fontSizes-sm)"},size:"sm",justifyContent:"start",opacity:[0,0,0,1],transitionProperty:"common",transitionDuration:"normal",position:"relative",children:i.map((e,t)=>(0,a.jsx)(eq.e,{zIndex:i.length-t,me:-3,name:null==e?void 0:e.displayName,src:null==e?void 0:e.profileImageUrl,shadow:"base",ignoreFallback:!0},"unexpanded-".concat(null==e?void 0:e.id)))}),n&&(0,a.jsxs)(a.Fragment,{children:[s.map((e,t)=>(0,a.jsx)(eV.Z,{max:o,style:{fontSize:"var(--chakra-fontSizes-sm)"},size:"sm",justifyContent:"start",opacity:[0,0,0,1],transitionProperty:"common",transitionDuration:"normal",position:"relative",children:e.map((e,t)=>(0,a.jsx)(eq.e,{zIndex:i.length-t,me:-3,name:null==e?void 0:e.displayName,src:null==e?void 0:e.profileImageUrl,shadow:"base",ignoreFallback:!0},"comment-".concat(null==e?void 0:e.id)))},"comment-".concat(t))),l.slice(0,7).map((e,t)=>(0,a.jsx)(eV.Z,{max:o,style:{fontSize:"var(--chakra-fontSizes-sm)"},size:"sm",justifyContent:"start",opacity:[0,0,0,1],transitionProperty:"common",transitionDuration:"normal",position:"relative",children:r[e.emoji].map((e,t)=>(0,a.jsx)(eq.e,{zIndex:i.length-t,me:-3,name:null==e?void 0:e.displayName,src:null==e?void 0:e.profileImageUrl,shadow:"base",ignoreFallback:!0},"reaction-".concat(null==e?void 0:e.id)))},"reaction-".concat(t)))]})]})});eK.displayName="AvatarGroupPopup";let eJ=e=>{let{isMobile:t,emoji:l}=e,n=z.Ru._({id:"r2ONxg"});return(0,a.jsx)(s.Suspense,{fallback:(0,a.jsx)(eR.y,{size:"sm"}),children:(0,a.jsxs)(eB.E,{as:"span",sx:{".emoji-mart-emoji":{fontSize:"1em",span:{cursor:"inherit",fontSize:"1em !important"}}},children:[(0,a.jsx)("em-emoji",{size:0,native:!0,id:l})," ",n,"."]})})};var e$=l(2600),eQ=l(2219),eY=l(3706),eX=l(95370),eZ=l(90088),e0=l(73893),e1=l(8178),e2=l(79430);let e6=null,e4=null,e5=e=>{var t,l,a,n;let{event:o,errorCallback:i,redirectTo:r,doneCallback:s}=e,{data:d}=o;if("loginComplete"===d.type&&(0,e1.v)({data:null==d?void 0:null===(t=d.payload)||void 0===t?void 0:t.data,redirectTo:r,doneCallback:s,shouldClientSideRedirect:!0,googleMethod:"POPUP"}),"signupComplete"===d.type&&(0,e1.W)({data:null==d?void 0:null===(l=d.payload)||void 0===l?void 0:l.data,redirectTo:r,doneCallback:s,shouldClientSideRedirect:!0,googleMethod:"POPUP"}),"loginFailure"===d.type){let e=null==o?void 0:null===(n=o.data)||void 0===n?void 0:null===(a=n.payload)||void 0===a?void 0:a.code;if(!i){console.error("No error callback defined");return}if(!e){console.error("No code defined");return}i(e)}};var e3=function(e){return e.ACCEPT_DOC_INVITATION="accept-doc-invitation",e.ACCEPT_WORKSPACE_INVITATION="accept-workspace-invitation",e.DOC_ACCESS_LINK="doc-access-link",e.JOIN_WITH_CODE="join-with-code",e.DEFAULT_LOGIN="login",e.SIGNUP="signup",e}({});let e8=(e,t)=>{switch(e){case"join-with-code":{let{workspaceId:e,inviteCode:l,referredByUserId:a}=t,n=new URL("".concat(e0.$.API_HOST||"https://gamma.app","/organizations/").concat(e,"/join/").concat(l));return a&&n.searchParams.set("referredByUserId",a),n.toString()}case"accept-doc-invitation":{let{docId:e,email:l,inviteCode:a}=t;return"".concat(e0.$.API_HOST,"/invitations/docs/").concat(e,"/?inviteCode=").concat(a,"&email=").concat(l)}case"accept-workspace-invitation":{let{workspaceId:e,email:l,inviteCode:a}=t;return"".concat(e0.$.API_HOST,"/invitations/workspaces/").concat(e,"?inviteCode=").concat(a,"&email=").concat(l)}case"doc-access-link":{let{docId:e,shareToken:l}=t;return"".concat(e0.$.API_HOST,"/access-links/docs/").concat(e,"/?token=").concat(l)}case"signup":{let{inviteCode:e,referredByUserId:l,partnerStackClickId:a,partnerStackPartnerId:n}=t,o=new URL("".concat(e0.$.API_HOST||"https://gamma.app","/signup"));return e&&o.searchParams.set("inviteCode",e),l&&o.searchParams.set("referredByUserId",l),a&&o.searchParams.set("partnerStackClickId",a),n&&o.searchParams.set("partnerStackPartnerId",n),o.toString()}default:return"".concat(e0.$.API_HOST,"/login")}},e7=e=>{let{type:t,params:l,errorCallback:a,redirectTo:n,doneCallback:o}=e,i=e8(t,l),r="toolbar=no, menubar=no, width=600, height=700, top=100, left=100";null===e6||e6.closed?e6=window.open(i,t,r):e4!==i?null!==(e6=window.open(i,t,r))&&e6.focus():e6.focus(),(0,e2.EM)().addEventListener("message",e=>{e5({event:e,errorCallback:a,redirectTo:n,doneCallback:o})}),e4=i};var e9=l(39286);let te={invalid_signup_code:{title:(0,a.jsx)(eu.x6,{id:"F6yt1L",values:{GAMMA_PROPER_NOUN:e9.On}}),description:(0,a.jsx)(eu.x6,{id:"hVNvhu"})},invalid_reset_code:{title:(0,a.jsx)(eu.x6,{id:"SvShcH"}),description:(0,a.jsx)(eu.x6,{id:"Vm3y4h"})},invalid_user:{title:(0,a.jsx)(eu.x6,{id:"a2AYF6"}),description:(0,a.jsx)(eu.x6,{id:"x9CdxW",values:{GAMMA_PROPER_NOUN:e9.On}})},other_workspace_member:{title:(0,a.jsx)(eu.x6,{id:"J5F9Vo"}),description:(0,a.jsx)(eu.x6,{id:"CTBeTd",values:{GAMMA_PROPER_NOUN:e9.On}})}};var tt=l(55278);let tl=e=>{var t,l,n;let{accessLink:o,doc:i,refetchFn:r,...s}=e,d=(0,w.d)(),{refetch:u}=(0,C.ur)(),c=r||u,m=e=>{let{title:t,description:l}=te[e]||{title:(0,a.jsx)(eu.x6,{id:"U7nnQt"}),description:e};d.isActive(e)||d({title:t,description:l,position:"top",id:e,status:"error",isClosable:!0,duration:null})},f=null!==(l=null==o?void 0:o.permission)&&void 0!==l?l:"view",p={manage:(0,a.jsx)(eu.x6,{id:"C11Xkl",values:{GAMMA_ARTIFACT_PROPER_NOUN:e9.TP}}),edit:(0,a.jsx)(eu.x6,{id:"C11Xkl",values:{GAMMA_ARTIFACT_PROPER_NOUN:e9.TP}}),comment:(0,a.jsx)(eu.x6,{id:"gu6c+c",values:{GAMMA_ARTIFACT_PROPER_NOUN:e9.TP}}),view:(0,a.jsx)(eu.x6,{id:"LoR9yH",values:{GAMMA_ARTIFACT_PROPER_NOUN:e9.TP}})}[f],g={manage:(0,a.jsx)(eu.x6,{id:"MEeXaP"}),edit:(0,a.jsx)(eu.x6,{id:"MEeXaP"}),comment:(0,a.jsx)(eu.x6,{id:"dx3Kfr"}),view:(0,a.jsx)(eu.x6,{id:"R2ZEYO"})}[f],h={manage:{icon:eo.zLW,colorScheme:"cyan"},edit:{icon:eo.zLW,colorScheme:"cyan"},comment:{icon:eo.DN2,colorScheme:"yellow"},view:{icon:eo.ao0,colorScheme:"green"}},b=null!==(n=null==i?void 0:null===(t=i.editors)||void 0===t?void 0:t.map(e=>e.user.displayName))&&void 0!==n?n:[],y=(()=>{switch(f){case"manage":case"edit":switch(b.length){case 0:return(0,a.jsx)(eu.x6,{id:"bspMVx",values:{GAMMA_ARTIFACT_PROPER_NOUN:e9.TP},components:{0:(0,a.jsx)("span",{role:"img","aria-label":z.Ru._({id:"JGFG6q"})}),1:(0,a.jsx)("strong",{})}});case 1:return(0,a.jsx)(eu.x6,{id:"w49thS",values:{GAMMA_ARTIFACT_PROPER_NOUN:e9.TP,0:b[0]},components:{0:(0,a.jsx)("span",{role:"img","aria-label":z.Ru._({id:"JGFG6q"})}),1:(0,a.jsx)("strong",{})}});case 2:return(0,a.jsx)(eu.x6,{id:"Tz4Wi7",values:{0:b[0],1:b[1]},components:{0:(0,a.jsx)("span",{role:"img","aria-label":z.Ru._({id:"7Lrnj6"})}),1:(0,a.jsx)("strong",{}),2:(0,a.jsx)("strong",{})}});default:return(0,a.jsx)(eu.x6,{id:"VhIJ/j",values:{0:b[0],1:b.length-1},components:{0:(0,a.jsx)("span",{role:"img","aria-label":z.Ru._({id:"7Lrnj6"})}),1:(0,a.jsx)("strong",{})}})}case"comment":return(0,a.jsx)(eu.x6,{id:"vIOI7i",components:{0:(0,a.jsx)("span",{role:"img","aria-label":z.Ru._({id:"OoNfwA"})}),1:(0,a.jsx)("strong",{}),2:(0,a.jsx)("strong",{})}});default:return(0,a.jsx)(eu.x6,{id:"k/HcwJ",values:{GAMMA_ARTIFACT_PROPER_NOUN:e9.TP},components:{0:(0,a.jsx)("strong",{})}})}})(),v=async()=>{c&&(await c(),(0,tt.Us)()),d.isActive("login-complete")||d({title:(0,a.jsx)(eu.x6,{id:"yFvQAN"}),description:p,position:"top",id:"login-complete",status:"success",isClosable:!0,duration:5e3})};return(0,a.jsxs)(e$.T,{align:"stretch",...s,children:[(0,a.jsxs)(en.z,{spacing:4,mr:6,children:[(0,a.jsx)(ta,{icon:(0,a.jsx)(eh.g,{icon:h[f].icon}),colorScheme:h[f].colorScheme}),(0,a.jsx)(eQ.D,{size:"sm",children:g})]}),(0,a.jsx)(eB.E,{fontSize:"sm",children:y}),(0,a.jsxs)(er.B,{children:[(0,a.jsx)(ep.$,{variant:"solid",leftIcon:(0,a.jsx)(eh.g,{icon:eX.FjH}),size:"md",onClick:()=>{e7({type:e3.DOC_ACCESS_LINK,params:{docId:null==i?void 0:i.id,shareToken:o.token},errorCallback:m,doneCallback:v})},children:(0,a.jsx)(eu.x6,{id:"oZyG4C"})}),(0,a.jsx)(ep.$,{variant:"plain",as:eY.N,target:"_blank",leftIcon:(0,a.jsx)(eh.g,{icon:ed.y_8}),href:"/signup",children:(0,a.jsx)(eu.x6,{id:"yrlCvg"})}),(0,a.jsx)(eB.E,{fontSize:"xs",color:"gray.600",children:(0,a.jsx)(eu.x6,{id:"oXChp6",values:{GAMMA_PROPER_NOUN:e9.On},components:{0:(0,a.jsx)(eY.N,{href:eZ.er,isExternal:!0,fontWeight:"bold"}),1:(0,a.jsx)(eY.N,{href:eZ.WO,isExternal:!0,fontWeight:"bold"})}})})]})]})},ta=e=>{let{icon:t,colorScheme:l}=e;return(0,a.jsxs)(n.jl,{size:10,bg:"linear-gradient(to bottom, var(--chakra-colors-".concat(l,"-200), var(--chakra-colors-").concat(l,"-300))"),position:"relative",children:[(0,a.jsx)(n.az,{color:"".concat(l,".600"),display:"block",mt:"0.5",textAlign:"center",children:t}),(0,a.jsx)(n.jl,{size:5,position:"absolute",bottom:-1,right:-1,color:"".concat(l,".800"),bg:"".concat(l,".100"),boxShadow:"base",fontSize:"xs",children:(0,a.jsx)(eh.g,{icon:eo.QLR})})]})};var tn=l(70323);let to=e=>{let{accessLink:t,doc:l,className:n,showDivider:o=!0}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(tl,{accessLink:t,doc:l,p:6,spacing:4,className:n}),o&&(0,a.jsx)(tn.c,{})]})};var ti=l(56824),tr=l(18201),ts=l(12567),td=l(95580),tu=l(35864),tc=l(10263),tm=l(47687),tf=l(44386),tp=l(46291),tg=l(77854),th=l(79893),tb=l(35923),ty=l(7263),tv=l(87643);let tk=l(67291).A.extend({parseHTML:()=>[{tag:"p"}],renderHTML(e){let{HTMLAttributes:t}=e;return["p",(0,I.KV)(t,{dir:"auto"}),0]}}),tw=()=>[tc.A.configure({horizontalRule:!1,codeBlock:!1,paragraph:!1}),tk,ty.c,tu.Ay.configure({openOnClick:!1}),tf.N,tg.c,tb.M9,tb.lw,tb.BF,tp.Hf,tm.a,tp.mk,th.Q8,tv.bU],tx=(0,ts.v_)("mod+Enter"),tS=(0,ts.v_)("mod+a"),tA=s.memo(e=>{let{clearContentOnSave:t=!1,editable:l=!0,saveButtonText:o=(0,a.jsx)(eu.x6,{id:"tfDRzk"}),saveButtonIcon:r=(0,a.jsx)(eh.g,{icon:ed.isI}),initialContent:d="",placeholder:u="Reply",showBorder:c=!0,onCancelEditingClick:m,onCommentSave:f,onCreate:h=()=>{},onUpdate:b=()=>{},shouldFocus:v=!0,alwaysShowButtons:k=!1,...w}=e,S=(0,s.useMemo)(()=>tw(),[]),A=(0,x.d4)(g.sX),C=(0,x.d4)(g.aQ),z=(0,p.hG)({extensions:S,content:d,onCreate:e=>{let{editor:t}=e;h({editor:t}),t.gammaDocId=A,t.gammaOrgId=C},onUpdate:e=>{let{editor:t,transaction:l}=e;b({editor:t,transaction:l})}});(0,s.useEffect)(()=>{z&&z.setOptions({editable:l})},[z,l]),(0,y.Vg)(()=>{z&&v&&z.isEditable&&z.commands.focus("end")},[z,v],[z]),(0,s.useEffect)(()=>{z&&!l&&(null==z||z.commands.setContent(d))},[z,d,l]);let{colorMode:I}=(0,ti.G6)(),j="light"===I,F=e=>{tS(e)&&(e.preventDefault(),null==z||z.commands.selectAll()),tx(e)&&(e.preventDefault(),e.stopPropagation(),B())},B=()=>{!(!f||!z||(0,td.mf)(z.state.doc)||(0,td.nC)(z.state.doc))&&(f(z.getJSON()),t&&z.commands.clearContent(!0))};return l?(0,a.jsxs)(ei.s,{"data-gamma-child-tiptap-editor":"comment-editor",direction:"column",...w,children:[(0,a.jsx)(n.az,{tabIndex:0,w:"100%",onKeyDownCapture:F,onKeyPressCapture:F,className:"comment-editor",color:j?"gray.800":"gray.200",bg:j?"white":"gray.800",...c?{border:"1px solid",borderColor:j?"gray.200":"gray.700",borderRadius:"md"}:{},sx:{"p:first-of-type::before":(null==z?void 0:z.isEmpty)?{content:'"'.concat(u,'"'),float:"left",color:j?"gray.400":"gray.500",pointerEvents:"none",height:"0"}:""},fontSize:"sm",children:(0,a.jsx)(p.$Z,{editor:z,className:"comment-editor",style:{wordBreak:"break-word",width:"100%"}})}),(0,a.jsxs)(es.S,{in:!!(k||z&&!z.isEmpty),children:[(0,a.jsx)(n.az,{h:3,children:(0,a.jsx)(a.Fragment,{})}),(0,a.jsxs)(en.z,{children:[(0,a.jsx)(tr.h,{}),!!m&&(0,a.jsx)(i.Tz,{label:(0,a.jsx)(eu.x6,{id:"zeQdHz"}),placement:"top",children:(0,a.jsx)(ep.$,{size:"sm",variant:"hazardous",onClick:()=>{m&&m(),null==z||z.commands.clearContent(!0)},children:(0,a.jsx)(eu.x6,{id:"dEgA5A"})})}),(0,a.jsx)(ep.$,{size:"sm",variant:"solid",leftIcon:r,isDisabled:(null==z?void 0:z.isEmpty)||(0,td.nC)(null==z?void 0:z.state.doc),onClick:B,"data-testid":"post-comment",children:o})]})]})]}):(0,a.jsx)(n.az,{fontSize:"sm",children:(0,a.jsx)(p.$Z,{editor:z})})});var tC=l(9021),tz=l(89897),tI=l.n(tz),tj=l(35015);let tF=e=>{let{targetHtml:t,onTargetClick:l,isSourceContentAvailable:o,instanceType:r}=e,[d,u]=(0,s.useState)(!1),[c,m]=(0,s.useState)(!1),f=(0,s.useRef)(null),p=(0,tj.EC)(),g=d?ed.AeV:ed.DqM,h=d?z.Ru._({id:"vLyv1R"}):z.Ru._({id:"fMPkxb"});return(0,s.useEffect)(()=>{var e;f.current&&m(!(!d&&f.current.scrollHeight<=(null===(e=f.current)||void 0===e?void 0:e.clientHeight)))},[d]),(0,a.jsxs)(ei.s,{className:"block-target-html",pl:3,mb:2,borderLeftWidth:"4px",borderLeftStyle:"solid",borderLeftColor:"yellow.200",direction:"row",alignItems:"flex-end",cursor:o&&"feed"===r?"pointer":"auto",onClick:l,children:[(0,a.jsx)(i.Tz,{label:(0,a.jsx)(eu.x6,{id:"/oHV5h"}),isDisabled:!("feed"===r&&!o),portalProps:{containerRef:p},children:(0,a.jsx)(n.az,{flex:1,ml:-3,pl:3,w:"100%",fontSize:"sm",noOfLines:d?void 0:3,dangerouslySetInnerHTML:{__html:t?tI().sanitize(t):""},ref:f,_hover:{bgColor:"feed"===r?o?"yellow.100":"gray.100":void 0}})}),c&&(0,a.jsx)(i.Tz,{label:h,portalProps:{containerRef:p},children:(0,a.jsx)(tC.K,{variant:"ghost",size:"xs","aria-label":h,icon:(0,a.jsx)(eh.g,{icon:g}),onClick:()=>{u(e=>!e)},"data-target-name":"comment-target-expand-button",isRound:!0})})]})},tB=e=>{let{draftComment:t,showUser:l=!0,showBorder:n=!0,user:o,onCommentDraftUpdate:i,onCommentSave:r,commentIdToHighlight:s,alwaysShowButtons:d=!1,...u}=e;return(0,a.jsxs)(ei.s,{direction:"column",...u,children:[l&&(0,a.jsxs)(en.z,{mb:3,pt:3,children:[(0,a.jsx)(eq.e,{src:null==o?void 0:o.profileImageUrl,size:"sm"}),(0,a.jsx)(er.B,{children:(0,a.jsx)(eB.E,{fontWeight:"bold",fontSize:"sm",children:(0,a.jsx)(eu.x6,{id:"866PMb",values:{0:null==o?void 0:o.displayName}})})})]}),t&&(null==t?void 0:t.targetHtml)&&(0,a.jsx)(tF,{targetHtml:t.targetHtml}),(0,a.jsx)(tA,{onUpdate:i,initialContent:(null==t?void 0:t.json)||null,clearContentOnSave:!0,editable:!0,saveButtonText:(0,a.jsx)(eu.x6,{id:"26iNma"}),placeholder:z.Ru._({id:"UkDQUD"}),onCommentSave:r,showBorder:n,shouldFocus:!!(!(0,b.mG)()&&!s),alwaysShowButtons:d})]})};var tR=l(87825);let t_="block-comments-container",tM=e=>{let{offsetFromTop:t,children:l}=e,n=(0,em.fW)();return(0,a.jsx)(ei.s,{contentEditable:!1,suppressContentEditableWarning:!0,color:"gray.900",className:t_,direction:"column",bg:"white",borderRadius:"xl",shadow:"xl",overflowY:"auto",transitionProperty:"common",transitionDuration:"normal",zIndex:"sticky",bottom:{top:"0px","2xl":"auto"},top:{top:"0px","2xl":"auto"},insetEnd:{base:"44px","2xl":0},width:{base:ev,"2xl":ev},maxW:{base:"90vw",md:"80vw","2xl":ev},transform:{base:"translate(0, ".concat(t,"px)"),"2xl":"translate(calc(".concat(n?"-100% - 10px":"100% + 10px","), 0)")},wordBreak:"break-word",height:"fit-content",maxHeight:"calc(".concat(tR.b," - 8em)"),position:"absolute",children:l})},tE=e=>{let{onCancel:t,editor:l,commentIdToHighlight:n,userCanComment:o,blockAllowsCommenting:i,getPos:r,draftComment:s,onCommentDraftUpdate:d,onCommentSave:u,isMobile:m}=e,{user:f}=(0,C.ur)(),p=(0,c.GV)(g.Jo),h=(0,tt.h6)(p,f),b=eF({editor:l,getPos:r}),y=h&&!f&&i;if(null===b)return null;let v=(0,a.jsxs)(ei.s,{overflowY:"auto",direction:"column",className:"comments-list",p:m||y?0:4,children:[y&&p&&(0,a.jsx)(to,{accessLink:h,doc:p,className:"comments-sign-up",showDivider:!1}),o&&(0,a.jsx)(tB,{draftComment:s,user:f,showUser:m,showBorder:m,onCommentDraftUpdate:d,onCommentSave:u,commentIdToHighlight:n,alwaysShowButtons:m})]});return m?v:(0,a.jsx)(tM,{offsetFromTop:b,children:v})};var tT=l(52609);let tO=e=>{let{isMobile:t,editor:l,onReactionClick:n,getPos:o}=e,i=eF({editor:l,getPos:o});if(null===i)return null;let r=(0,a.jsx)(ei.s,{bg:"white",p:"0",zIndex:"tooltip","data-testid":"add-reaction-popup","data-target-name":"reaction-emoji-picker",boxShadow:"none",sx:{".emoji-mart":{border:"none"}},overflow:"hidden",justify:"center",children:(0,a.jsx)(tT.pP,{perLine:9,handlePick:n,shouldFocusSearch:!t})});return t?r:(0,a.jsx)(tM,{offsetFromTop:i,children:r})};var tP=l(14608),tN=l(59742),tD=l(9746),tL=l(18658),tW=l(65446);let tU=(0,s.forwardRef)(function(e,t){let{isMobile:l,children:o,closePopup:i,drawerMinHeight:r}=e;if(l){let e=r||"calc(calc(100vh - calc(100vh - 100%)) - 1rem)";return(0,a.jsxs)(tP._,{placement:"bottom",isOpen:!0,onClose:i,children:[(0,a.jsx)(tN.m,{}),(0,a.jsxs)(tD.z,{minH:e,maxH:e,borderTopRadius:"xl",className:"comments-wrapper","data-block-comments-popup":!0,children:[(0,a.jsx)(tL.c,{p:6,pb:2,className:t_,children:o}),(0,a.jsx)(tW.s,{})]})]})}return(0,a.jsx)(n.az,{ref:t,children:o})}),tG=e=>{let{onCancel:t,reactions:l,onClickExistingReaction:n,editor:o,getPos:i,user:r,userCanComment:d,blockAllowsCommenting:u,isMobile:c}=e,m=eF({editor:o,getPos:i}),f=l.slice(c?0:7),p=f.map(e=>(0,a.jsx)(eN,{isMobile:!0,onClick:t=>{n(e),t.stopPropagation()},mr:2,mb:4,reaction:e,user:r,canReact:d&&u,badgeCount:e.count,emoji:e.emoji},e.emoji));if((0,s.useEffect)(()=>{0===f.length&&t()},[t,f]),null===m)return null;let g=(0,a.jsxs)(er.B,{spacing:4,children:[(0,a.jsx)(eQ.D,{size:"md",children:(0,a.jsx)(eu.x6,{id:"7ZMg79"})}),(0,a.jsx)(ei.s,{flexWrap:"wrap",children:p})]});return c?g:(0,a.jsx)(tM,{offsetFromTop:m,children:(0,a.jsx)(ei.s,{p:4,px:2,pb:0,flexWrap:"wrap",children:p})})};var tH=l(65084),tV=l(82354),tq=l(77646),tK=l(4013),tJ=l(92405),t$=l(14e3),tQ=l(65202),tY=l(28478);let tX=e=>{let{docId:t,cardId:l,commentId:a,parentCommentId:n,targetType:o}=e,[i]=(0,O.nkJ)(),[r]=(0,O.eaJ)();function s(e,i,r,s){let d={targetId:o===O.yKx.Comment?a:l,docId:t,emoji:i,cardId:l};if("addReaction"===e&&(d={...d,targetType:o}),o===O.yKx.Comment)return{variables:{reactionInput:d},update:(l,o)=>{let{data:i}=o;l.writeFragment({id:"Doc:".concat(t),fragment:O.U$g,fragmentName:"DocCommentsUpdate",data:{comments:[n?{id:n,replies:[{id:a,reactions:[i[e]],__typename:"Comment"}],reactions:[],__typename:"Comment"}:{id:a,replies:[],reactions:[i[e]],__typename:"Comment"}]}})},optimisticResponse:{[e]:{commentId:a,count:r,emoji:i,users:s,cardId:l,__typename:"Reaction"}}};console.error("[useReactionUpdate] Invalid targetType: ".concat(o))}return{addReactionFn:(e,t,l)=>{i(s("addReaction",e,t,l))},removeReactionFn:(e,t,l)=>{r(s("removeReaction",e,t,l))}}};var tZ=l(40173),t0=l(2250),t1=l(33023),t2=l(83858);let t6=(e,t)=>e===t||null!=e.parentElement&&t6(e.parentElement,t),t4=e=>{let{setPopperElement:t,onPopoverClose:l,handleReactionClick:o,popperElement:i,openerElement:r,usePortal:s,isMobile:d,placement:u,...c}=e;(0,ey.j)({ref:{current:i},handler(e){r&&t6(e.target,r)||l()}});let m=(0,a.jsx)(n.az,{mx:d?0:3,mt:d?0:"-110px",shadow:"lg",bg:"white",p:"0",w:"auto",minW:"0px",zIndex:"tooltip","data-target-name":"reaction-emoji-picker",ref:t,...c,children:(0,a.jsx)(tT.pP,{perLine:d?9:12,handlePick:e=>{o(e.id),l()},shouldFocusSearch:!(0,b.Xb)()})});return s?(0,a.jsx)(tZ.Z,{children:m}):m},t5=e=>{let{size:t,colorScheme:l,handleReactionClick:o,placement:r,usePortal:d=!0}=e,[u]=(0,t0.U)(["(max-width: 840px)","(min-width: 841px)"]),{isOpen:c,onToggle:m,onClose:f}=(0,t1.j)(),[p,g]=(0,s.useState)(!1),[h,b]=(0,s.useState)(null),[y,v]=(0,s.useState)(null),{styles:k,attributes:w,forceUpdate:x}=(0,t2.E)(h,y,{placement:u?"auto":"".concat(r,"-start"),strategy:"fixed"});return(0,s.useEffect)(()=>{x&&setTimeout(()=>{x()},0)},[x]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.Tz,{placement:t8,label:(0,a.jsx)(eu.x6,{id:"9OEgyT"}),isOpen:p,children:(0,a.jsx)(n.az,{display:"flex",onMouseEnter:()=>{g(!0)},onMouseLeave:()=>g(!1),children:(0,a.jsx)(tC.K,{colorScheme:l,float:"inline-start","aria-label":z.Ru._({id:"9OEgyT"}),variant:"ghost",onClick:e=>{m(),e.stopPropagation()},size:t||"sm",ref:b,isRound:!0,icon:(0,a.jsx)(eh.g,{icon:ed.Q3O})})})}),c&&(0,a.jsx)(t4,{usePortal:d,setPopperElement:v,onPopoverClose:f,handleReactionClick:o,popperElement:y,isPopoverOpen:c,openerElement:h,style:k.popper,isMobile:u,placement:r,...w.popper})]})},t3=e=>{let{colorScheme:t,size:l,emoji:o,label:r,count:d,hasSelfReacted:u,handleReactionClick:c,readOnly:m}=e,{colorMode:f}=(0,ti.G6)(),p="light"===f,g=(0,s.useCallback)(e=>{m||c(o,e)},[o,c,m]);return(0,a.jsx)(i.Tz,{placement:t8,label:(0,a.jsxs)(n.az,{alignContent:"center",children:[r,!m&&(0,a.jsx)(eB.E,{display:"block",color:p?"gray.500":"gray.700",children:u?(0,a.jsx)(eu.x6,{id:"fb/FjL"}):(0,a.jsx)(eu.x6,{id:"AG3H1y"})})]}),children:(0,a.jsxs)(ep.$,{cursor:m?"default":"cursor","data-testid":"reaction-button-".concat(o),size:l||"sm",color:p?"gray.500":"gray.300",bg:u?p?"gray.100":"gray.700":"none",borderWidth:"1px",borderStyle:"solid",colorScheme:t,borderColor:u?p?"gray.200":"gray.500":"transparent",_hover:{bg:p?"gray.200":"gray.600"},variant:"ghost",borderRadius:"full",px:2,onClick:g,children:[(0,a.jsx)(tT.mY,{emojiId:o,fontSize:"sm"===l?"lg":"sm"}),(0,a.jsx)(eB.E,{as:"span",fontSize:l,ms:1.5,children:d})]})})},t8="bottom",t7=e=>{let{size:t,colorScheme:l,placement:n="right",usePortal:o,reactions:r,docId:s,cardId:d,commentId:u,parentCommentId:c,targetType:m,readOnly:f,innerPaddingY:p,...g}=e,{addReactionFn:h,removeReactionFn:b}=tX({docId:s,commentId:u,parentCommentId:c,cardId:d,targetType:m}),{user:y}=(0,C.ur)(),v=(null==r?void 0:r.reduce((e,t)=>(t.count&&(e[t.emoji]=t),e),{}))||{},k=!f&&m===O.yKx.Card&&!v.heart,w=Object.keys(v).length>0,x=(e,t)=>{var l,a,n,o,i,r;if(!(m===O.yKx.Comment&&u||m===O.yKx.Card&&d))throw Error("[Reactions.handleReactionClick] Invalid targetType. Args: targetType: ".concat(m,", commentId: ").concat(u,", cardId: ").concat(d));if(null===(a=v[e])||void 0===a?void 0:null===(l=a.users.find(e=>e.id===(null==y?void 0:y.id)))||void 0===l?void 0:l.id){let t=(null==v?void 0:null===(n=v[e])||void 0===n?void 0:n.count)-1,l=(null==v?void 0:null===(o=v[e])||void 0===o?void 0:o.users)?v[e].users.filter(e=>e.id!==(null==y?void 0:y.id)):[];b(e,t,l)}else{let t=(null==v?void 0:null===(i=v[e])||void 0===i?void 0:i.count)?v[e].count+1:1,l=(null==v?void 0:null===(r=v[e])||void 0===r?void 0:r.users)?v[e].users.concat(y):[y];h(e,t,l)}null==t||t.stopPropagation()};return(0,a.jsxs)(ei.s,{direction:"row",cursor:"default",contentEditable:!1,onMouseDown:ef.Fw,mb:p?"-".concat(p/1.5,"rem"):void 0,...g,children:[k&&(0,a.jsx)(i.Tz,{label:(0,a.jsx)(eu.x6,{id:"W9FRBT"}),placement:t8,children:(0,a.jsx)(tC.K,{colorScheme:l,float:"inline-start","aria-label":"",variant:"ghost",onClick:e=>{x("heart",e)},size:t,isRound:!0,mr:2,icon:(0,a.jsx)(eh.g,{icon:ed.qcK})})}),!f&&(0,a.jsx)(t5,{size:t,colorScheme:l,handleReactionClick:x,usePortal:o,placement:n}),w&&(0,a.jsx)(tY.B,{spacing:"sm"===t?2:1,mr:2,className:"reactions-row",children:w&&Object.entries(v).map(e=>{let[n,o]=e,i=null==o?void 0:o.users,r=!!(null==i?void 0:i.find(e=>(null==e?void 0:e.id)===(null==y?void 0:y.id))),s=eE({users:i,selfUserId:null==y?void 0:y.id});return(0,a.jsx)(t3,{colorScheme:l,size:t,emoji:n,readOnly:f,label:(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(eu.x6,{id:"mRnNF/",values:{usersLabel:s,emoji:n},components:{0:(0,a.jsx)(eB.E,{as:"span",color:"gray.300"})}})}),count:null==i?void 0:i.length,hasSelfReacted:r,handleReactionClick:x},n)})})]})},t9=s.memo(e=>{let{docId:t,reactions:l,cardId:n,commentId:o,size:i,parentCommentId:r,placement:s="right",usePortal:d=!0,userCanComment:u,...c}=e;return(0,a.jsx)(t7,{size:i,cardId:n,usePortal:d,placement:s,reactions:l,parentCommentId:r,docId:t,commentId:o,targetType:O.yKx.Comment,readOnly:!u,...c})});var le=l(78872),lt=l(63341),ll=l(18528),la=l(72821),ln=l(33683),lo=l(81575),li=l(56005),lr=l.n(li),ls=l(13166);let ld=()=>({[O.EB6.Open]:{label:z.Ru._({id:"9ggh96"}),icon:ed.SGM,successMessage:z.Ru._({id:"1INZuT"})},[O.EB6.Closed]:{label:z.Ru._({id:"pL38RI"}),icon:ed.RVf,successMessage:z.Ru._({id:"gieGvY"})}}),lu=e=>{let{status:t,handleCommentStatusUpdate:l}=e;return(0,a.jsx)(i.Tz,{label:ld()[t].label,"aria-label":ld()[t].label,children:(0,a.jsx)(tC.K,{variant:"ghost",size:"sm",borderRadius:"full",isDisabled:!1,"aria-label":ld()[t].label,icon:(0,a.jsx)(eh.g,{icon:ld()[t].icon}),onClick:()=>l(t)})})},lc=e=>{let{comment:t,selfUser:l,isInPanel:o,isSourceContentAvailable:r,showCopyCommentLink:s,showLinkToTargetContent:d,hasCommentBeenUpdated:u,onTargetClick:c,commentUrl:m,isReply:f,userCanComment:p,handleCommentStatusUpdate:g,toastPosition:h,isEditing:b,handleEditCommentClick:y,handleDeleteCommentClick:v}=e,{user:k,createdTime:x,updatedTime:S,status:A=O.EB6.Open}=t,{email:C,displayName:I,profileImageUrl:j}=k,F=(null==l?void 0:l.id)===(null==k?void 0:k.id),{onCopy:B}=(0,le.i)(m),R=(0,ti.dU)("red.500","red.300"),_=(0,w.d)();return(0,a.jsxs)(en.z,{spacing:2,align:"top",mb:3,_before:o?{content:"''",position:"absolute",w:"9px",h:"9px",mt:"15px",left:f?"12px":"36px",bg:"gray.100",borderRadius:"full"}:{},children:[(0,a.jsx)(i.Tz,{label:C,"aria-label":C,children:(0,a.jsx)(eq.e,{mt:1,size:"sm",name:I,src:j,ignoreFallback:!0})}),(0,a.jsxs)(er.B,{align:"center",alignItems:"flex-start",spacing:0,mb:1,children:[(0,a.jsxs)(eB.E,{fontWeight:"600",mb:0,fontSize:"sm",children:[I," ",F?(0,a.jsx)(eu.x6,{id:"dDUgzP"}):null]}),(0,a.jsx)(ei.s,{direction:"row",w:"100%",alignItems:"flex-start",children:(0,a.jsx)(n.az,{flex:"1",children:(0,a.jsx)(i.Tz,{isDisabled:!u,label:"Updated ".concat((0,ls.OG)(S)),placement:"top",children:(0,a.jsxs)(en.z,{children:[(0,a.jsx)(eB.E,{my:"0 !important",className:"comment-date",fontSize:"xs",color:"gray.500",children:lr()((0,ls.OG)(x))}),u&&(0,a.jsx)(n.az,{color:"gray.500",children:(0,a.jsx)(eh.g,{size:"xs",icon:ed.ml2})})]})})})})]}),(0,a.jsx)(tr.h,{}),(0,a.jsxs)(en.z,{spacing:1,children:[d&&(0,a.jsx)(i.Tz,{label:r?(0,a.jsx)(eu.x6,{id:"LmLruJ"}):(0,a.jsx)(eu.x6,{id:"/oHV5h"}),shouldWrapChildren:!0,children:(0,a.jsx)(tC.K,{size:"sm",borderRadius:"full",variant:"ghost",isDisabled:!r,"aria-label":r?z.Ru._({id:"LmLruJ"}):z.Ru._({id:"/oHV5h"}),onClick:c,icon:(0,a.jsx)(eh.g,{icon:ed.vh1})})}),!f&&p&&(0,a.jsx)(lu,{status:A,handleCommentStatusUpdate:()=>g(t.status)}),(0,a.jsxs)(lt.W,{isLazy:!0,children:[(0,a.jsx)(ll.I,{as:tC.K,size:"sm",variant:"ghost",borderRadius:"full","data-testid":"comment-header-menu",icon:(0,a.jsx)(eh.g,{fixedWidth:!0,icon:ed.vHW}),children:(0,a.jsx)(eu.x6,{id:"7L01XJ"})}),(0,a.jsx)(tZ.Z,{children:(0,a.jsxs)(la.c,{zIndex:"popover","data-testid":"comment-header-menulist",children:[s&&(0,a.jsx)(ln.D,{icon:(0,a.jsx)(eh.g,{icon:ed.CQO}),onClick:()=>{B(),_({title:z.Ru._({id:"h5GS+N"}),status:"success",duration:3e3,position:h})},children:(0,a.jsx)(eu.x6,{id:"qhJCCi"})}),p&&!b&&F&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(lo.N,{}),(0,a.jsx)(ln.D,{icon:(0,a.jsx)(eh.g,{icon:ed.MT7}),onClick:y,children:(0,a.jsx)(eu.x6,{id:"ePK91l"})}),(0,a.jsx)(ln.D,{icon:(0,a.jsx)(eh.g,{icon:ed.yLS}),color:R,onClick:()=>{v()},"data-testid":"delete-thread",children:f?(0,a.jsx)(eu.x6,{id:"FjzXBu"}):(0,a.jsx)(eu.x6,{id:"xOviNB"})})]})]})})]})]})]})},lm=(0,s.memo)(e=>{let{comment:t,editor:l,selfUser:o,docId:i,commentIdToHighlight:r,userCanComment:d,instanceType:u,editorMode:c,isRootComment:m=!1,onClose:f,closePopup:p,...h}=e,y="feed"===u,v="drawer"===u,k=(0,b.Xb)()?"bottom":"top",{content:C,targetHtml:I,targetId:j,createdTime:F,updatedTime:B,id:R,replies:_,reactions:M}=t,E=(0,x.wA)(),{initialDraftReply:T,updateLocalDraftReply:P,hasLocalDraftReply:N}=el(R),D=(0,s.useRef)(new tK.c),W=r===R,U=(0,tJ.yO)({docId:i,id:R}),G=(0,s.useRef)(null),[H,V]=(0,s.useState)(!1),[q,K]=(0,s.useState)(m);(0,s.useEffect)(()=>{N&&!q&&K(!0)},[N,q]);let[J]=(0,O.eRM)(),[$]=(0,O.DNM)(),[Q]=(0,O.roT)(),[Y]=(0,O.Ekg)(),X=(0,w.d)(),Z=(0,tH.O2)("editor"),ee=(0,s.useCallback)(()=>{V(!0)},[]),et=(0,s.useCallback)(()=>{P(null)},[P]),ea=[.25,.1,.25,1];(0,s.useLayoutEffect)(()=>{W&&G.current&&Z.scrollElementIntoView({element:G.current})},[Z,W]);let eo=e=>{let t=e===O.EB6.Open?O.EB6.Closed:O.EB6.Open,l={id:R,docId:i,status:t};Q({variables:{input:l},update:(e,t)=>{let{data:l}=t,a={id:"Doc:".concat(i),fragment:L.Mi,fragmentName:"DocCommentsUpdate",data:{comments:[null==l?void 0:l.updateCommentStatus]}};e.writeFragment(a)},optimisticResponse:{updateCommentStatus:{...l,__typename:"Comment",updatedTime:new Date().toISOString()}}}).then(()=>{X({title:(0,a.jsxs)(eB.E,{children:[ld()[e].successMessage,"."," ",(0,a.jsx)(eY.N,{textDecoration:"underline",onClick:()=>eo(t),children:z.Ru._({id:"9uI/rE"})})]}),status:"success",duration:5e3,isClosable:!1,position:k})}).catch(e=>{console.error("[CommentComponent]: Error changing comment status",e),X({title:z.Ru._({id:"+Q5eww",values:{0:e.message}}),status:"error",isClosable:!0,position:k})}).finally(()=>{"popup"===u&&p&&p(!0)})},ec=(0,ti.dU)("yellow.100","yellow.800"),em=tQ.q.getState(l.state),ef=(0,s.useMemo)(()=>null==em?void 0:em.annotations.find(e=>e.id===j),[null==em?void 0:em.annotations,j]),{pos:ep}=ef||{},eg=!!(null==ef?void 0:ef.pos),eb="notification"!==u&&t.id!==ek,ey=("notification"===u||"feed"===u)&&1!==ep,ev=(0,s.useCallback)(e=>{var t;if(!(!j||!ef||!ep||(null==e?void 0:null===(t=e.target)||void 0===t?void 0:t.closest('[data-target-name="comment-target-expand-button"]')))){if("notification"===u)S.LF.emit(S.DN.OPEN_POPUP_COMMENT,{commentId:R,highlightComment:!0});else if("feed"===u){let e=tV.M2,t=(0,td.jB)(l,ep);if(c===t$.w.DOC_VIEW)(0,A.Ib)({pos:ep,editor:l});else if(c===t$.w.SLIDE_VIEW){let[t]=(0,td.TK)(l.state.doc.resolve(ep),tq.jg);l.commands.spotlightCardById(t.node.attrs.id),E((0,g.mF)({attached:!1})),e=tV.y0}(0,b.Xb)()&&f&&setTimeout(f,300),Z.scrollElementIntoView({element:t,delay:e})}}},[l,Z,j,u,R,ef,ep,c,E,f]),ew=(0,s.useMemo)(()=>new Date(B).getTime()-new Date(F).getTime()>100,[B,F]),ex=!!t.commentId,eS=!!_&&_.length>0;return(0,a.jsxs)(ei.s,{flexDir:"column",ref:G,id:"comment-".concat(R),className:"comment highlight-mask","data-target-id":"comment-".concat(R),borderRadius:W?"md":"0px",position:"relative",borderBottomWidth:m?"1px":"0px",borderBottomColor:"gray.200",_after:y&&eS?{content:"''",position:"absolute",w:"9px",h:"9px",left:"36px",bottom:9,bg:"gray.100",borderRadius:"full",transitionProperty:"common",transitionDuration:"normal"}:{},_before:eS&&y?{content:"''",position:"absolute",w:"3px",top:7,bottom:9,left:"39px",bg:"gray.100",borderRadius:"full"}:{},...h,overflowY:"hidden",children:[(0,a.jsxs)(er.B,{backgroundColor:W?ec:"auto",transitionProperty:"border, background",transitionDuration:"normal",transitionTimingFunction:"ease",role:"group",spacing:8,children:[(0,a.jsxs)(n.az,{pl:ex&&y?10:0,children:[(0,a.jsx)(lc,{isInPanel:y,comment:t,selfUser:o,isSourceContentAvailable:eg,showCopyCommentLink:eb,showLinkToTargetContent:ey,hasCommentBeenUpdated:ew,onTargetClick:ev,commentUrl:U,isReply:ex,userCanComment:d,handleCommentStatusUpdate:eo,toastPosition:k,isEditing:H,handleEditCommentClick:ee,handleDeleteCommentClick:()=>{let e=!!t.commentId;Y({variables:{id:R},update:(l,a)=>{let{data:n}=a;l.writeFragment({id:"Doc:".concat(i),fragment:L.Mi,fragmentName:e?"DocRepliesRemove":"DocCommentsRemove",data:{comments:[e?{id:t.commentId,replies:[null==n?void 0:n.archiveComment],__typename:"Comment"}:null==n?void 0:n.archiveComment]}})},optimisticResponse:{archiveComment:{id:R,__typename:"Comment",archived:!0}}}),!e&&t.targetId&&l.commands.deleteAnnotation(t.targetId),"popup"===u&&p&&p(!0),X({title:z.Ru._({id:"Ho/Jvc"}),status:"success",duration:5e3,isClosable:!1,position:k})}}),(0,a.jsxs)(n.az,{pl:eS&&y?10:0,overflowY:"hidden",children:[I&&I.length&&(0,a.jsx)(tF,{targetHtml:I,onTargetClick:ev,isSourceContentAvailable:eg,instanceType:u}),(0,a.jsx)(tA,{initialContent:C,editable:H,onCancelEditingClick:()=>V(!1),saveButtonText:(0,a.jsx)(eu.x6,{id:"yY7Bil"}),saveButtonIcon:(0,a.jsx)(eh.g,{icon:ed.e68}),onCommentSave:e=>{let l=!!t.commentId,a={id:R,docId:i,content:e};$({variables:{input:a},update:(e,a)=>{let{data:n}=a,o={id:"Doc:".concat(i),fragment:L.Mi,fragmentName:l?"DocRepliesUpdate":"DocCommentsUpdate",data:{comments:[l?{id:t.commentId,replies:[null==n?void 0:n.updateComment],__typename:"Comment"}:null==n?void 0:n.updateComment]}};e.writeFragment(o)},optimisticResponse:{updateComment:{...a,__typename:"Comment",updatedTime:new Date().toISOString()}}}),X({title:z.Ru._({id:"kibWwZ"}),status:"success",duration:5e3,isClosable:!1,position:k}),V(!1)}}),!H&&(0,a.jsx)(t9,{mt:2,docId:i,cardId:t.cardId,commentId:t.id,parentCommentId:t.commentId,reactions:M,size:"sm",placement:"right",usePortal:!0,userCanComment:d})]})]}),_&&_.length>0&&_.map(e=>(0,a.jsx)(lm,{instanceType:u,userCanComment:d,commentIdToHighlight:r,comment:e,docId:i,selfUser:o,editor:l,editorMode:c,pl:0,p:0,pb:0},null==e?void 0:e.id))]}),d&&(0,a.jsxs)(es.S,{in:q&&!H,unmountOnExit:!0,transition:{enter:{when:"afterChildren",height:{duration:.3,ease:ea},opacity:{duration:.4,ease:ea}},exit:{when:"beforeChildren",height:{duration:.2,ease:ea},opacity:{duration:.3,ease:ea}}},children:[v&&(0,a.jsxs)(en.z,{align:"center",mb:3,pt:6,children:[(0,a.jsx)(eq.e,{mt:1,size:"sm",name:null==o?void 0:o.displayName,src:null==o?void 0:o.profileImageUrl,ignoreFallback:!0}),(0,a.jsx)(er.B,{align:"center",alignItems:"flex-start",spacing:0,mb:1,children:(0,a.jsx)(eB.E,{fontWeight:"600",mb:0,fontSize:"sm",children:(0,a.jsx)(eu.x6,{id:"866PMb",values:{0:null==o?void 0:o.displayName}})})})]}),(0,a.jsx)(tA,{pl:y&&eS?8:0,pt:v?0:6,initialContent:(null==T?void 0:T.json)||"",clearContentOnSave:!0,editable:!0,saveButtonText:(0,a.jsx)(eu.x6,{id:"ImOQa9"}),saveButtonIcon:(0,a.jsx)(eh.g,{icon:ed.Eze}),placeholder:z.Ru._({id:"ImOQa9"}),onCommentSave:e=>{let l={targetId:t.targetId,commentId:R,docId:i,content:e,cardId:t.cardId};J({variables:{input:l},update:(e,t)=>{let{data:l}=t;e.writeFragment({id:"Doc:".concat(i),fragment:L.Mi,fragmentName:"DocRepliesCreate",data:{comments:[{id:R,replies:[null==l?void 0:l.createComment],__typename:"Comment"}]}})},optimisticResponse:{createComment:{id:ek,__typename:"Comment",...l,user:o,archived:!1,reactions:[],createdTime:new Date().toISOString(),updatedTime:new Date().toISOString()}}}),K(!1),P(null),E((0,g.zq)({id:R})),X({title:z.Ru._({id:"yPok8v"}),status:"success",duration:5e3,isClosable:!1,position:k})},onCancelEditingClick:et,onUpdate:e=>{let{editor:t}=e;P({commentId:R,json:t.view.state.doc.toJSON(),text:t.view.state.doc.textContent})},onCreate:e=>{D.current.resolve(e)},alwaysShowButtons:v,shouldFocus:"popup"===u||"drawer"===u})]})]})}),lf=e=>{let{comment:t,editor:l,commentIdToHighlight:n,userCanComment:o,blockAllowsCommenting:i,getPos:r,isMobile:s,closePopup:d}=e,u=l.gammaDocId,{user:m}=(0,C.ur)(),f=(0,x.d4)(g.wC),p=(0,c.GV)(g.Jo),h=(0,tt.h6)(p,m),b=eF({editor:l,getPos:r});if(null===b||!t)return null;let y=(0,a.jsxs)(ei.s,{direction:"column",className:"comments-list","data-testid":"thread-view-popup",children:[h&&!m&&p&&i&&(0,a.jsx)(to,{accessLink:h,doc:p,className:"comments-sign-up"}),(0,a.jsx)(lm,{instanceType:s?"drawer":"popup",userCanComment:o,commentIdToHighlight:n,editor:l,comment:t,selfUser:m,docId:u,editorMode:f,isRootComment:!0,borderBottomWidth:"none",closePopup:d,p:s?0:4,pb:4},t.id)]});return s?y:(0,a.jsx)(tM,{offsetFromTop:b,children:y})},lp={generate:(0,r.d_)("0123456789abcdefghijklmnopqrstuvwxyz",15)},lg=e=>{let{getPos:t,editor:l,reactions:a}=e,{user:n}=(0,C.ur)(),[o]=(0,O.nkJ)(),[i]=(0,O.eaJ)(),r=(0,s.useCallback)(e=>{let{reaction:t}=e;if(!n)return;let a=t.docId;1===t.count&&l.commands.deleteAnnotation(t.targetId);let o=t.count-1,r=t.users.filter(e=>(null==e?void 0:e.id)!==(null==n?void 0:n.id));i({variables:{reactionInput:{docId:a,targetId:t.targetId,emoji:t.emoji}},update:(e,t)=>{let{data:l}=t;e.writeFragment({id:"Doc:".concat(a),fragment:O.JhL,fragmentName:"DocReactionsCreate",data:{reactions:[null==l?void 0:l.removeReaction]}})},optimisticResponse:{removeReaction:{docId:a,targetId:t.targetId,targetType:O.yKx.Decoration,count:o,emoji:t.emoji,users:r,__typename:"Reaction"}}})},[l,i,n]);return{addReactionFn:(0,s.useCallback)(e=>{let{emoji:i}=e;if(V({emoji:i,user:n,reactions:a})||!n)return;let r=l.gammaDocId,s=q({reactions:a,emoji:i}),d=lp.generate(),u=((null==s?void 0:s.count)||0)+1,c=[];s?(d=s.targetId,c=[...s.users]):l.commands.addAnnotation({id:d,pos:t()}),c.unshift(n),c.sort((e,t)=>e.id>t.id?1:-1),o({variables:{reactionInput:{docId:r,targetId:d,targetType:O.yKx.Decoration,emoji:i}},update:(e,t)=>{let{data:l}=t;e.writeFragment({id:"Doc:".concat(r),fragment:O.JhL,fragmentName:"DocReactionsCreate",data:{reactions:[null==l?void 0:l.addReaction]}})},optimisticResponse:{addReaction:{docId:r,targetId:d,targetType:O.yKx.Decoration,count:u,emoji:i,users:c,__typename:"Reaction"}}})},[o,l,t,a,n]),removeReactionFn:r}},lh={"add-comment":"350px","add-reaction":"350px","reactions-overflow":"350px"},lb=e=>{let{nodeName:t,isVisible:l,editor:n,getPos:i,comments:r,reactions:d,createDraftComment:u,cleanupDraftComment:m,onCommentDraftUpdate:f,draftComment:p,onCommentSave:h,userCanComment:v,blockAllowsCommenting:k,blockCommentId:z,enableReactions:I,mobileAddCommentPos:j,setIsButtonStackHovered:F}=e,B=(0,w.d)(),R=(0,b.Xb)(),_=(0,x.wA)(),{user:M,isUserLoading:E}=(0,C.ur)(),{isHovering:T,delayedClose:O,...P}=(0,y.ou)({enterDelay:30,leaveDelay:100}),N=!!T,D=(0,s.useRef)(null),L=(0,s.useRef)(),W=(0,x.d4)((0,g.tT)(z)),U=(0,s.useRef)(null),[G,H]=(0,s.useState)(null),V=null!==G,q=(0,c.GV)(g.Ml),K=r.find(e=>e.id===q)||null,J=(0,s.useCallback)(e=>{H("thread"),_((0,g.fw)({isOpen:!0,blockCommentId:z,viewingCommentId:e.id}))},[z,_]),$=(0,s.useCallback)(e=>{H("add-comment"),_((0,g.fw)({isOpen:!0,blockCommentId:z,viewingCommentId:null})),u(e)},[z,_,u]),Q=(0,s.useCallback)(()=>{H("add-reaction"),_((0,g.fw)({isOpen:!0,blockCommentId:z,viewingCommentId:null}))},[z,_]),Y=(0,s.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];H(null),m(),_((0,g.fw)({isOpen:!1,blockCommentId:z,viewingCommentId:null})),e&&O(1e3)},[z,m,O,_]),{addReactionFn:X,removeReactionFn:Z}=lg({editor:n,getPos:i,reactions:d}),el=(0,s.useCallback)(e=>{v&&(X({emoji:e.id}),B({title:(0,a.jsx)(eJ,{emoji:e.id,isMobile:R}),status:"success",duration:5e3,isClosable:!1,position:R?"bottom":"top"}),Y(!0))},[X,Y,R,B,v]),ea=(0,s.useCallback)(e=>{h(e),Y(!0)},[h,Y]),en=(0,s.useCallback)(e=>{if(!v)return;let t=e.reactions.find(e=>{var t;return null===(t=e.users)||void 0===t?void 0:t.find(e=>e.id===(null==M?void 0:M.id))});t?Z({reaction:t}):X({emoji:e.emoji})},[X,Z,M,v]),eo=(0,s.useCallback)(()=>{H("reactions-overflow"),_((0,g.fw)({isOpen:!0,blockCommentId:z,viewingCommentId:null}))},[z,_]);ej({isOpen:V,popupRef:U,onClose:Y});let{isExpanded:ei}=eI({popup:G,isMobile:R,isHovered:N,comments:r,reactions:d,draftComment:p,enableReactions:I});(0,s.useEffect)(()=>{R||F(N)},[N,R,F]),ee(i,$);let er=et({comments:r,blockAllowsCommenting:k,showComment:(0,s.useCallback)(e=>{(0,A.Ib)({pos:i(),editor:n}),J({id:e})},[n,i,J])});(0,s.useEffect)(()=>{S.LF.emit(S.DN.POPUP_COMMENT_TOGGLED,{open:V})},[V]);let es=(0,s.useCallback)(e=>{"Escape"===e.key&&Y()},[Y]);if(!l||E)return null;let ed=!!M&&!v,eu=0===r.length&&0===d.length;if((ed||!k)&&eu)return null;let ec=ed||!k;return(0,a.jsxs)(a.Fragment,{children:[R&&j&&(0,a.jsx)(eH,{onClickAddComment:$,onClickAddReaction:Q,top:j.top,left:j.left}),(0,a.jsxs)(ew.p,{nodeName:t,className:(0,o.cx)("block-comments-stack",ei&&"is-expanded",ei&&"is-taking-action",eu&&"is-empty",!R&&W&&"other-comment-open"),isMobile:R,isEmpty:eu,isPopupOpen:V,...P,buttonRef:D,onKeyDown:es,hasCommentsOrReactions:!eu,children:[(0,a.jsx)(eG,{isExpanded:ei,isMobile:R,user:M,userCanComment:v,blockAllowsCommenting:k,draftComment:p,reactions:d,comments:r,onClickThread:J,onClickAddComment:$,onClickAddReaction:Q,onClickExistingReaction:en,onClickReactionsOverflow:eo,hideAddCommentButton:ec,onClosePopup:Y,viewingCommentId:q,enableReactions:I}),!V&&!R&&(0,a.jsx)(eK,{isExpanded:ei,comments:r,reactions:d}),V&&(0,a.jsxs)(tU,{isMobile:R,ref:U,closePopup:Y,drawerMinHeight:lh[G],children:["thread"===G&&(0,a.jsx)(lf,{isMobile:R,comment:K,closePopup:Y,editor:n,getPos:i,commentIdToHighlight:er,commentsPanelRef:L,userCanComment:v,blockAllowsCommenting:k}),"add-comment"===G&&(0,a.jsx)(tE,{isMobile:R,onCancel:()=>{Y()},editor:n,getPos:i,commentIdToHighlight:er,userCanComment:v,blockAllowsCommenting:k,onCommentSave:ea,draftComment:p,onCommentDraftUpdate:f}),"add-reaction"===G&&(0,a.jsx)(tO,{isMobile:R,onReactionClick:el,editor:n,getPos:i}),"reactions-overflow"===G&&(0,a.jsx)(tG,{isMobile:R,onCancel:()=>{Y()},onClickExistingReaction:en,editor:n,getPos:i,user:M,userCanComment:v,blockAllowsCommenting:k,reactions:d})]})]})]})};new(l(81570)).hs("draftComments");let ly=(e,t,l)=>({targetId:lp.generate(),targetHtml:l,json:null,text:"",relativePos:(0,D.JO)(t.state,e())}),lv=(e,t,l,a)=>({...e,targetHtml:l,relativePos:(0,D.JO)(a.state,t())}),lk=e=>{let{children:t,as:l,className:n,dir:o,style:i,hideComments:r=!1,readOnly:s=!1,...d}=e,{decorations:u,editor:c}=d,f=(0,m.oR)();return!u.some(e=>e.spec.isAnnotatable)||c.isThumbnail||f?(0,a.jsx)(p.VR,{as:l,className:n,dir:o,style:i,children:t}):(0,a.jsx)(lw,{as:l,className:n,dir:o,style:i,hideComments:r,readOnly:s,...d,children:t})},lw=e=>{var t;let{children:l,decorations:m,editor:w,getPos:x,as:S,className:A,dir:C,style:z,hideComments:I,readOnly:j,node:F}=e,{isConnected:B}=(0,d.u)(),R=(0,v.pl)(m),_=k({editor:w,decorations:m}),M=(0,u.u)("blockReactions"),E=(0,f.UT)("comment"),T=(0,c.GV)(g.mi),O=(0,s.useMemo)(()=>(0,r.Ak)(5),[]),P=(0,c.GV)((0,g.ng)(O)),[N,D]=(0,s.useState)(!1),L=(0,u.u)("debugComments"),W=X(m),U=W[0]||null,[G,H]=(0,s.useState)(null),V=(0,c.jL)(),q=(0,s.useCallback)(e=>{let t=(null==e?void 0:e.getPos)||x,l=null==e?void 0:e.targetHtml,a=U;if(a)e&&(a=lv(a,t,l,w));else{var n,o;a=ly(t,w,l),null===(n=(o=w.commands).createDraftComment)||void 0===n||n.call(o,a)}H(a),V((0,g.mF)({attached:!1}))},[V,w,x,U]),K=(0,s.useCallback)(()=>{var e,t,l,a,n,o;G&&(null==G?void 0:null===(t=G.text)||void 0===t?void 0:null===(e=t.trim())||void 0===e?void 0:e.length)>0?null===(l=(a=w.commands).createDraftComment)||void 0===l||l.call(a,G):null===(n=(o=w.commands).removeDraftComments)||void 0===n||n.call(o,W),H(null)},[W,w,G]),J=(0,s.useRef)(P);J.current=P,(0,s.useEffect)(()=>()=>{J.current&&V((0,g.fw)({isOpen:!1,blockCommentId:O,viewingCommentId:null}))},[O,V]);let $=Z({draftComment:G,clearDraftComment(){var e,t,l,a;G&&(null===(l=(a=w.commands).removeDraftComments)||void 0===l||l.call(a,[G,...W]));let n=ly(x,w);null===(e=(t=w.commands).createDraftComment)||void 0===e||e.call(t,n),H(n)},editor:w}),Q=Y(m),ee=Q.length>0&&!I,et=G||U,el=(null==et?void 0:null===(t=et.text)||void 0===t?void 0:t.length)>0,[en,eo]=(0,y.Mk)(),ei=ea(m);M||(ei=[]);let er=ei.length>0,es=T&&!I&&E,ed=(0,b.Xb)()&&(P||ee||er||!!_)||!(0,b.Xb)()&&(eo||R||P||ee||er||el),eu=E&&B,ec=P||_||N?(0,h.$3)(i.t1.colors.yellow[200],.25):void 0;return(0,a.jsxs)(p.VR,{as:S,style:{...z,position:"relative",backgroundColor:(0,b.Xb)()?void 0:ec},className:(0,o.cx)(A,"annotatable-node-view-wrapper",(0,b.Xb)()&&"is-mobile",L?"debug-comments":""),dir:C,ref:en,children:[es&&(0,a.jsx)(lb,{nodeName:F.type.name,isVisible:ed,reactions:ei,blockCommentId:O,userCanComment:eu,blockAllowsCommenting:!I&&!j,onCommentDraftUpdate:e=>{let{editor:t}=e;H(e=>e?{...e,json:t.view.state.doc.toJSON(),text:t.view.state.doc.textContent}:e)},cleanupDraftComment:K,createDraftComment:q,editor:w,getPos:x,comments:Q,draftComment:et,onCommentSave:$,enableReactions:M,mobileAddCommentPos:_,setIsButtonStackHovered:D}),(0,b.Xb)()&&ec?(0,a.jsx)(n.az,{bgColor:ec,children:l}):l]})}},45930:(e,t,l)=>{"use strict";l.d(t,{p:()=>c,V:()=>u});var a=l(31085),n=l(80532),o=l(62313),i=l(25420),r=l(14041),s=l(64130);let d=(0,r.memo)(e=>{let{nodeName:t}=e,l=(0,s.fW)();return(0,a.jsx)(n.jl,{contentEditable:!1,userSelect:"none",insetEnd:0,size:4,transform:"translate(calc(".concat("calc(".concat("gridLayout"===t||"gallery"===t?"-1 * var(--grid-padding)":"0px"," + var(--comment-padding) + 50%)")," * ").concat(l?"-1":"1","),calc(50%)) scale(1)"),position:"absolute",bgGradient:"linear(to-b, yellow.200, yellow.300)",border:"1px solid white",shadow:"0 0 0 1px rgb(0 0 0 / 10%)",className:"block-comments-circle",zIndex:"1"})});d.displayName="BlockCommentsCircle";let u="comments-wrapper",c=(0,r.forwardRef)(function(e,t){let{nodeName:l,isPopupOpen:r,onKeyDown:s,buttonRef:c,isMobile:m,hasCommentsOrReactions:f,children:p,isEmpty:g,...h}=e;return(0,a.jsxs)(n.az,{ref:t,contentEditable:!1,suppressContentEditableWarning:!0,pointerEvents:"none","data-comments-wrapper":!0,"data-is-popup-open":r,className:u,alignSelf:"start",onKeyDown:s,"data-print-hidden":!0,children:[!g&&!m&&(0,a.jsx)(d,{nodeName:l}),(0,a.jsx)(o.z,{contentEditable:!1,suppressContentEditableWarning:!0,...m?f?{pt:4}:{}:{position:"absolute",ms:"100%",top:0,height:"100%",align:"flex-start"},className:"controls-wrapper controls-wrapper__".concat(l),children:(0,a.jsx)(i.s,{direction:"row",ref:c,contentEditable:!1,suppressContentEditableWarning:!0,transitionProperty:"common",transitionDuration:"fast",zIndex:21,"data-controls-toggle-button":!0,ms:[0,"-17px"],...h,children:p})})]})})},17119:(e,t,l)=>{"use strict";l.d(t,{Q4:()=>f,Ti:()=>u,U5:()=>p,Vo:()=>m,cE:()=>d,ek:()=>b,es:()=>g,nh:()=>h,rV:()=>c});var a=l(3583),n=l(6998),o=l(13236),i=l(77646),r=l(46896),s=l(65202);let d=e=>(0,i.jg)(e)||(0,i.sw)(e)||(0,r.p8)(e),u=(e,t)=>!(0,i.jg)(e)&&!(0,i.sw)(e)&&d(t),c=e=>{if(d(e.parent))return{pos:e.pos,node:e.nodeAfter};for(let t=e.depth;t>0;t--){let l=e.node(t);if(d(e.node(t-1)))return{pos:t>0?e.before(t):0,node:l}}return null},m=e=>{let{pos:t,from:l,to:a,editor:n}=e,{state:r}=n,d=s.q.getState(r);if(!d)return null;let u=(0,o.eL)(n.state.doc.resolve(t),i.jg),c=d.getAnnotationsBetween(r,l,a),m=u?d.getAnnotationsBetween(r,u.pos,u.pos+u.node.nodeSize).filter(e=>!c.find(t=>t.id===e.id)):[];return{inBlock:c,inCard:m,origNodePos:t}},f=e=>{let{dropPos:t,dropNode:l,dragging:o,side:i,tr:r,view:d}=e,u=s.q.getState(d.state);if(!u)return[];let c=u.getAnnotationsBetween(d.state,t,t+l.nodeSize),m=o.inBlock,f="left"===i?o.origNodePos:t,p="left"===i?t:o.origNodePos,{doc:g,type:h,binding:b}=a.pJ.getState(d.state),y=r.mapping.map(t),v=(e,t)=>l=>{let{id:a,relativePos:o}=l,i=(0,n.bL)(g,h,o,b.mapping);return null==i?null:{id:a,newPos:y+(i-e)+t}},k=[...("left"===i?m:c).map(v(f,1)).filter(e=>!!e),...("left"===i?c:m).map(v(p,2)).filter(e=>!!e)],w=o.inCard.filter(e=>{let{id:t}=e;return!k.find(e=>e.id===t)}).map(e=>{let{id:t,pos:l}=e,a=r.mapping.map(l);return l===a?null:{newPos:a,id:t}}).filter(e=>!!e);return[...k,...w]},p=e=>{let{dropPos:t,dropNode:l,dragging:o,side:i,tr:r,view:d,leftContentSize:u}=e,c=s.q.getState(d.state);if(!c)return[];let m=c.getAnnotationsBetween(d.state,t,t+l.nodeSize),f=o.inBlock,p="left"===i?o.origNodePos:t,g="left"===i?t:o.origNodePos,{doc:h,type:b,binding:y}=a.pJ.getState(d.state),v=r.mapping.map(t),k=(e,t)=>l=>{let{id:a,relativePos:o}=l,i=(0,n.bL)(h,b,o,y.mapping);return null==i?null:{id:a,newPos:v+(i-e)+t}},w=[...("left"===i?f:m).map(k(p,2)).filter(e=>!!e),...("left"===i?m:f).map(k(g,4+u)).filter(e=>!!e)],x=o.inCard.filter(e=>{let{id:t}=e;return!w.find(e=>e.id===t)}).map(e=>{let{id:t,pos:l}=e,a=r.mapping.map(l);return l===a?null:{newPos:a,id:t}}).filter(e=>!!e);return[...w,...x]},g=e=>{let{contentPos:t,contentEnd:l,insertPos:o,editor:i}=e,r=s.q.getState(i.state);if(!r)return[];let{state:d}=i,u=r.getAnnotationsBetween(d,t,l),{doc:c,type:m,binding:f}=a.pJ.getState(i.view.state);return u.map(e=>{let{id:l,relativePos:a}=e,i=(0,n.bL)(c,m,a,f.mapping);return null==i?null:{id:l,newPos:o+(i-t)}}).filter(e=>!!e)},h=e=>{let t,{dropPos:l,dragging:o,cardWrapOffset:i,tr:r,view:d}=e;if(!s.q.getState(d.state))return[];let{doc:u,type:c,binding:m}=a.pJ.getState(d.state),f=r.mapping.map(l,-1),p=o.inBlock.map((t=o.origNodePos,e=>{let{id:l,relativePos:a}=e,o=(0,n.bL)(u,c,a,m.mapping);return null==o?null:{id:l,newPos:f+(o-t)+i}})).filter(e=>!!e),g=o.inCard.filter(e=>{let{id:t}=e;return!p.find(e=>e.id===t)}).map(e=>{let{id:t,pos:l}=e,a=r.mapping.map(l);return l===a?null:{newPos:a,id:t}}).filter(e=>!!e);return[...p,...g]},b=e=>{let{pos:t,tr:l,editor:a}=e,n=s.q.getState(a.view.state);if(!n)return[];let o=a.state.doc.resolve(t);return o.nodeAfter?n.getAnnotationsBetween(a.state,t,t+o.nodeAfter.nodeSize).map(e=>{let{id:a,pos:n}=e;return{id:a,newPos:n===t?l.mapping.map(n+1)-1:l.mapping.map(n)}}):[]}},47687:(e,t,l)=>{"use strict";l.d(t,{a:()=>p,h:()=>g});var a=l(81313),n=l(13236),o=l(81570),i=l(73686),r=l(65998),s=l(95580);class d extends o.k_{removeOverlappingDecorations(e,t){let l=this.getDecorationsRanges(t),a=e.find(l.from,l.to).filter(e=>l.hasRange(e));return e.remove(a)}getDecorationsRanges(e){let t=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,a=new Set;return e.forEach(e=>{let{from:n,to:o}=e;nl&&(l=o),a.add("".concat(n,":").concat(o))}),{from:t,to:l,hasRange:e=>{let{from:t,to:l}=e;return a.has("".concat(t,":").concat(l))}}}decorateDoc(e){let t=[];return e.descendants(this.decorateNode.bind(this,t)),i.zF.create(e,t)}processStep(e,t,l,a){let n=t.doc,o=t.mapping.slice(a+1),i=o.map("from"in e?e.from:e.pos),r="to"in e?o.map(e.to):i,s="slice"in e?e.slice.content.size:0;n.descendants((e,t,a,n)=>!(t+e.nodeSizer+s)&&("document"===e.type.name||!a||this.decorateNode(l,e,t,a,n)))}constructor({key:e,decorateNode:t,options:l={}}){super({key:e,state:{init(e,t){let{doc:l}=t;return{decorations:this.decorateDoc(l)}},apply(e,t){var a,n;let o=null===(a=l.processEntireDoc)||void 0===a?void 0:a.call(l),i=null!==(n=l.shouldProcessStep)&&void 0!==n?n:s.Be,r=t.decorations;if(!e.steps.length&&!o)return{...t,decorations:r.map(e.mapping,e.doc)};if(o||(0,s.R3)(e))return{...t,decorations:this.decorateDoc(e.doc)};let d=[];e.steps.forEach((t,l)=>{if(i(t))return this.processStep(t,e,d,l)});let u=this.removeOverlappingDecorations(r.map(e.mapping,e.doc),d).add(e.doc,d);return{...t,decorations:u}}},props:{decorations:t=>{var l;return null===(l=e.getState(t))||void 0===l?void 0:l.decorations}}}),this.decorateNode=t}}var u=l(19534),c=l(17119),m=l(42849);function f(e,t,l,n,o){if((0,c.cE)(n)&&e.push(i.NZ.node(l,l+t.nodeSize,{},{isAnnotatable:!0})),(0,u.CD)(t))e.push(i.NZ.node(l,l+t.nodeSize,{class:(0,a.cx)("block","block-".concat(t.type.name),0===o&&"first-block",o===n.childCount-1&&"last-block")})),0===o&&((0,u.jg)(n)||(0,m.Eg)(n))&&e.push(i.NZ.node(l,l+t.nodeSize,{class:"first-block-in-card"},{isFirstBlockInCard:!0}));else{if(!t.isLeaf&&!t.isBlock)return!1;e.push(i.NZ.node(l,l+t.nodeSize,{class:"node-".concat(t.type.name)}))}return!0}let p=n.YY.create({name:"blockClass",addOptions:()=>({blockClass:"block"}),addProseMirrorPlugins:()=>[new d({key:new o.hs("blockClass"),decorateNode:f,options:{processEntireDoc:()=>!r.of.get("useTransactionBlockPlugin")}})]}),g=e=>!!e.find(e=>e.spec.isFirstBlockInCard)},65056:(e,t,l)=>{"use strict";l.d(t,{Q2:()=>s,mM:()=>u});var a=l(13236),n=l(81570),o=l(29097),i=l(98371),r=l(95580);let s=new n.hs("menuBubble");class d{initialize(e){let{element:t,tippyOptions:l,panelLifecycle:a,onHide:n,targetElement:o}=e;if(!t){console.warn("[BubbleMenuView] initialize. No element provided");return}this.onHide=n,this.element=t,this.element.addEventListener("mousedown",this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener("dragstart",this.dragstartHandler),this.view.dom.addEventListener("dragend",this.dragendHandler),this.view.dom.addEventListener("drop",this.dragendHandler),this.editor.on("focus",this.focusHandler),this.editor.on("blur",this.blurHandler),this.createTooltip(l,o),this.element.style.visibility="visible",document.addEventListener("mousedown",this.mousedownDocumentHandler,!0),document.addEventListener("mouseup",this.mouseupDocumentHandler,!0),a&&(this.cleanupPanelLifecycle=a.on("resize",()=>{var e;null===(e=this.tippy.popperInstance)||void 0===e||e.update()}))}createTooltip(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,l=t||this.view.dom.parentElement;this.tippy=(0,o.Ay)(l,{duration:0,getReferenceClientRect:null,content:this.element,interactive:!0,trigger:"manual",placement:"top",hideOnClick:"toggle",...e}),this.editor.commands.command(e=>{let{tr:t}=e;return t.setMeta(s,{tippyInstance:this.tippy}),!0})}update(e,t){let l=t&&s.getState(t),n=s.getState(e.state),{state:o,composing:d}=e,{doc:u,selection:m}=o,f=t&&t.doc.eq(u)&&t.selection.eq(m)&&this.isEditable===this.editor.isEditable&&(null==l?void 0:l.forceHide)===n.forceHide;if(!this.element){if(!n.element)return;this.initialize(n)}if(this.isEditable=this.editor.isEditable,!this.editor.isEditable||!0===n.forceHide){this.hide();return}if(d||f)return;let{empty:p,ranges:g}=m,h=Math.min(...g.map(e=>e.$from.pos)),b=Math.max(...g.map(e=>e.$to.pos)),y=!u.textBetween(h,b).length&&(0,a.eE)(e.state.selection);if(p||y){let e=m.$anchor.marks().some(e=>"link"===e.type.name)||"button"===m.$anchor.parent.type.name,t=(0,a.Nx)(u,{from:h,to:b},e=>"emoji"===e.type.name);if(!e&&(null==t?void 0:t.length)===0){this.hide();return}}this.tippy.setProps({getReferenceClientRect:()=>{if(!(0,a.BQ)(e.state.selection))return(0,a.MG)(e,h,b);let t=e.nodeDOM(h);return t&&(0,i.sb)(t)?(c(t,".drag-handle")||c(t,"[data-content-reference]")||t).getBoundingClientRect():(0,a.MG)(e,h,b)}}),!this.isMouseDownOutsideMenu&&(0,r.We)(this.editor)&&this.show()}show(){this.tippy.show(),document.body.classList.add("formatting-menu-open")}hide(){this.onHide&&"function"==typeof this.onHide&&this.onHide(),this.tippy.hide(),document.body.classList.remove("formatting-menu-open")}destroy(){var e,t;null===(e=this.tippy)||void 0===e||e.destroy(),null===(t=this.element)||void 0===t||t.removeEventListener("mousedown",this.mousedownHandler),document.removeEventListener("mousedown",this.mousedownDocumentHandler,!0),document.removeEventListener("mouseup",this.mouseupDocumentHandler,!0),this.view.dom.removeEventListener("dragstart",this.dragstartHandler),this.editor.off("focus",this.focusHandler),this.editor.off("blur",this.blurHandler),this.cleanupPanelLifecycle&&this.cleanupPanelLifecycle()}constructor({editor:e,view:t}){this.preventHide=!1,this.mousedownDocumentHandler=e=>{this.element.contains(e.target)?this.isMouseDownOutsideMenu=!1:this.isMouseDownOutsideMenu=!0},this.mouseupDocumentHandler=()=>{this.isMouseDownOutsideMenu=!1,this.update(this.editor.view)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.dragendHandler=()=>{this.isMouseDownOutsideMenu=!1,setTimeout(()=>this.update(this.editor.view))},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=e=>{var t;let{event:l}=e;if(this.preventHide){this.preventHide=!1;return}(null==l?void 0:l.relatedTarget)&&(null===(t=this.element.parentNode)||void 0===t?void 0:t.contains(l.relatedTarget))||this.hide()},this.editor=e,this.isEditable=e.isEditable,this.view=t}}let u=a.YY.create({name:"bubbleMenu",addCommands:()=>({forceHideBubbleMenu:e=>t=>{let{tr:l}=t;return l.setMeta(s,{forceHide:e}),!0},refreshBubbleMenu:()=>e=>{var t;let{state:l}=e,{tippyInstance:a}=s.getState(l);return null==a||null===(t=a.popperInstance)||void 0===t||t.forceUpdate(),!0}}),addProseMirrorPlugins(){let{editor:e}=this;return[new n.k_({key:s,state:{init:()=>({element:null,forceHide:!1,onHide:()=>{},tippyOptions:{},tippyInstance:null}),apply(e,t){let l=e.getMeta(s);return l?{...t,...l}:t}},view:t=>new d({view:t,editor:e})})]}}),c=(e,t)=>{let l=e.querySelector(t),a=e.querySelector("[data-node-view-wrapper]");return l&&a&&(0,i.xX)(l,e,e=>e.hasAttribute("data-node-view-wrapper"))===a?l:null}},16262:(e,t,l)=>{"use strict";l.d(t,{A3:()=>r,EW:()=>s,Tg:()=>i,_w:()=>o});var a=l(20501),n=l(12327);let o=()=>({note:{name:n.Ru._({id:"KiJn9B"}),commandName:()=>n.Ru._({id:"Cq+sLh"}),description:n.Ru._({id:"ooy/OF"}),icon:a.jyJ,colorScheme:"accent"},info:{name:n.Ru._({id:"CE+M2e"}),commandName:()=>n.Ru._({id:"1E4ojF"}),description:n.Ru._({id:"NfbNtV"}),icon:a.iW_,colorScheme:"blue"},warning:{name:n.Ru._({id:"r6y+jM"}),commandName:()=>n.Ru._({id:"xb1fsI"}),icon:a.JAe,description:n.Ru._({id:"tpYgEx"}),colorScheme:"yellow"},caution:{name:n.Ru._({id:"VvjZ7K"}),commandName:()=>n.Ru._({id:"tC/T1p"}),description:n.Ru._({id:"nbib7S"}),icon:a.rfe,colorScheme:"red"},success:{name:n.Ru._({id:"zzDlyQ"}),commandName:()=>n.Ru._({id:"Vv+D/T"}),description:n.Ru._({id:"pqvop4"}),icon:a.SGM,colorScheme:"green"},question:{name:n.Ru._({id:"bfgr/e"}),commandName:()=>n.Ru._({id:"Ev0Vqt"}),description:n.Ru._({id:"IsUqRH"}),icon:a.wRm,colorScheme:"gray"}}),i=e=>o()[e]||o().note,r=()=>Object.entries(o()).map(e=>{let[t,{commandName:l,icon:a}]=e;return{key:"calloutBox-".concat(t),name:l,nodeName:"calloutBox",icon:a,shortcut:"/".concat(t),keywords:["callout","box"],execute:e=>e.chain().focus().insertContent([{type:"calloutBox",attrs:{variant:t},content:[{type:"paragraph"}]}]).run()}}),s=Object.fromEntries(Object.keys(o()).map(e=>["calloutBox-".concat(e),{type:"calloutBox",attrs:{variant:e},content:[{type:"paragraph"}]}]))},5366:(e,t,l)=>{"use strict";l.d(t,{$:()=>i,TH:()=>r,dY:()=>s});var a=l(31085),n=l(80532),o=l(26813);let i={effect:"faded"},r=e=>{let{background:t}=e,{mask:l=i}=t;if(!s(t)||!d(l))return null;let o={frosted:{backdropFilter:"blur(10px) saturate(150%)",backgroundColor:"var(--card-color-mask)"},faded:{backgroundColor:"var(--card-color-mask)"}}[l.effect||"none"];return(0,a.jsx)(n.az,{position:"absolute",inset:"0",borderRadius:"inherit",transitionProperty:"backdrop-filter, background",transitionDuration:"normal",...o})},s=e=>e.type===o.h.IMAGE||!e.type,d=e=>!!e&&"none"!==e.effect},85452:(e,t,l)=>{"use strict";l.d(t,{CM:()=>n,C_:()=>i,VJ:()=>r,md:()=>o});let a=(0,l(8796).Z0)({name:"CardMenus",initialState:{cardId:null,menuOpen:null},reducers:{toggle(e,t){let{cardId:l,menuType:a}=t.payload;e.cardId=e.menuOpen===a?null:l,e.menuOpen=e.menuOpen===a?null:a},close(e){e.menuOpen=null,e.cardId=null}}}),{toggle:n,close:o}=a.actions,i=(e,t)=>l=>{let{cardId:a,menuOpen:n}=l.CardMenus;return n===t&&a===e},r=a.reducer},94984:(e,t,l)=>{"use strict";l.d(t,{HF:()=>s,lj:()=>r,mR:()=>i,ol:()=>d});var a=l(8796);let n={currentSourceKey:l(48192).j},o=(0,a.Z0)({name:"EditBackgroundDrawer",initialState:n,reducers:{setCurrentSourceKey(e,t){e.currentSourceKey=t.payload.sourceKey},resetCurrentSourceKey(e){e.currentSourceKey=n.currentSourceKey}}}),{setCurrentSourceKey:i,resetCurrentSourceKey:r}=o.actions,s=e=>e.EditBackgroundDrawer.currentSourceKey,d=o.reducer},42717:(e,t,l)=>{"use strict";l.d(t,{O:()=>a});let a={prompt:"",template:null,settings:{},status:"ready"}},24293:(e,t,l)=>{"use strict";l.d(t,{PN:()=>o,fJ:()=>n,lK:()=>i});var a=l(12327);let n="card-layout",o="25px",i={accentImage:()=>a.Ru._({id:"YXjp37"}),cardBackground:()=>a.Ru._({id:"yYiJkI"})}},69646:(e,t,l)=>{"use strict";l.d(t,{Wq:()=>p,iM:()=>m,jL:()=>f,wE:()=>g,wV:()=>h});var a=l(13236),n=l(3668),o=l.n(n),i=l(81570),r=l(88957),s=l(61690),d=l(14e3),u=l(19534),c=l(82354);let m=a.YY.create({name:"cardCollapse",addKeyboardShortcuts:()=>({Escape:e=>{let{editor:t}=e,l=(0,r.KA)();if((0,s.wC)(l.getState())===d.w.SLIDE_VIEW)return!1;let{selection:n}=t.state;if(!n.empty)return!1;let o=(0,a.KP)(u.jg)(n);return!!o&&o.depth>c.$x&&!p(o.node)&&(g(o.node.attrs.id,!0),!0)}}),addProseMirrorPlugins:()=>[new i.k_({key:new i.hs("cardCollapse"),appendTransaction:(e,t,l)=>{if(l.selection.eq(t.selection)||!l.selection.empty)return;let n=(0,a.KP)(u.jg)(l.selection);if(!n)return;let{node:o,pos:r}=n;if(p(o))try{let{tr:e}=l,t=i.nh.create(e.doc,r);if(!t)return;return e.setSelection(t)}catch(e){console.error("Error moving selection out of collapsed card",{node:o,pos:r},e)}}})]}),f=(e,t)=>{let l=[],a=[];e.descendants((e,t,n)=>{if(!(0,u.jg)(e))return;let{id:o}=e.attrs;n&&"document"===n.type.name?l.push(o):a.push(o)}),t((0,s.ln)({cardIds:l,isCollapsed:!1})),t((0,s.ln)({cardIds:a,isCollapsed:!0}))},p=e=>{let t="string"==typeof e?e:e.attrs.id;if(!t)return;let l=(0,r.KA)().getState();return(0,s.WS)(t)(l)},g=(e,t)=>{if(o()(e)){console.error("[setCardCollapsed] Input is unexpectedly not string | string[]: ",e);return}let l=Array.isArray(e)?e:[e],a=(0,r.KA)();(1!==l.length||(0,s.WS)(l[0])(a.getState())!==t)&&a.dispatch((0,s.ln)({cardIds:l,isCollapsed:t}))},h=e=>{let t=(0,r.KA)();void 0===t.getState().TipTap.memoState.expandedCards[e]&&t.dispatch((0,s.ln)({cardIds:[e],isCollapsed:!1}))}},11576:(e,t,l)=>{"use strict";l.d(t,{xs:()=>i,iI:()=>r}),l(31085);var a=l(20501);l(24221);var n=l(2628),o=l(12327);l(14041),l(95986);let i={fluid:{label:()=>o.Ru._({id:"f5YDMB"}),icon:a.eqm,description:()=>o.Ru._({id:"3JV7Yt"}),aspectRatio:null,defaultVerticalAlign:"center"},"16x9":{label:()=>o.Ru._({id:"ekoaFo"}),description:()=>o.Ru._({id:"nmOzVW"}),aspectRatio:n.VM["16x9"],defaultVerticalAlign:"center",orientation:n.tb.landscape,counterOrientation:"16x9_portrait"},"16x9_portrait":{label:()=>o.Ru._({id:"iMNTNx"}),description:()=>o.Ru._({id:"LX+k3Q"}),aspectRatio:n.VM["16x9_portrait"],defaultVerticalAlign:"start",orientation:n.tb.portrait,counterOrientation:"16x9"},"4:3":{label:()=>o.Ru._({id:"ww+nHW"}),description:()=>o.Ru._({id:"nmOzVW"}),aspectRatio:n.VM["4:3"],defaultVerticalAlign:"center",orientation:n.tb.landscape,counterOrientation:"3:4"},"3:4":{label:()=>o.Ru._({id:"oVkG9N"}),description:()=>o.Ru._({id:"nmOzVW"}),aspectRatio:n.VM["3:4"],defaultVerticalAlign:"start",orientation:n.tb.portrait,counterOrientation:"4:3"},a4:{label:()=>o.Ru._({id:"i+5kKa"}),description:()=>o.Ru._({id:"UTXvCx"}),aspectRatio:n.VM.a4,defaultVerticalAlign:"center",orientation:n.tb.landscape,counterOrientation:"a4_portrait"},a4_portrait:{label:()=>o.Ru._({id:"pzj1N+"}),buttonLabel:()=>o.Ru._({id:"i+5kKa"}),description:()=>o.Ru._({id:"UTXvCx"}),aspectRatio:n.VM.a4_portrait,defaultVerticalAlign:"start",orientation:n.tb.portrait,counterOrientation:"a4"},letter:{label:()=>o.Ru._({id:"S4Fsut"}),description:()=>o.Ru._({id:"UTXvCx"}),aspectRatio:n.VM.letter,defaultVerticalAlign:"center",orientation:n.tb.landscape,counterOrientation:"letter_portrait"},letter_portrait:{label:()=>o.Ru._({id:"fVkwbQ"}),buttonLabel:()=>o.Ru._({id:"S4Fsut"}),description:()=>o.Ru._({id:"UTXvCx"}),aspectRatio:n.VM.letter_portrait,defaultVerticalAlign:"start",orientation:n.tb.portrait,counterOrientation:"letter"},square:{label:()=>o.Ru._({id:"1DA6ap"}),icon:a.Nfw,description:()=>o.Ru._({id:"5SkGv0"}),aspectRatio:n.VM.square,defaultVerticalAlign:"center"},"4:5":{label:()=>o.Ru._({id:"wfHH4f"}),description:()=>o.Ru._({id:"5SkGv0"}),aspectRatio:n.VM["4:5"],defaultVerticalAlign:"center",orientation:n.tb.portrait,counterOrientation:"5:4"},"5:4":{label:()=>o.Ru._({id:"AABTux"}),description:()=>o.Ru._({id:"5SkGv0"}),aspectRatio:n.VM["5:4"],defaultVerticalAlign:"center",orientation:n.tb.landscape,counterOrientation:"4:5"}},r=e=>e&&i[e]||i.fluid},44428:(e,t,l)=>{"use strict";l.d(t,{QJ:()=>b,Jl:()=>h});var a=l(25369),n=l(13236),o=l(81570),i=l(11329),r=l(10458),s=l(43873),d=l(46343),u=l.n(d),c=l(61690),m=l(95580),f=l(19534);let p=e=>{let t=[],l={tree:{},parents:{},treeArray:[]};return e.doc.descendants((a,n)=>{if(!(0,f.jg)(a))return;let o=e.doc.resolve(n),i=a.attrs.id;t.push(i);let r=(0,m.TK)(o,f.jg).reverse().map(e=>{let{node:t}=e;return t.attrs.id}),s=[...r,i];s.reduce((e,t)=>(e[t]=e[t]||{},e[t]),l.tree),l.parents[i]=r,s.reduce((e,t)=>{let l=e.find(e=>e.id===t);return l?l.children:(e.push({id:i,children:[]}),e)},l.treeArray)}),{cardIds:t,cardIdMap:l}};class g{compute(e){let t=p(e);u()(this.value,t)||(this.hasChanges=!0);let l=t.cardIds.filter(Boolean),a=l.filter((e,t)=>l.includes(e,t+1));return this.duplicateCardIds=a.filter(e=>!this.duplicateCardIds.includes(e)),this.value=t,this}apply(e,t){return e.docChanged&&this.compute(t),this}processChanges(e){this.hasChanges&&this.value&&e((0,c.t0)(this.value)),this.hasChanges=!1}constructor(){this.hasChanges=!1,this.duplicateCardIds=[],this.value=null}}let h=new o.hs("cardIds"),b=n.YY.create({name:"cardIds",priority:s.y.CardIds,addOptions:()=>({enabled:!0}),addProseMirrorPlugins(){return this.options.enabled?[new o.k_({key:h,state:{init:()=>new g,apply:(e,t,l,a)=>t.apply(e,a)},appendTransaction:(e,t,l)=>{var n;let o=h.getState(l);if(!(null==o?void 0:null===(n=o.value)||void 0===n?void 0:n.cardIds))return null;if(e.some(e=>e.docChanged)&&o.duplicateCardIds.length&&!this.editor.isThumbnail){let t={duplicateIds:JSON.stringify(o.duplicateCardIds),transactions:JSON.stringify(y(e)),isThumbnail:this.editor.isThumbnail};null===r.zS||void 0===r.zS||r.zS.track(r.ng.DUPLICATE_CARD_IDS,{...t}),a.Cp("[generateCardIdMap] Duplicate cardIds detected. This is unexpected and will cause spotlight issues. Additional metadata:",{extra:t})}return null}})]:[]}}),y=e=>e.map(e=>{let t=e.steps.map(e=>{if(e instanceof i.Ln||e instanceof i.Wg){var t,l,a;let n=(null===(l=e.slice.toJSON())||void 0===l?void 0:null===(t=l.content)||void 0===t?void 0:t[0])||{},o={type:n.type,attrs:n.attrs,contentLength:null===(a=n.content)||void 0===a?void 0:a.length};return{name:e.constructor.name,from:e.from,to:e.to,sliceContentSimple:o}}return e instanceof i.q4?{name:e.constructor.name,pos:e.pos,attr:e.attr}:{name:e.constructor.name}}),l=Object.fromEntries(Object.entries(e.meta).map(e=>{let[t,l]=e;if("annotationEvent"===t){var a,n,o,i,r;return[t,{type:l.type,droppedBlockPos:l.droppedBlockPos,dragging:{inBlockLength:null===(n=l.dragging)||void 0===n?void 0:null===(a=n.inBlock)||void 0===a?void 0:a.length,inCardLength:null===(i=l.dragging)||void 0===i?void 0:null===(o=i.inCard)||void 0===o?void 0:o.length,origNodePos:null===(r=l.dragging)||void 0===r?void 0:r.origNodePos}}]}return"uiEvent"===t?[t,l]:[t,"object"==typeof l?"object":l]}));return{stepsData:t,docChanged:e.docChanged,selection:{from:e.selection.from,to:e.selection.to},selectionSet:e.selectionSet,metaData:l}})},29383:(e,t,l)=>{"use strict";l.d(t,{R:()=>a});let a=new(l(36832)).b},49964:(e,t,l)=>{"use strict";l.d(t,{JH:()=>c,Nu:()=>f,jh:()=>u,kB:()=>m});var a=l(12327),n=l(13236),o=l(56005),i=l.n(o),r=l(26813),s=l(19534),d=l(42849);let u=(e,t)=>{var l,a;let{background:n,fitType:o}=e,{allowFit:i}=(0,d.lH)(t);return i?o||((null==n?void 0:null===(a=n.image)||void 0===a?void 0:null===(l=a.meta)||void 0===l?void 0:l.has_transparency)?"fit":"fill"):"fill"},c=(e,t)=>{var l;let{allowFit:a}=(0,d.lH)(t);return a&&(null===(l=e.background)||void 0===l?void 0:l.type)===r.h.IMAGE},m=(e,t,l)=>{let a=(0,n.eL)(e.state.doc.resolve(t),s.jg);t&&(l?e.commands.updateAttributesAtPos(t,{background:{type:r.h.NONE}}):(null==a?void 0:a.pos)&&(e.commands.setCardLayout(a.pos,"blank"),e.commands.selectInsideCardBody(a.pos)))},f=e=>"blank"===e?a.Ru._({id:"6JcK6b"}):"behind"===e?a.Ru._({id:"SQOVlA"}):a.Ru._({id:"T8aKxO",values:{0:i()(e)}})},31485:(e,t,l)=>{"use strict";l.d(t,{Bn:()=>x,OX:()=>w,jV:()=>k});var a=l(13236),n=l(81570),o=l(11329),i=l(73686),r=l(17303),s=l(88957),d=l(80245),u=l(26813),c=l(95580),m=l(1279),f=l(20379),p=l(20265),g=l(93090),h=l(77646),b=l(3756),y=l(15333),v=l(42849);let k=new n.hs("cardLayoutPlugin"),w=e=>new n.k_({key:k,state:{init:()=>({draggingData:null}),apply:(e,t)=>t},filterTransaction:(e,t)=>{if(!e.docChanged||!((0,a.BQ)(t.selection)&&(0,h.sw)(t.selection.node))||e.steps.every(e=>e instanceof o.q4)||e.getMeta("imageUploadUpdateAttrs")||e.steps.every(t=>{if(!(t instanceof o.Ln))return!1;let l=e.before.nodeAt(t.from);if(!l||!(0,v.wL)(l))return!1;let a=t.slice.content;return 1===a.childCount&&(0,v.wL)(a.firstChild)}))return!0;let l=(0,d.A)(e).every(t=>{let l=e.before.nodeAt(t.oldStart);return!l||!(0,h.sw)(l)});return l||console.warn("[CardLayoutPlugin] blocking transaction with CardLayoutItem selected"),l},appendTransaction:(t,l,n)=>{if(!(t.some(e=>e.docChanged)&&!l.doc.eq(n.doc))||!(0,f.e)(e.state.doc).cardLayoutsEnabled)return;let o=n.tr,i=(0,a.T7)(l.doc,t);if((0,d.A)(i).forEach(t=>{let l={from:t.newStart,to:t.newEnd};(0,a.Nx)(n.doc,l,e=>"card"===e.type.name).forEach(t=>{let{pos:a}=t;if(a(0,y.Po)(e,t,l),drop(t,l){let a=t.state.tr,n=(0,y.ZL)(t,l);if(n&&n.isImageUpload){l.preventDefault();let o=n.pos;(0,b.c)(e,a,o,n.layout);let{accent:i}=(0,v.dg)(a,o);if(!i)throw Error("Could not find accent after setting card layout=".concat(n.layout," at pos=").concat(n.pos));return(0,p.TH)(e,a,n.file,i.pos),t.dispatch(a),!0}let o=(0,y.nA)(t,l);if(o&&o.isImageUpload)return l.preventDefault(),(0,p.TH)(e,a,o.file,o.pos),t.dispatch(a),!0;let i=(0,y.aI)(e,t,l),r=k.getState(t.state);return i&&r&&(r.draggingData={removeLayoutFromCardId:i.node.attrs.id}),!1}},handlePaste:(t,l,a)=>{let{selection:o}=t.state;if(!(o instanceof n.nh&&(0,v.wL)(o.node)))return!1;let i=(0,g.bC)(e,l,a),r=(0,m.H)(a);if(r&&"image"!==r.type.name||!i)return!1;let s=i.attrs||(null==r?void 0:r.attrs);return e.commands.updateNestedAttributesAtPos(o.from,{background:{image:s,type:u.h.IMAGE,source:null==s?void 0:s.source}}),i.upload(),!0},handleDrop(t,l,a){let n=t.state.tr,o=(0,y.f0)(e,n,t,l,a),i=(0,y.vR)(t,n,l,a);return(!!o||!!i)&&((0,y.zZ)(e,n),t.dispatch(n),!0)},decorations:e=>{let{doc:t}=e,l=[];return t.descendants((e,a)=>{if("card"===e.type.name){let n=t.resolve(a),o=(0,c.TK)(n,h.jg).map(e=>e.node),d=(0,r.uw)((0,s.KA)().getState()),u=(0,v.zr)({parentCards:o,layout:e.attrs.layout,isMobileDevice:d});e.forEach((t,a)=>{let o=n.pos+a+1;if(!(0,h.sw)(t))return;let r={cardId:e.attrs.id,isCardLayoutDecoration:!0,layout:u,cardSize:e.attrs.cardSize};l.push(i.NZ.node(o,o+t.nodeSize,{"data-layout-item-id":t.attrs.itemId},r))})}}),i.zF.create(t,l)}}}),x=e=>{let t=e.find(e=>e.spec.isCardLayoutDecoration);return null==t?void 0:t.spec}},3756:(e,t,l)=>{"use strict";l.d(t,{c:()=>o});var a=l(26813),n=l(42849);let o=(e,t,l,o,i)=>{let r=t.doc.nodeAt(l);if((null==r?void 0:r.type.name)!=="card")return!1;let s=r.attrs,d=(0,n.lH)(o);if((0,n.Fm)(t,l,e.schema,d),o===s.layout)return!0;t.setNodeAttribute(l,"layout",o);let{accent:u}=(0,n.dg)(t,l);if(i&&u&&u.node.attrs.background.type===a.h.NONE){let e=i();e&&t.setNodeAttribute(u.pos,"background",e)}let{layoutTemplateColumns:c}=r.attrs,m=s.layout;return c&&("left"===m&&"right"===o||"right"===m&&"left"===o)&&t.setNodeAttribute(l,"layoutTemplateColumns",c.split(" ").reverse().join(" ")),!0}},15333:(e,t,l)=>{"use strict";l.d(t,{Po:()=>A,ZL:()=>k,aI:()=>y,f0:()=>S,nA:()=>h,vR:()=>b,zZ:()=>v});var a=l(13236),n=l(81570),o=l(80917),i=l(26813),r=l(95580),s=l(19534),d=l(17539),u=l(1279),c=l(93090),m=l(77646),f=l(3756),p=l(31485),g=l(42849);let h=(e,t,l)=>{let a=e.posAtCoords({left:t.clientX,top:t.clientY});if(!a||a.inside<0)return null;let{doc:n}=e.state,{inside:o}=a,m=n.resolve(o),f=(0,r.IV)(m,g.wL),p=(0,r.IV)(m,s.jg)[0],h=l&&(0,u.H)(l),b=(0,r.q0)(o,e);if(0===f.length||!b||!p)return null;if(!h){let e=(0,c.p$)(t).filter(e=>(0,d.u3)(e.type));return 1!==e.length?null:{pos:o,rect:b,isImageUpload:!0,file:e[0]}}return h&&"image"===h.type.name?{pos:o,rect:b,isImageUpload:!1,background:{type:i.h.IMAGE,source:h.attrs.source,image:h.attrs}}:null},b=(e,t,l,a)=>{let n;try{if(!(n=h(e,l,a)))return!1}catch(e){return console.error("(caught) [CardLayoutPlugin] handleDrop checkGalleryDropTarget error:",e),!1}return!!n&&!n.isImageUpload&&(t.setNodeAttribute(n.pos,"background",n.background),t.deleteSelection(),!0)},y=(e,t,l)=>{var a,n;let o=t.posAtCoords({left:l.clientX,top:l.clientY});if(!o||o.inside<0)return null;let{doc:i}=t.state,{inside:d}=o,u=i.resolve(d),c=(0,r.IV)(u,s.jg)[0];if(!c)return null;let f=null===(n=t.dragging)||void 0===n?void 0:null===(a=n.accentImage)||void 0===a?void 0:a.cardId;if(!f)return null;let p=f===c.node.attrs.id;return u.nodeAfter&&(0,g.wL)(u.nodeAfter)&&p?null:(0,m.W0)(e,f)},v=(e,t)=>{var l;let n=p.jV.getState(e.state);if(null==n?void 0:null===(l=n.draggingData)||void 0===l?void 0:l.removeLayoutFromCardId){let l=n.draggingData.removeLayoutFromCardId;n.draggingData=null;let o=(0,a.xe)(t.doc,e=>(0,s.jg)(e)&&e.attrs.id===l)[0];return!!o&&(0,f.c)(e,t,o.pos,"blank")}return!1},k=(e,t,l)=>{let a=e.posAtCoords({left:t.clientX,top:t.clientY});if(!a||a.inside<0)return null;let{doc:n}=e.state,{inside:o}=a,m=n.resolve(o),f=n.nodeAt(o),p=(null==f?void 0:f.type.name)==="cardLayoutItem";if(!f||!p)return null;let[g,...h]=(0,r.IV)(m,s.jg),b=l&&(0,u.H)(l),y=(0,r.q0)(o,e);if(!g||!y||h.length>0)return null;let v=g.node.attrs,k="blank"===v.layout?x(t,y):"behind"===v.layout?w(t,y):null;if(!k)return null;if(!b){let e=(0,c.p$)(t).filter(e=>(0,d.u3)(e.type));return 1!==e.length?null:{pos:g.pos,isImageUpload:!0,file:e[0],...k}}return b&&"image"===b.type.name?{pos:g.pos,...k,isImageUpload:!1,background:{type:i.h.IMAGE,source:b.attrs.source,image:b.attrs}}:null},w=(e,t)=>e.clientYt.right-80?{layout:"behind",rect:t}:null,x=(e,t)=>{let l,a=t,n=Math.min(t.height/3,100),o=t.left+40,i=t.right-40;if(e.clientXi)l="right",a={...t.toJSON(),right:t.right,left:t.right-t.width/3,top:t.top,bottom:t.bottom};else{if(!(e.clientY{var r;let d;try{if(!(d=k(l,o,i)))return!1}catch(e){return console.error("(caught) [handleImageDropCreateAccent] handleDrop checkCreateCardAccentDropTarget error:",e),!1}if(!d||d.isImageUpload||!d.layout)return!1;let u=d.background;t.deleteSelection();let c=t.doc.resolve(t.mapping.map(d.pos)),m=c.nodeAfter&&"card"===c.nodeAfter.type.name?c.pos:null===(r=(0,a.eL)(c,s.jg))||void 0===r?void 0:r.pos;if(!m)return!1;(0,f.c)(e,t,m,d.layout);let{accent:p}=(0,g.dg)(t,m);return!!p&&(t.setNodeAttribute(p.pos,"background",u),t.setSelection(n.nh.create(t.doc,p.pos)),!0)},A=(e,t,l)=>{if(!l.target)return;let a=t.posAtDOM(l.target,0);if(!a||a<0)return;let n=(0,m.Oq)(e,a),r=t.state.doc.nodeAt(a);if(!r||!(0,g.wL)(r))return;if(r.attrs.background.type===i.h.NONE)return l.preventDefault(),l.stopPropagation(),!0;let s=e.view.domAtPos(a).node;if(s&&l.dataTransfer){let e=s.querySelector("[data-content-reference]");if(e){let t=e.cloneNode(!0);t.style.width="18em",t.style.height="10em",t.style.borderRadius=".375em";let a=document.createElement("div");a.style.position="absolute",a.style.top="-9999px",a.style.left="-9999px",document.body.appendChild(a),a.appendChild(t),l.dataTransfer.clearData(),l.dataTransfer.effectAllowed="move",l.dataTransfer.setData("text/html",t.innerHTML),l.dataTransfer.setData("text/plain",t.textContent||""),l.dataTransfer.setDragImage(t,0,0),setTimeout(()=>{document.body.removeChild(a)},0)}}return(0,o.f)(e,{type:"image",attrs:{...r.attrs.background.image,source:r.attrs.background.source}}),t.dragging.accentImage={cardId:null==n?void 0:n.node.attrs.id},!0}},42849:(e,t,l)=>{"use strict";l.d(t,{Eg:()=>k,Fm:()=>b,OH:()=>y,dg:()=>f,in:()=>d,l0:()=>m,lH:()=>c,o_:()=>w,sP:()=>r,tZ:()=>u,wL:()=>v,zr:()=>s});var a=l(26813),n=l(95580),o=l(77646),i=l(32570);let r=e=>["left","right"].includes(e),s=e=>{let{layout:t,parentCards:l,isMobileDevice:a}=e;return a&&"left"===t?"mobileLeft":a&&"right"===t?"mobileRight":r(t)&&d(l)?"blank":t},d=e=>e.some(e=>r(e.attrs.layout)),u=e=>{let t=c(e),l={};return Object.entries(t.items).forEach(e=>{var t;let[a,n]=e,o=null!==(t=null==n?void 0:n.style)&&void 0!==t?t:{gridArea:a};l['> [data-layout-item-id="'.concat(a,'"]')]=o}),l},c=e=>i.qA[null!=e?e:"blank"]||i.qA.blank,m=e=>{let t={},l=e.pos,a=e.nodeAfter;return a?a.descendants((e,a)=>{if(!(0,o.sw)(e))return!1;t[e.attrs.itemId]={node:e,pos:l+1+a}}):console.error("[getCardLayoutItems] could not find card node at pos ".concat(l)),t},f=(e,t)=>m(e.doc.resolve(t)),p=(e,t,l)=>{let a=e.doc.resolve(t.pos+1),n=a.blockRange(e.doc.resolve(a.end()));n&&e.wrap(n,[{type:l.nodes.cardLayoutItem}]).setMeta("annotationEvent",{type:"wrap-nodes",start:n.start,end:n.end,level:1})},g=(e,t,l,a)=>{let n=l.nodes.cardLayoutItem.createAndFill({itemId:"body",...a});e.insert(t+1,n)},h=(e,t,l,n)=>{let o=l.nodes.cardAccentLayoutItem.createAndFill({itemId:"accent",background:{type:a.h.NONE},...n});e.insert(t+1,o)},b=(e,t,l,a)=>{let n=e.doc.nodeAt(t),o=f(e,t);if(0===Object.keys(o).length){p(e,{node:n,pos:t},l),a.items.accent&&h(e,t,l);return}a.items.body&&!o.body&&g(e,t,l),a.items.accent&&!o.accent?h(e,t,l):o.accent&&"cardLayoutItem"===o.accent.node.type.name&&y(e,o.accent.pos,o.accent.node,l)},y=(e,t,l,a)=>{e.replaceRangeWith(t,t+l.nodeSize,a.nodes.cardAccentLayoutItem.createAndFill({...l.attrs}))},v=e=>"cardAccentLayoutItem"===e.type.name&&"accent"===e.attrs.itemId,k=e=>"cardLayoutItem"===e.type.name&&"body"===e.attrs.itemId,w=e=>{let t=(0,n.GY)(e,v)[0];if(t)return t.node.attrs.background}},32570:(e,t,l)=>{"use strict";l.d(t,{Ib:()=>n,qA:()=>o});let a="24em",n=.625,o={top:{grid:{gridTemplateColumns:"1fr",gridTemplateRows:"var(--top-accent-height-md) auto",gridTemplateAreas:'"accent" "body"'},items:{accent:{type:"accent"},body:{type:"body"}},numColumns:1,allowResizing:!0,allowFit:!0},mobileLeft:{grid:{gridTemplateColumns:"1fr",gridTemplateRows:["40vh auto"],gridTemplateAreas:'"accent" "body"'},items:{accent:{type:"accent"},body:{type:"body"}},numColumns:1,allowResizing:!1,allowFit:!0},mobileRight:{grid:{gridTemplateColumns:"1fr",gridTemplateRows:["auto 40vh"],gridTemplateAreas:'"body" "accent"'},items:{accent:{type:"accent"},body:{type:"body"}},numColumns:1,allowResizing:!1,allowFit:!0},behind:{grid:{gridTemplateColumns:"1fr",gridTemplateRows:"minmax(var(--behind-accent-height, ".concat(a,"), auto)")},items:{accent:{type:"accent",style:{gridArea:"1 / 1"}},body:{type:"body",style:{gridArea:"1 / 1",zIndex:1}}},numColumns:1,stickyAccent:!0,allowResizing:!1,allowFit:!1},blank:{grid:{gridTemplateColumns:"1fr",gridTemplateRows:"1fr",gridTemplateAreas:'"body"'},items:{body:{type:"body"}},numColumns:1,allowResizing:!1,allowFit:!1},left:{grid:{gridTemplateColumns:"".concat(37.5,"% ").concat(100*n,"%"),gridTemplateRows:"minmax(".concat(a,", auto)"),gridTemplateAreas:'"accent body"'},items:{accent:{type:"accent"},body:{type:"body"}},numColumns:2,stickyAccent:!0,allowResizing:!0,allowFit:!0},right:{grid:{gridTemplateColumns:"".concat(100*n,"% ").concat(37.5,"%"),gridTemplateRows:"minmax(".concat(a,", auto)"),gridTemplateAreas:'"body accent"'},items:{accent:{type:"accent"},body:{type:"body"}},numColumns:2,stickyAccent:!0,allowResizing:!0,allowFit:!0}}},12554:(e,t,l)=>{"use strict";l.d(t,{I5:()=>f,NO:()=>p,PD:()=>m,eh:()=>c,ni:()=>d,o_:()=>g,x8:()=>s});var a=l(81570),n=l(65998),o=l(3756),i=l(32262),r=l(77646);let s=()=>n.of.get("cardNotes"),d=(e,t)=>{var l;let a=e.state.doc.nodeAt(t);if(!a||(null===(l=a.lastChild)||void 0===l?void 0:l.type.name)==="cardNotes")return;let n=t+a.nodeSize-1,i={type:"cardNotes",content:[{type:"paragraph"}]};if(a.firstChild&&(0,r.sw)(a.firstChild))e.chain().insertContentAt({from:n,to:n},{type:"cardNotes",content:[{type:"paragraph"}]},{updateSelection:!1}).noUndo().run();else{e.chain().command(l=>{let{tr:a}=l;(0,o.c)(e,a,t,"blank");let r=a.mapping.map(n);return a.insert(r,e.schema.nodeFromJSON(i)),!0}).noUndo().run();return}},u=e=>"cardNotes"===e.type.name,c=e=>null!==e.lastChild&&u(e.lastChild),m=e=>{let t=null;return e.nodeAfter.descendants((l,a)=>!u(l)||(t={node:l,pos:a+e.pos+1},!1)),t},f=(e,t,l)=>{let n=(0,i.hT)(e.state.doc,t);if(!n||!n.pos||l&&n.node.attrs.id!==l)return!1;let o=e.state.doc.resolve(n.pos).pos,r=o+n.node.nodeSize,{selection:s}=e.state,d=s instanceof a.U3?s.to=o&&d},p=e=>"cardNotes"==e.schema.topNodeType.name,g=e=>{if(0===e.childCount)return!0;let t=!1;return e.content.nodesBetween(0,e.content.size,e=>!e.isAtom||!!e.isText||(t=!0,!1)),0===e.textContent.trim().length&&!t}},14250:(e,t,l)=>{"use strict";l.d(t,{qc:()=>y,tg:()=>v});var a=l(81570),n=l(73686),o=l(17303),i=l(88957),r=l(42391),s=l(38684),d=l(95580),u=l(17119),c=l(42849),m=l(32262),f=l(12554);l(82354);var p=l(77646);class g{constructor(e=null){this.dragging=e}}let h=new a.hs("cardPlugin"),b=["card","calloutBox","image","cardLayoutItem","cardAccentLayoutItem","cardNotes","chart","smartLayoutCell"],y=e=>new a.k_({key:h,state:{init:()=>new g,apply:(e,t)=>t},props:{decorations:e=>{let{doc:t}=e,l=[];return t.descendants((e,a,u,m)=>{if(b.includes(e.type.name)){var g,h,y,v,k;let b=t.resolve(a),w=(0,d.TK)(b,p.jg).map(e=>e.node),x=(0,p.kj)(w,"width"),S=(0,p.jg)(e)?w.length:w.length-1,A=S>0,C=!A&&m===u.childCount-1,z=!!(e.firstChild&&(0,p.sw)(e.firstChild)),I=(0,c.o_)(e),j=(null==I?void 0:I.type)==="none",F=null==I?void 0:null===(g=I.mask)||void 0===g?void 0:g.effect,B=(0,s.gK)((0,p.jg)(e)?null===(h=e.attrs.container)||void 0===h?void 0:h.background:null===(v=w[0])||void 0===v?void 0:null===(y=v.attrs.container)||void 0===y?void 0:y.background),R=B?(0,r.$p)(B):void 0,_=(0,o.uw)((0,i.KA)().getState()),M=(0,c.zr)({layout:e.attrs.layout,parentCards:w,isMobileDevice:_}),E=null!==e.lastChild&&(0,f.eh)(e),T=E&&!(0,f.o_)(e.lastChild),O={isCardDecoration:!0,nestedDepth:S,isNested:A,isFirstCard:!A&&0===m,isLastCard:C,hasLayoutItem:z,hasNoAccentBackground:j,cardAccentBackgroundMaskEffect:F,isCardDark:R,cardColorOverride:B,displayLayout:M,insideSideLayout:(0,c.in)(w),parentCardId:null===(k=w[0])||void 0===k?void 0:k.attrs.id,inheritContainerWidth:x,hasCardNotesNode:E,hasNonEmptyCardNotes:T};l.push(n.NZ.node(a,a+e.nodeSize,{},O))}}),l.length>0?n.zF.create(t,l):n.zF.empty},handleDOMEvents:{drop(e){var t;let l=null===(t=e.dragging)||void 0===t?void 0:t.annotations,a=h.getState(e.state);if(!a)return!1;a.dragging=l}},handleDrop:(t,l,a)=>{var n;let o=h.getState(t.state),i=null==o?void 0:o.dragging;o&&(o.dragging=null);let r=(0,m.M7)(t,l,a);if(!r)return!1;let s=a.content.toJSON();if(!s)return!1;let d=(null===(n=s[0])||void 0===n?void 0:n.type)==="card";if(d&&i)return e.commands.rearrangeCards({from:i.origNodePos,to:r.pos,position:"above"});let c=d?s:{type:"card",content:s},{selection:f}=t.state,p=!f.empty;try{return e.chain().insertContentAt(r.pos,c,{updateSelection:!1}).command(l=>{let{tr:a}=l;if(p&&a.deleteSelection(),i){let l=(0,u.nh)({view:t,tr:a,cardWrapOffset:d?0:1,dragging:i,dropPos:r.pos});requestAnimationFrame(()=>{var t,a;null===(t=(a=e.commands).moveAnnotations)||void 0===t||t.call(a,l)})}return!0}).focusMapped(r.pos,1).run()}catch(e){return console.error("(caught) [Cardplugin] handleDrop error:",e),!0}}}}),v=e=>{let t=e.find(e=>e.spec.isCardDecoration);return t?t.spec:{isNested:!1,hasLayoutItem:!1,nestedDepth:0,isFirstCard:!1,isCardDecoration:!0,isLastCard:!1,displayLayout:"blank",insideSideLayout:!1,hasNoAccentBackground:!0,hasCardNotesNode:!1,hasNonEmptyCardNotes:!1}}},32262:(e,t,l)=>{"use strict";l.d(t,{Ib:()=>b,M7:()=>k,OM:()=>v,Tv:()=>g,Ub:()=>x,hT:()=>h});var a=l(13236),n=l(81570),o=l(88957),i=l(65084),r=l(33242),s=l(61690),d=l(95580),u=l(98371),c=l(14e3),m=l(69646),f=l(82354),p=l(77646);let g=(e,t,l)=>{let n=e=>{let t=(0,p.jg)(e),a="boolean"!=typeof l||(0,m.Wq)(e)===l;return t&&a},o=e.state.doc.nodeAt(t),i=e.state.doc.resolve(t);return o&&n(o)?{node:o,pos:t,start:i.start,depth:i.depth}:(0,a.eL)(e.state.doc.resolve(t),n)},h=(e,t)=>{try{let l=(e,t)=>(0,p.jg)(e)&&t===f.$x,a=e.resolve(t),n=e.nodeAt(t);if(n&&l(n,a.depth+1))return{node:n,pos:t};return(0,d.Ft)(a,l)}catch(e){console.error("[findTopCardNodeParent] error",e);return}},b=e=>{let{pos:t,editor:l}=e,a=(0,d.TK)(l.state.doc.resolve(t),p.jg).map(e=>e.node.attrs.id);(0,m.wE)(a,!1)},y=async e=>{let{cardId:t,pos:l,editor:a,cardEl:o,isNested:s=!1,origin:d="editor"}=e;if(!o){console.error("[scrollToCard] no cardEl specified");return}(0,m.wE)(t,!1),b({pos:l,editor:a}),await (0,i.H1)("editor").scrollElementIntoView({element:o,delay:s?f.M2:0}),a.commands.command(e=>{let{tr:t}=e;return t.setSelection(n.LN.near(a.state.doc.resolve(l))).setMeta(r.H,d),!0})},v=e=>{let{cardId:t,editor:l}=e;if(!t)return;let a=(0,o.KA)();if((0,s.wC)(a.getState())===c.w.SLIDE_VIEW){l.commands.spotlightCardById(t);return}let n=document.querySelector('[data-card-id="'.concat(t,'"]'));if(!n)return;let{pos:i}=(0,p.W0)(l,t)||{};if(!i)return;let r=l.state.doc.resolve(i).depth>f.$x;y({cardId:t,pos:i,editor:l,cardEl:n,isNested:r})},k=(e,t,l)=>{let a;let n=t.target;if(n.closest(".".concat(f.p$))&&!n.closest("[data-outside-card-body]")||l&&!w(l,e.state.schema))return null;let o=n.closest(".".concat(f.QJ));if(!o)return{pos:e.state.doc.content.size-1};let i=o.querySelector(".".concat(f.p$)),r=null==i?void 0:i.getBoundingClientRect();if(!r)return null;let{doc:s}=e.state;try{let t=e.posAtDOM(o,0);if(-1===t)return null;let l=(0,d.TK)(s.resolve(t),p.jg);if(0===l.length)return null;a=l[l.length-1]}catch(e){return console.error("(caught) [checkBetweenCardsDropTarget] error finding parent node:",e),null}let{node:c,pos:m}=a;if(!m||!c)return null;let[g]=(0,u.qp)(i),h=g+r.top,b=g+r.bottom,y=g+t.clientY;return yb?{pos:m+c.nodeSize}:null},w=(e,t)=>t.nodes.card.validContent(e.content),x=(e,t)=>{let l=(0,d.GY)(e,e=>"cardLayoutItem"===e.type.name);return l.length>0?{node:l[0].node,pos:t+l[0].pos+1}:{node:e,pos:t}}},63751:(e,t,l)=>{"use strict";l.d(t,{AF:()=>n,HY:()=>i,Hb:()=>c,IM:()=>f,Ri:()=>s,St:()=>m,Vy:()=>g,YW:()=>u,_0:()=>d,br:()=>h,cK:()=>o,jN:()=>a,lA:()=>p,rN:()=>r,s5:()=>b});let a=3.5,n=1.5,o=2.75,i=1.5,r=2.25,s=2,d=1,u=2,c=.5,m=8,f=.5,p=60,g=95,h=115,b=47.5},85888:(e,t,l)=>{"use strict";l.d(t,{P:()=>d,S:()=>s});var a=l(2940),n=l.n(a),o=l(22544),i=l(63751),r=l(1667);let s=e=>{var t;let{theme:l,fontSize:a,isMobileDevice:n,contentWidth:o,nestedDepth:s=0}=e,d=(0,r.Qo)(a||"md"),u="lg"===o?i.br:"sm"===o?i.lA:i.Vy,c=null!==(t=l.config.fontSize)&&void 0!==t?t:1,m=c*d,f=u*(i.IM/c)/d,p=(0,r._F)(s);return{baseFontSize:m,contentWidthEms:f,themeFontSize:c,cardWidthEms:f+2*(0,r.mn)({isMobileDevice:n,numericFontSize:d})+2*p}},d=n()(e=>{let{isPresentMode:t,isNested:l,nestedDepth:a,isFullBleed:n,isThumbnail:i,theme:r,cardDimensions:d,defaultContentWidth:p,contentWidth:g,showPresentBackdrop:h,isMobileDevice:b,docZoomLevel:y,fontSize:v,cardFontScale:k=1}=e,{baseFontSize:w,contentWidthEms:x,cardWidthEms:S}=s({theme:r,fontSize:v,isMobileDevice:b,contentWidth:null!=g?g:p,nestedDepth:a});return{...(t||i?d.aspectRatio&&!o.LD?f:m:b?c:u)({baseFontSize:w,contentWidthEms:x,cardWidthEms:S,cardAspectRatio:d.aspectRatio,showPresentBackdrop:h,isNested:l,isFullBleed:n,isThumbnail:i,docZoomLevel:y,nestedDepth:a,cardFontScale:k})}}),u=e=>{let{cardWidthEms:t,cardAspectRatio:l,isNested:a,baseFontSize:n,docZoomLevel:o,cardFontScale:i,contentWidthEms:r}=e;return{"--font-size":"calc(".concat(n," * var(--card-font-scale, 1) * var(--editor-font-size, 1rem) * ").concat(o," * var(--viewport-scale-factor, 1.125))"),"--card-font-scale":"".concat(i||1),"--card-width":"calc(".concat(t,"em / var(--card-font-scale, 1))"),"--card-min-height":l&&!a?"calc(min(var(--card-width), var(--editor-width)) / ".concat(l,")"):"0px","--max-content-width":"calc(".concat(r,"em / var(--card-font-scale, 1))"),"--card-max-width":"var(--editor-width)","--media-scale":"min(1, var(--card-font-scale, 1))"}},c=e=>{let{cardWidthEms:t,baseFontSize:l,isNested:a,cardAspectRatio:n}=e;return{"--font-size":"".concat(l,"rem"),"--card-width":"".concat(t,"em"),"--card-min-height":n&&!a?"calc(min(var(--card-width), var(--editor-width)) / ".concat(n,")"):"0px","--card-max-width":"var(--editor-width)","--media-scale":"1"}},m=e=>{let{contentWidthEms:t,cardWidthEms:l,showPresentBackdrop:a,isFullBleed:n,baseFontSize:i,isNested:r,isThumbnail:s}=e,d=o.rS||o.GC?"calc(".concat(i,"rem * var(--viewport-scale-factor, 1.125))"):"calc(var(--zoom-level) * clamp(".concat(s?"0rem":"1rem",", var(--card-max-width) / ").concat(l,", 3vh))"),u=!a||n;return{"--font-size":d,"--card-width":u?"var(--editor-width)":"".concat(l,"em"),"--card-max-width":"calc(var(--editor-width) - 2 * var(--card-outer-padding-x))","--card-min-height":s?"var(--thumbnail-min-height, 0px)":u&&!r?"100vh":"0vh","--max-content-width":"calc(".concat(1.15*t,"em / var(--zoom-level))"),"--media-scale":"min(1, var(--zoom-level))"}},f=e=>{let{cardAspectRatio:t,cardWidthEms:l,isNested:a,cardFontScale:n}=e,i=o.rS||o.GC?"calc(var(--card-max-width) / ".concat(t,")"):"calc(100vh - 2 * var(--card-outer-padding-y))",r="min(var(--card-max-width), calc(var(--card-max-height) * ".concat(t,"))"),s=a?"0px":"calc(".concat(r," / ").concat(t,")"),d="calc(var(--zoom-level) * var(--card-font-scale, 1) * ".concat(r," / ").concat(l,")");return{"--card-width":r,"--card-font-scale":"".concat(n||1),"--font-size":d,"--card-max-width":"calc(var(--editor-width) - 2 * var(--card-outer-padding-x))","--card-max-height":i,"--card-min-height":s,"--media-scale":"min(1, var(--zoom-level) * var(--card-font-scale, 1))"}}},1667:(e,t,l)=>{"use strict";l.d(t,{Qo:()=>s,X6:()=>u,_F:()=>d,mn:()=>r,ng:()=>c});var a=l(2940),n=l.n(a),o=l(82354),i=l(63751);let r=e=>{let{isMobileDevice:t,numericFontSize:l}=e;return(t?i.AF:i.jN)/l},s=e=>"sm"===e?.875:"lg"===e?1.25:1,d=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return e*o.P},u=n()(e=>e?{"--top-accent-height-sm":"4.125em","--top-accent-height-md":"8em","--top-accent-height-lg":"12.375em","--top-accent-height":"var(--top-accent-height-md)","--behind-accent-height":"12em"}:{"--top-accent-height-sm":"6.25em","--top-accent-height-md":"12.5em","--top-accent-height-lg":"18.75em","--top-accent-height":"var(--top-accent-height-md)","--behind-accent-height":"24em"}),c=n()(e=>{let{isPresentMode:t,isNested:l,isFullBleed:a,displayFullBleed:n,isThumbnail:o,isMobileDevice:r,attrs:s}=e,d="none"!==s.background.type&&!l,u=o?"em":t?"rem":"em",c=n||l?"0px":r?"".concat(i.Hb).concat(u):"".concat(i.YW).concat(u),m="calc(var(--card-outer-padding-x) + ".concat(a||l?"0px":"var(--doc-padding-left, 0px)"," + ").concat(t?"var(--present-padding-left, 0px)":"0px",")"),f="calc(var(--card-outer-padding-x) + ".concat(a||l?"0px":"var(--doc-padding-right, 0px)"," + ").concat(t?"var(--present-padding-right, 0px)":"0px",")");return{outerPaddingX:c,outerPaddingY:n||l?"0px":r?"".concat(i._0/2).concat(u):!d||t||o?"".concat(i.Ri).concat(u):"".concat(i.St).concat(u),outerPaddingLeft:m,outerPaddingRight:f}})},4616:(e,t,l)=>{"use strict";l.d(t,{g:()=>r});var a=l(12327);let n=()=>[{id:"basic",name:()=>a.Ru._({id:"0wJVK+"}),templateIds:["blankCard","titleWith2ColumnImageLeft","titleWith2ColumnImageRight","titleWith2ColumnContent","titleWith2ColumnContentAndHeadings","titleWith3ColumnContent","titleWith3ColumnContentAndHeadings","titleWith4ColumnContent","titleWithBullets","titleWithBulletsAndImage"]},{id:"cardLayouts",name:()=>a.Ru._({id:"125H9i"}),templateIds:["accentLeft","accentRight","accentTop","accentRightFit","accentLeftFit","accentBackground"]},{id:"images",name:()=>a.Ru._({id:"an5hVd"}),templateIds:["titleWith2ImageColumns","titleWith3ImageColumns","titleWith4ImageColumns","titleWith3ImagesWithText","imageGallery","titleWithTeamPhotos"]},{id:"collections",name:()=>a.Ru._({id:"MISW12"}),templateIds:["titleWithTextBoxes","titleWithTimeline","titleWithLargeBulletList","titleWithIconsWithText","titleWithSmallIconsAndText","titleWithArrows"]},{id:"data",name:()=>a.Ru._({id:"+60MiA"}),templateIds:["titleWithColumnChart","titleWithBarChart","titleWithLineChart","titleWithPieChart","titleWithDonutChart","titleWithStats","barStatsWithText","titleWithCircleStats","titleWith3RowTable"]},{id:"embeds",name:()=>a.Ru._({id:"aTofd0"}),templateIds:["titleWithYouTubeEmbed","titleWithWebpageEmbed"]},{id:"progressiveDisclosure",name:()=>a.Ru._({id:"rd7L5e"}),templateIds:["titleWith3NestedCards","titleWith3Toggles"]},{id:"pyramid",name:()=>a.Ru._({id:"96Rp0u"}),templateIds:["funnelWithText","steppedPyramidWithText","pyramidWithTitleAndTextOutside","leftSteppedPyramidWithTitleAndTextOutside"]},{id:"calls-to-action",name:()=>a.Ru._({id:"gm+qKB"}),templateIds:["titleWithContentAndButton"]},{id:"misc",name:()=>a.Ru._({id:"RDie0n"}),templateIds:["titleCard","titleWithGif","titleWithDiagram"]},{id:"cardPlaceholder",name:()=>a.Ru._({id:"hx1ePY"}),templateIds:["titleWith2ColumnImageLeft","titleWith2ColumnContent","accentRight","titleWith3ImageColumns"]}],o=["basic","cardLayouts","images","collections","charts","pyramid","data","embeds","progressiveDisclosure","calls-to-action","misc"],i={default:o,insertWidget:o,modal:o,placeholder:["cardPlaceholder"]},r=e=>i[e].map(e=>n().find(t=>t.id===e)).filter(e=>!!e)},51436:(e,t,l)=>{"use strict";l.d(t,{iT:()=>r,l2:()=>c,s2:()=>d,st:()=>s,wz:()=>u});var a=l(12327),n=l(32899),o=l(4616),i=l(79194);let r=()=>{let e=()=>a.Ru._({id:"6MDj8K"});return{blankCard:{id:"blankCard",createdBy:null,name:()=>a.Ru._({id:"UQOvxZ"}),description:()=>a.Ru._({id:"V7lf6B"}),jsonContent:i.w.card([i.w.heading()]),keywords:["blank"]},titleWithBullets:{id:"titleWithBullets",name:()=>a.Ru._({id:"jzSy62"}),createdBy:null,description:()=>a.Ru._({id:"605WM6"}),jsonContent:i.w.card([i.w.heading(),i.w.bullet(),i.w.bullet(),i.w.bullet(),i.w.bullet()]),keywords:["heading","bullets"]},titleWithBulletsAndImage:{id:"titleWithBulletsAndImage",name:()=>a.Ru._({id:"ciw/iY"}),createdBy:null,description:()=>a.Ru._({id:"kTU/Ne"}),jsonContent:i.w.card([i.w.heading(),i.w.columns([[i.w.bullet(),i.w.bullet(),i.w.bullet(),i.w.bullet()],[i.w.mediaPlaceholder()]])]),keywords:["heading","bullets"]},titleWith2ColumnContent:{id:"titleWith2ColumnContent",createdBy:null,name:()=>a.Ru._({id:"uVQ8y8"}),description:()=>a.Ru._({id:"pRDCBH"}),jsonContent:i.w.card([i.w.heading(),i.w.columns([[i.w.paragraph(e())],[i.w.paragraph(e())]])]),keywords:["title","2 column","split","paragraph"]},titleWith2ColumnContentAndHeadings:{id:"titleWith2ColumnContentAndHeadings",createdBy:null,name:()=>a.Ru._({id:"/ESRO3"}),description:()=>a.Ru._({id:"acTyiC"}),jsonContent:i.w.card([i.w.heading(),i.w.columns([[i.w.h3(),i.w.paragraph(e())],[i.w.h3(),i.w.paragraph(e())]])]),keywords:["title","2 column","split","paragraph"]},titleWith3ColumnContent:{id:"titleWith3ColumnContent",createdBy:null,name:()=>a.Ru._({id:"YmAqYT"}),description:()=>a.Ru._({id:"od0FQb"}),jsonContent:i.w.card([i.w.heading(),i.w.columns([[i.w.paragraph(e())],[i.w.paragraph(e())],[i.w.paragraph(e())]])]),keywords:["heading","3 column","paragraph"]},titleWith3ColumnContentAndHeadings:{id:"titleWith3ColumnContentAndHeadings",createdBy:null,name:()=>a.Ru._({id:"3tQQ39"}),description:()=>a.Ru._({id:"Yno39F"}),jsonContent:i.w.card([i.w.heading(),i.w.columns([[i.w.h4(),i.w.paragraph(e())],[i.w.h4(),i.w.paragraph(e())],[i.w.h4(),i.w.paragraph(e())]])]),keywords:["heading","3 column","paragraph"]},titleWith4ColumnContent:{id:"titleWith4ColumnContent",createdBy:null,name:()=>a.Ru._({id:"+a/yD6"}),description:()=>a.Ru._({id:"h5ySm8"}),jsonContent:i.w.card([i.w.heading(),i.w.columns([[i.w.paragraph(e())],[i.w.paragraph(e())],[i.w.paragraph(e())],[i.w.paragraph(e())]])]),keywords:["heading","4 column","paragraph"]},titleWith2ColumnImageLeft:{id:"titleWith2ColumnImageLeft",createdBy:null,name:()=>a.Ru._({id:"6edF/U"}),description:()=>a.Ru._({id:"SzGG7G"}),jsonContent:i.w.card([i.w.columns([[i.w.mediaPlaceholder()],[i.w.heading(),i.w.paragraph(e())]],{cellAttrs:{verticalAlign:"center"}})]),keywords:["title","2 column","image","left"]},titleWith2ColumnImageRight:{id:"titleWith2ColumnImageRight",createdBy:null,name:()=>a.Ru._({id:"afp0nb"}),description:()=>a.Ru._({id:"M7cuHB"}),jsonContent:i.w.card([i.w.columns([[i.w.heading(),i.w.paragraph(e())],[i.w.mediaPlaceholder()]],{cellAttrs:{verticalAlign:"center"}})]),keywords:["title","2 column","image","right"]},titleWith2ImageColumns:{id:"titleWith2ImageColumns",createdBy:null,name:()=>a.Ru._({id:"oVMU3f"}),description:()=>a.Ru._({id:"sqVSP2"}),jsonContent:i.w.card([i.w.heading(),i.w.columns([[i.w.mediaPlaceholder(),i.w.h3(),i.w.paragraph(e())],[i.w.mediaPlaceholder(),i.w.h3(),i.w.paragraph(e())]])]),keywords:["heading","2 column","image"]},titleWith3ImageColumns:{id:"titleWith3ImageColumns",createdBy:null,name:()=>a.Ru._({id:"ZjjVJt"}),description:()=>a.Ru._({id:"kmtZuD"}),jsonContent:i.w.card([i.w.heading(),i.w.columns([[i.w.mediaPlaceholder(),i.w.h4(),i.w.paragraph(e())],[i.w.mediaPlaceholder(),i.w.h4(),i.w.paragraph(e())],[i.w.mediaPlaceholder(),i.w.h4(),i.w.paragraph(e())]])]),keywords:["heading","3 column","paragraph","image"]},titleWith4ImageColumns:{id:"titleWith4ImageColumns",createdBy:null,name:()=>a.Ru._({id:"Re1S+b"}),description:()=>a.Ru._({id:"+x8oem"}),jsonContent:i.w.card([i.w.heading(),i.w.columns([[i.w.mediaPlaceholder(),i.w.h4(),i.w.paragraph(e())],[i.w.mediaPlaceholder(),i.w.h4(),i.w.paragraph(e())],[i.w.mediaPlaceholder(),i.w.h4(),i.w.paragraph(e())],[i.w.mediaPlaceholder(),i.w.h4(),i.w.paragraph(e())]])]),keywords:["heading","4 column","image"]},titleWith3ImagesWithText:{id:"titleWith3ImagesWithText",createdBy:null,name:()=>a.Ru._({id:"cDxTeG"}),description:()=>a.Ru._({id:"rwJuIz"}),jsonContent:i.w.card([i.w.heading(),i.w.smartLayout("imagesText",[i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())])],{options:{cellSize:10,shapeSize:"full",horizontalAlign:"left",imageShape:"square"}})]),keywords:["heading","image","layout"]},imageGallery:{id:"imageGallery",createdBy:null,name:()=>a.Ru._({id:"Oho0T7"}),description:()=>a.Ru._({id:"H87HG1"}),jsonContent:i.w.card([i.w.heading(),i.w.gallery([i.w.mediaPlaceholder({source:"image.custom"}),i.w.mediaPlaceholder({source:"image.custom"}),i.w.mediaPlaceholder({source:"image.custom"})])]),keywords:["heading","gallery","image"]},titleWithTeamPhotos:{id:"titleWithTeamPhotos",createdBy:null,name:()=>a.Ru._({id:"+kQMBP"}),description:()=>a.Ru._({id:"tt2nIz"}),jsonContent:i.w.card([i.w.heading(),i.w.smartLayout("imagesText",[i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"6YtxFj"})),i.w.paragraph(a.Ru._({id:"GDvlUT"})),i.w.paragraph(a.Ru._({id:"Nu4oKW"}),{fontSize:"sm"})]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"6YtxFj"})),i.w.paragraph(a.Ru._({id:"GDvlUT"})),i.w.paragraph(a.Ru._({id:"Nu4oKW"}),{fontSize:"sm"})]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"6YtxFj"})),i.w.paragraph(a.Ru._({id:"GDvlUT"})),i.w.paragraph(a.Ru._({id:"Nu4oKW"}),{fontSize:"sm"})])],{options:{cellSize:10,shapeSize:"full",horizontalAlign:"center",imageShape:"circle"}})]),keywords:["heading","image","team"]},accentRight:{id:"accentRight",createdBy:null,name:()=>a.Ru._({id:"Czo70+"}),description:()=>a.Ru._({id:"x5nYRE"}),jsonContent:i.w.card([i.w.heading(),i.w.paragraph(e())],{layout:"right"}),keywords:["accent"]},accentRightFit:{id:"accentRightFit",createdBy:null,name:()=>a.Ru._({id:"1BvkHE"}),description:()=>a.Ru._({id:"oItvxV"}),jsonContent:i.w.card([i.w.heading(),i.w.paragraph(e())],{layout:"right"},{fitType:"fit"}),keywords:["accent"]},accentLeft:{id:"accentLeft",createdBy:null,name:()=>a.Ru._({id:"5HMSY5"}),description:()=>a.Ru._({id:"c/I4N2"}),jsonContent:i.w.card([i.w.heading(),i.w.paragraph(e())],{layout:"left"}),keywords:["accent"]},accentLeftFit:{id:"accentLeftFit",createdBy:null,name:()=>a.Ru._({id:"bGTdlK"}),description:()=>a.Ru._({id:"r4fLNa"}),jsonContent:i.w.card([i.w.heading(),i.w.paragraph(e())],{layout:"left"},{fitType:"fit"}),keywords:["accent"]},accentTop:{id:"accentTop",createdBy:null,name:()=>a.Ru._({id:"BUdX7X"}),description:()=>a.Ru._({id:"QuKih6"}),jsonContent:i.w.card([i.w.heading(),i.w.paragraph(e())],{layout:"top"}),keywords:["accent"]},accentBackground:{id:"accentBackground",createdBy:null,name:()=>a.Ru._({id:"CDFCZ5"}),description:()=>a.Ru._({id:"uFWjQ5"}),jsonContent:i.w.card([i.w.heading(),i.w.paragraph(e())],{layout:"behind"}),keywords:["accent"]},titleWith3NestedCards:{id:"titleWith3NestedCards",createdBy:null,name:()=>a.Ru._({id:"ORoO1f"}),description:()=>a.Ru._({id:"J89hiV"}),jsonContent:i.w.card([i.w.heading(),i.w.card([i.w.heading(),i.w.paragraph()]),i.w.card([i.w.heading(),i.w.paragraph()]),i.w.card([i.w.heading(),i.w.paragraph()])]),keywords:["heading","nested","card"]},titleWith3Toggles:{id:"titleWith3Toggles",createdBy:null,name:()=>a.Ru._({id:"Sf3ASu"}),description:()=>a.Ru._({id:"58JI2k"}),jsonContent:i.w.card([i.w.heading(),i.w.toggle([i.w.paragraph(e())]),i.w.toggle([i.w.paragraph(e())]),i.w.toggle([i.w.paragraph(e())])]),keywords:["heading","toggle"]},titleWithTimeline:{id:"titleWithTimeline",createdBy:null,name:()=>a.Ru._({id:"cklVjM"}),description:()=>a.Ru._({id:"Wdyt2J"}),jsonContent:i.w.card([i.w.heading(),i.w.smartLayout("timeline",[i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())])],{options:{orientation:"vertical",twoSided:!1}})]),keywords:["heading","timeline"]},titleWithLargeBulletList:{id:"titleWithLargeBulletList",createdBy:null,name:()=>a.Ru._({id:"F5uDGO"}),description:()=>a.Ru._({id:"g1FTqD"}),jsonContent:i.w.card([i.w.heading(),i.w.smartLayout("bullets",[i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())])],{options:{cellSize:20}})]),keywords:["heading","bullet","list"]},titleWithIconsWithText:{id:"titleWithIconsWithText",createdBy:null,name:()=>a.Ru._({id:"joUkNe"}),description:()=>a.Ru._({id:"DHZYRd"}),jsonContent:i.w.card([i.w.heading(),i.w.smartLayout("iconsText",[i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())])],{options:{cellSize:10,shapeSize:"md",horizontalAlign:"center"}})]),keywords:["heading","icons"]},titleWithSmallIconsAndText:{id:"titleWithSmallIconsAndText",createdBy:null,name:()=>a.Ru._({id:"AhHG+7"}),description:()=>a.Ru._({id:"L8/5yN"}),jsonContent:i.w.card([i.w.heading(),i.w.smartLayout("iconsText",[i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())])],{options:{cellSize:10,shapeSize:"sm",horizontalAlign:"left"}})]),keywords:["heading","icons"]},titleWithTextBoxes:{id:"titleWithTextBoxes",createdBy:null,name:()=>a.Ru._({id:"b7qbjN"}),description:()=>a.Ru._({id:"Cg0xBG"}),jsonContent:i.w.card([i.w.heading(),i.w.smartLayout("textBoxes",[i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())])],{options:{cellSize:15}})]),keywords:["heading","boxes"]},titleWithArrows:{id:"titleWithArrows",createdBy:null,name:()=>a.Ru._({id:"YUGjgn"}),description:()=>a.Ru._({id:"SnGUtD"}),jsonContent:i.w.card([i.w.heading(),i.w.smartLayout("arrows",[i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())]),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())])],{options:{cellSize:10}})]),keywords:["arrows","process","sequence","flow"]},titleWithColumnChart:{id:"titleWithColumnChart",createdBy:null,name:()=>a.Ru._({id:"kaIve5"}),description:()=>a.Ru._({id:"EE/H36"}),jsonContent:i.w.card([i.w.heading(),i.w.columnChart()]),keywords:["heading","chart","column chart"],featureFlag:"enableCharts"},titleWithBarChart:{id:"titleWithBarChart",createdBy:null,name:()=>a.Ru._({id:"JXpNuP"}),description:()=>a.Ru._({id:"2s/J1+"}),jsonContent:i.w.card([i.w.heading(),i.w.barChart()]),keywords:["heading","chart","bar chart"],featureFlag:"enableCharts"},titleWithLineChart:{id:"titleWithLineChart",createdBy:null,name:()=>a.Ru._({id:"Kt/Lzz"}),description:()=>a.Ru._({id:"eRabUB"}),jsonContent:i.w.card([i.w.heading(),i.w.lineChart()]),keywords:["heading","chart","line chart"],featureFlag:"enableCharts"},titleWithPieChart:{id:"titleWithPieChart",createdBy:null,name:()=>a.Ru._({id:"5+y+OQ"}),description:()=>a.Ru._({id:"zIzb1A"}),jsonContent:i.w.card([i.w.heading(),i.w.pieChart()]),keywords:["heading","chart","pie chart"],featureFlag:"enableCharts"},titleWithDonutChart:{id:"titleWithDonutChart",createdBy:null,name:()=>a.Ru._({id:"DNipMm"}),description:()=>a.Ru._({id:"MWtClR"}),jsonContent:i.w.card([i.w.heading(),i.w.donutChart()]),keywords:["heading","chart","donut chart"],featureFlag:"enableCharts"},titleWithStats:{id:"titleWithStats",createdBy:null,name:()=>a.Ru._({id:"w0arAq"}),description:()=>a.Ru._({id:"YEhR/1"}),jsonContent:i.w.card([i.w.heading(),i.w.smartLayout("stats",[i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"nH8BJ4"})),i.w.paragraph(e())],{label:"25%"}),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"nH8BJ4"})),i.w.paragraph(e())],{label:"3/4"}),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"nH8BJ4"})),i.w.paragraph(e())],{label:"50"})],{options:{cellSize:15,shapeSize:"lg"}})]),keywords:["heading","stats"]},barStatsWithText:{id:"barStatsWithText",createdBy:null,name:()=>a.Ru._({id:"LYRXtx"}),description:()=>a.Ru._({id:"DgfiYp"}),jsonContent:i.w.card([i.w.heading(),i.w.smartLayout("barStats",[i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"nH8BJ4"})),i.w.paragraph(e())],{label:"25%"}),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"nH8BJ4"})),i.w.paragraph(e())],{label:"3/4"})],{options:{cellSize:20}})]),keywords:["heading","stats"]},titleWithCircleStats:{id:"titleWithCircleStats",createdBy:null,name:()=>a.Ru._({id:"mvpFPS"}),description:()=>a.Ru._({id:"9AzsRa"}),jsonContent:i.w.card([i.w.heading(),i.w.smartLayout("circleStats",[i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())],{label:"25%"}),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())],{label:"1/3"}),i.w.smartLayoutCell([i.w.h3(a.Ru._({id:"HX5SVx"})),i.w.paragraph(e())],{label:"75"})],{options:{cellSize:10,horizontalAlign:"center"}})]),keywords:["arrows","process","sequence","flow"]},titleWith3RowTable:{id:"titleWith3RowTable",createdBy:null,name:()=>a.Ru._({id:"aDo58o"}),description:()=>a.Ru._({id:"2ZoOCu"}),jsonContent:i.w.card([i.w.heading(),i.w.table([i.w.tableRow([i.w.tableCell([i.w.paragraph()]),i.w.tableCell([i.w.paragraph()]),i.w.tableCell([i.w.paragraph()])]),i.w.tableRow([i.w.tableCell([i.w.paragraph()]),i.w.tableCell([i.w.paragraph()]),i.w.tableCell([i.w.paragraph()])]),i.w.tableRow([i.w.tableCell([i.w.paragraph()]),i.w.tableCell([i.w.paragraph()]),i.w.tableCell([i.w.paragraph()])])])]),keywords:["heading","table"]},funnelWithText:{id:"funnelWithText",createdBy:null,name:()=>a.Ru._({id:"ETqzyH"}),description:()=>a.Ru._({id:"GxaYRj"}),jsonContent:i.w.card([i.w.heading(),i.w.columns([[i.w.smartLayout("funnel",[i.w.smartLayoutCell([i.w.h3()]),i.w.smartLayoutCell([i.w.h3()]),i.w.smartLayoutCell([i.w.h3()]),i.w.smartLayoutCell([i.w.h3()])],{options:{numbered:!0,outsideText:!1}})],[i.w.h2(),i.w.paragraph(e())]],{cellAttrs:{verticalAlign:"center"}})]),keywords:["heading","funnel"]},steppedPyramidWithText:{id:"steppedPyramidWithText",createdBy:null,name:()=>a.Ru._({id:"6xmZsQ"}),description:()=>a.Ru._({id:"GqW7Xg"}),jsonContent:i.w.card([i.w.heading(),i.w.columns([[i.w.smartLayout("staircase",[i.w.smartLayoutCell([i.w.h3()]),i.w.smartLayoutCell([i.w.h3()]),i.w.smartLayoutCell([i.w.h3()]),i.w.smartLayoutCell([i.w.h3()])],{options:{outsideText:!1,horizontalAlign:"center"}})],[i.w.h2(),i.w.paragraph(e())]],{cellAttrs:{verticalAlign:"center"}})]),keywords:["heading","pyramid","stepped","staircase"]},leftSteppedPyramidWithTitleAndTextOutside:{id:"leftSteppedPyramidWithTitleAndTextOutside",createdBy:null,name:()=>a.Ru._({id:"6j13ZR"}),description:()=>a.Ru._({id:"JGF7vo"}),jsonContent:i.w.card([i.w.heading(),i.w.smartLayout("staircase",[i.w.smartLayoutCell([i.w.h3()]),i.w.smartLayoutCell([i.w.h3()]),i.w.smartLayoutCell([i.w.h3()])],{options:{outsideText:!1,horizontalAlign:"left"}})]),keywords:["heading","pyramid","stepped","staircase"]},pyramidWithTitleAndTextOutside:{id:"pyramidWithTitleAndTextOutside",createdBy:null,name:()=>a.Ru._({id:"l1mM+L"}),description:()=>a.Ru._({id:"L0QPEt"}),jsonContent:i.w.card([i.w.heading(),i.w.smartLayout("pyramid",[i.w.smartLayoutCell([i.w.h3()]),i.w.smartLayoutCell([i.w.h3()]),i.w.smartLayoutCell([i.w.h3()])],{options:{numbered:!0,outsideText:!0}})]),keywords:["heading","pyramid"]},titleWithContentAndButton:{id:"titleWithContentAndButton",name:()=>a.Ru._({id:"FJJPAA"}),createdBy:null,description:()=>a.Ru._({id:"itiMvE"}),jsonContent:i.w.card([i.w.heading(),i.w.paragraph(e()),i.w.buttons([i.w.button(a.Ru._({id:"uWe4QF"}),{variant:"solid"}),i.w.button(a.Ru._({id:"zwWKhA"}),{variant:"outline"})])]),keywords:["button","heading","paragraph"]},titleWithYouTubeEmbed:{id:"titleWithYouTubeEmbed",createdBy:null,name:()=>a.Ru._({id:"D1Tqqj"}),description:()=>a.Ru._({id:"s0st+i"}),jsonContent:i.w.card([i.w.heading(),i.w.mediaPlaceholder({source:"video.youtube"})]),keywords:["heading","embed","video"]},titleWithWebpageEmbed:{id:"titleWithWebpageEmbed",createdBy:null,name:()=>a.Ru._({id:"8FOKyw"}),description:()=>a.Ru._({id:"0ngLOJ"}),jsonContent:i.w.card([i.w.heading(),i.w.mediaPlaceholder({source:"embed.custom"})]),keywords:["heading","embed","webpage"]},titleCard:{id:"titleCard",createdBy:null,name:()=>a.Ru._({id:"5U/oBM"}),description:()=>a.Ru._({id:"rYur7N"}),jsonContent:i.w.card([i.w.title(),i.w.h2()]),keywords:["title"]},titleWithGif:{id:"titleWithGif",createdBy:null,name:()=>a.Ru._({id:"wRkP2d"}),description:()=>a.Ru._({id:"kHFDdm"}),jsonContent:i.w.card([i.w.heading(),i.w.mediaPlaceholder({source:"image.giphy"})]),keywords:["heading","embed","webpage"]},titleWithDiagram:{id:"titleWithDiagram",createdBy:null,name:()=>a.Ru._({id:"i+ShMB"}),description:()=>a.Ru._({id:"6i4/hD"}),jsonContent:i.w.card([i.w.heading(),i.w.diagram()]),keywords:["heading","diagram"],featureFlag:"tldraw2"}}},s=()=>Object.values(r()),d=()=>s().reduce((e,t)=>(e[t.id]=t.jsonContent,e),{}),u=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return(0,o.g)(e).map(e=>{let{name:t,templateIds:l}=e,a=l.map(e=>r()[e]);return{subcategory:t(),items:a}})},c=(e,t,l)=>{try{if(t.featureFlag&&!n.of.get(t.featureFlag)||(null==l?void 0:l(t)))return!0;return!1}catch(e){return!0}}},79194:(e,t,l)=>{"use strict";l.d(t,{w:()=>o});var a=l(98757),n=l(75621);let o={heading:(e,t)=>({type:"heading",attrs:{placeholder:e,level:1,...t}}),h2(e){return this.heading(e,{level:2})},h3(e){return this.heading(e,{level:3})},h4(e){return this.heading(e,{level:4})},title:(e,t)=>({type:"title",attrs:{placeholder:e,...t}}),paragraph:(e,t)=>({type:"paragraph",attrs:{placeholder:e,...t}}),bullet:(e,t)=>({type:"bullet",attrs:{placeholder:e,...t}}),toggle(e,t,l){let a=e||[o.paragraph()];return{type:"toggle",content:[{type:"toggleSummary",attrs:{fontSize:"h3",placeholder:t,...l}},...a]}},columns(e,t){let l=(null==t?void 0:t.colAttrs)||{},a=(null==t?void 0:t.cellAttrs)||{};return{type:"gridLayout",attrs:{colWidths:(0,n.I)(e.length),...l},content:e.map(e=>({type:"gridCell",content:e,attrs:a}))}},smartLayout:(e,t,l)=>({type:"smartLayout",attrs:{variantKey:e,...l},content:t}),smartLayoutCell:(e,t)=>({type:"smartLayoutCell",attrs:t,content:e}),mediaPlaceholder:e=>({type:"mediaPlaceholder",attrs:e}),card(e,t,l){let a=e||[o.heading()];return{type:"card",attrs:t,content:[...(null==t?void 0:t.layout)?[{type:"cardAccentLayoutItem",attrs:{itemId:"accent",...l}}]:[],{type:"cardLayoutItem",attrs:{itemId:"body"},content:a}]}},buttons:(e,t)=>({type:"buttonGroup",attrs:t,content:e}),button:(e,t)=>({type:"button",attrs:t,content:[{type:"text",text:e}]}),gallery:(e,t)=>({type:"gallery",attrs:t,content:e||[o.mediaPlaceholder({source:"image.custom"})]}),table:(e,t)=>({type:"table",attrs:{colWidths:(0,n.I)(e.length),...t},content:e}),tableRow:e=>({type:"tableRow",content:e}),tableCell:(e,t)=>({type:"tableCell",content:e,attrs:{colspan:1,rowspan:1,...t}}),diagram:e=>({type:"diagram",attrs:e}),chart(e,t){let{data:l,...n}=t||{},o=l||(0,a.$)(e);return{type:"chart",attrs:{chartType:e,data:o,...n}}},columnChart(e){let{data:t,...l}=e||{},n=t||(0,a.$)("bar");return this.chart("bar",{data:n,...l})},barChart(e){let{data:t,...l}=e||{},n=t||(0,a.$)("horizontal-bar");return this.chart("horizontal-bar",{data:n,...l})},lineChart(e){let{data:t,...l}=e||{},n=t||(0,a.$)("line");return this.chart("line",{data:n,...l})},pieChart(e){let{data:t,...l}=e||{},n=t||(0,a.$)("pie");return this.chart("pie",{data:n,...l})},donutChart(e){let{data:t,...l}=e||{},n=t||(0,a.$)("donut");return this.chart("donut",{data:n,...l})}}},82354:(e,t,l)=>{"use strict";l.d(t,{$x:()=>n,Dt:()=>b,M2:()=>g,OB:()=>i,P:()=>c,QJ:()=>r,Qs:()=>o,WZ:()=>s,_P:()=>u,o5:()=>m,p$:()=>d,vN:()=>f,y0:()=>h});var a=l(73893);let n=2,o="card",i=e=>"*"===e?"[data-card-id]":'[data-card-id="'.concat(e,'"]'),r="card-wrapper",s="card-presenting",d="card-body",u="card-content",c=.5,m=.65,f=1,p="number"==typeof a.$.EDITOR_ANIMATION_DEBUG_FACTOR?a.$.EDITOR_ANIMATION_DEBUG_FACTOR:1,g=225*p,h=200*p,b={default:{duration:h/1e3},x:{type:"spring",duration:h/1e3,bounce:0}}},4381:(e,t,l)=>{"use strict";l.d(t,{a:()=>r});var a=l(88957),n=l(55037),o=l(61690),i=l(14250);let r=e=>{let t=(0,a.GV)(o.SJ),{cardColorOverride:l}=(0,i.tg)(e),{cardColorSolid:r,bodyColorSolid:s,primaryColorSolid:d,isCardDark:u}=(0,n.Dh)(t,l);return{theme:t,isDark:u,cardColor:r,bodyColor:s,primaryColor:d}}},24008:(e,t,l)=>{"use strict";l.d(t,{f:()=>g});var a=l(88957),n=l(82257),o=l(2696),i=l(61690),r=l(14e3),s=l(6157),d=l(51183),u=l(12408),c=l(11576),m=l(14250),f=l(4381),p=l(70395);let g=e=>{var t;let{node:l,decorations:s,editor:g}=e,b=l.attrs,{id:y,previewContent:v}=b,k=(0,o.FX)(),w=(0,n.oR)(),x=g.isThumbnail,S=(0,a.GV)(i.jO),[A,C]=(0,p.E)(y),z=(0,a.GV)(i.mA)?r.w.DOC_PREVIEW:"doc"===A?r.w.DOC_VIEW:r.w.SLIDE_VIEW,I=(0,a.GV)(e=>(0,i.nD)(e,z)),j=z===r.w.SLIDE_VIEW,F=(0,a.GV)(i.eo),B=(0,a.GV)(i.We),R=(0,a.GV)(i.yh),_=(0,a.GV)((0,i.tC)(y)),M=(0,u.Ms)(s),E=(0,a.GV)((0,i.WS)(y)),T=(0,d.A3)(s),{isNested:O,nestedDepth:P,isFirstCard:N,isLastCard:D,inheritContainerWidth:L,displayLayout:W,insideSideLayout:U,cardAccentBackgroundMaskEffect:G,hasLayoutItem:H,hasNonEmptyCardNotes:V}=(0,m.tg)(s),{theme:q,isDark:K}=(0,f.a)(s),{cardDimensions:J,defaultFullBleed:$,defaultContentWidth:Q,presentBackdrop:Y=!1,verticalAlign:X,fontSize:Z,scaleContentToFit:ee}=h(g),et=(0,c.iI)(J),el="default"===b.cardSize?"full"===$:"full"===b.cardSize,ea=b.verticalAlign||X||et.defaultVerticalAlign,en=j&&!O&&!!et.aspectRatio&&!Y,eo=null!==(t=b.container.width)&&void 0!==t?t:L;return{hasNonEmptyCardNotes:V,isCollapsed:E,isEditable:I,isFirstCard:N,isFocused:M,isExpandableSelected:T,isLastCard:D,isLetterboxed:en,isMobileDevice:k,isNested:O,isPresenting:"doc"!==A&&"presentCollapsed"!==A,isPresentingCurrent:"presentCurrent"===A,isPresentingParent:"presentParent"===A,isPresentMode:j,isPublished:w,isStatic:S,isDark:K,isThumbnail:x,mode:z,nestedDepth:P,presentVariant:A,prevPresentVariant:C,previewContent:v,theme:q,attrs:b,cardId:y,isFullBleed:el,displayFullBleed:x||!O&&(el||j&&!Y),defaultContentWidth:Q,contentWidth:eo,verticalAlign:ea,isWideContent:(null!=eo?eo:Q)==="lg",displayLayout:W,insideSideLayout:U,cardAccentBackgroundMaskEffect:G,cardDimensions:et,cardDimensionsKey:J,showPresentBackdrop:Y,hasLayoutItem:H,userZoomLevel:F,docZoomLevel:B,fontSize:Z,docZoomToFit:R,scaleContentToFit:ee,isCommentOpenOnCard:_}},h=e=>{let t=(0,a.GV)(i.Uu);if(e.isStatic)try{return(0,s.lI)(e).settings}catch(e){console.error("[caught] useDocSettings: ".concat(e))}return t}},70395:(e,t,l)=>{"use strict";l.d(t,{E:()=>d});var a=l(14041),n=l(65998),o=l(88957),i=l(61690),r=l(14e3),s=l(69646);l(82354);let d=e=>{let t=(0,a.useRef)("doc"),l=(0,o.CU)(),d=(0,o.GV)(l=>{let a=(0,i.$i)(l)||"",o=(0,i.Ev)(l),s=(0,i.bO)(l),d=(0,i.wC)(l),u=o.parents[a]||[],c=u.reduce((e,t)=>e[t],o.tree),m=s.includes(a),f=d===r.w.SLIDE_VIEW;if(f&&!m||!f&&m)return t.current;if(!f&&!m)return"doc";let p=s.filter(e=>c[e]),g=e=>c[e]?p.indexOf(e)-p.indexOf(a):1/0,h=g(e),b=u.indexOf(e)>-1,y=p.some(t=>c[t][e]&&1>=Math.abs(g(t))),v=a===e,k=n.of.get("presentModeFlat"),w=o.parents[e];if(!w)return t.current;let x=w.includes(a);return y||k&&x?"presentCollapsed":b?"presentParent":v?"presentCurrent":-1===h?"presentPrev":1===h?"presentNext":"doc"});return(0,a.useEffect)(()=>{t.current=d;let a=l.getState();if((0,i.e4)(a))return;let o=n.of.get("presentModeFlat");"presentCollapsed"!==d||o?["presentParent","presentCurrent","presentPrev","presentNext"].includes(d)&&(0,s.wE)(e,!1):(0,s.wE)(e,!0)},[l,d,e]),[d,t.current]}},77646:(e,t,l)=>{"use strict";l.d(t,{Oq:()=>c,Py:()=>u,W0:()=>d,aJ:()=>f,dT:()=>s,jg:()=>i,kj:()=>m,sw:()=>r});var a=l(13236),n=l(95580);l(32570);var o=l(82354);let i=e=>e.type.name===o.Qs,r=e=>"cardLayoutItem"===e.type.name||"cardAccentLayoutItem"===e.type.name,s=e=>(0,n.GY)(e,r).map(e=>e.node),d=(e,t)=>{if(!t)return null;let l=(0,a.xe)(e.state.doc,e=>i(e)&&e.attrs.id===t);return l.length?l[0]:null},u=e=>e?e.querySelector("[data-card-id] > div"):null,c=(e,t)=>{let l=e.state.doc.nodeAt(t),n=e.state.doc.resolve(t);return l&&i(l)?{node:l,pos:t,start:n.start,depth:n.depth}:(0,a.eL)(e.state.doc.resolve(t),i)},m=(e,t)=>{var l;return null===(l=e.find(e=>void 0!==e.attrs.container[t]))||void 0===l?void 0:l.attrs.container[t]},f=e=>{let t=e.firstChild;return t?(0,n.GY)(t,e=>i(e)).map(e=>({...e,pos:e.pos+1})):null}},83272:(e,t,l)=>{"use strict";l.d(t,{z:()=>G});var a=l(31085),n=l(35687),o=l(74727),i=l(9021),r=l(59835),s=l(70323),d=l(25420),u=l(80853),c=l(20501),m=l(24221),f=l(95986),p=l(52177),g=l(12327),h=l(84511),b=l(65998),y=l(59392),v=l(95905),k=l(62313),w=l(61778),x=l(18201),S=l(80532);let A=e=>{let{label:t,control:l,icon:n}=e;return(0,a.jsxs)(k.z,{spacing:4,children:[n,(0,a.jsx)(w.E,{children:t}),(0,a.jsx)(x.h,{}),(0,a.jsx)(S.az,{children:l})]})};function C(e,t){return function(l,a,n){var o;return t({chartAttributes:{...n,[e]:{...null!==(o=n[e])&&void 0!==o?o:{},[l]:a}}})}}let z=e=>{var t;let{chartType:l,attributes:n,updateAttributes:o}=e,i=n.chartAttributes||{},s=i[l],d=C(l,o);return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(A,{label:g.Ru._({id:"Y7a6MU"}),control:(0,a.jsx)(r.d,{isChecked:null===(t=null==s?void 0:s.axisPullToZero)||void 0===t||t,onChange:e=>d("axisPullToZero",e.target.checked,i)})})})},I=e=>{let{chartType:t="bar",...l}=e;return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(z,{chartType:t,...l})})};var j=l(11718),F=l(63341),B=l(18528),R=l(72821),_=l(48310),M=l(33473);let E=e=>{var t;let{attributes:l,updateAttributes:n}=e,o=l.chartAttributes||{},i=o.pie||{},r=C("pie",n),s=null!==(t=i.legendPosition)&&void 0!==t?t:"bottom",d={top:g.Ru._({id:"WWy8TN"}),right:g.Ru._({id:"nOPbWJ"}),bottom:g.Ru._({id:"zsiX7I"}),left:g.Ru._({id:"UlKSMd"})},c=e=>void 0===d[e]?"bottom":e;return(0,a.jsx)(A,{label:g.Ru._({id:"G4H8LE"}),control:(0,a.jsxs)(F.W,{isLazy:!0,children:[(0,a.jsx)(B.I,{as:u.$,variant:"plain",size:"sm",w:40,boxShadow:"none",textAlign:"left",rightIcon:(0,a.jsx)(j.D,{}),sx:{"span:first-of-type":{overflow:"clip",textOverflow:"ellipsis"}},children:d[s]}),(0,a.jsx)(R.c,{zIndex:"modalPopover",children:(0,a.jsx)(_.i,{value:s,type:"radio",onChange:e=>{r("legendPosition",c(Array.isArray(e)?e[0]:e),o)},children:Object.entries(d).map(e=>{let[t,l]=e;return(0,a.jsx)(M.k,{value:t,children:(0,a.jsx)(k.z,{children:(0,a.jsx)(w.E,{children:l})})},t)})})})]})})},T={pie:E,donut:E,line:e=>{let{...t}=e;return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(z,{chartType:"line",...t})})},bar:I,"horizontal-bar":e=>(0,a.jsx)(I,{...e,chartType:"horizontal-bar"})};var O=l(14041),P=l(1602),N=l.n(P),D=l(96362),L=l(57799);let W=e=>{let{accentColor:t,selected:l,onChange:n,steps:o=5}=e,i=Array(o).fill(0).map((e,t)=>t),r=(0,O.useMemo)(()=>Object.fromEntries(Object.entries(h.fA).map(e=>{let[l,{label:a}]=e;return[l,{label:a,scale:(0,D.M)(t,i,l)}]})),[t,o]);l&&!r[l]&&(l=void 0);let s=g.Ru._({id:"ovBPCi"});return(0,a.jsx)(A,{icon:(0,a.jsx)(m.g,{icon:c.wIs}),label:g.Ru._({id:"tvmuQ0"}),control:(0,a.jsxs)(F.W,{isLazy:!0,children:[(0,a.jsx)(B.I,{as:u.$,variant:"plain",size:"sm",w:40,boxShadow:"none",textAlign:"left",rightIcon:(0,a.jsx)(j.D,{}),sx:{"span:first-of-type":{overflow:"clip",textOverflow:"ellipsis"}},children:l?r[l].label():s}),(0,a.jsx)(R.c,{zIndex:"modalPopover",children:(0,a.jsx)(_.i,{value:l||"default",type:"radio",onChange:e=>{n("default"===e?void 0:e)},children:Object.entries({default:{...r[h.gb],label:()=>s},...r}).map(e=>{let[n,{label:o,scale:r}]=e;return 1.5>[...r.values()].map(e=>N().readability(e,t)).reduce((e,t)=>Math.max(e,t),0)&&n!==l?null:(0,a.jsx)(M.k,{value:n,children:(0,a.jsxs)(k.z,{children:[(0,a.jsx)(w.E,{children:o()}),(0,a.jsx)(x.h,{}),(0,a.jsx)(U,{scale:r,data:i})]})},n)})})})]})})},U=e=>{let{scale:t,data:l}=e;return(0,a.jsx)(k.z,{spacing:1,children:l.map(e=>(0,a.jsx)(L.V,{color:t.get(e),size:L.E.small,tooltipIsDisabled:!0},e))})},G=e=>{let{attributes:t,updateAttributes:l,accentColor:k,setEditing:w,editor:x}=e,S=T[t.chartType],{data:C}=t,z=(0,b.u)("chartInlineLabels");return(0,a.jsxs)(n.B,{spacing:0,children:[(0,a.jsxs)(n.B,{spacing:4,p:4,children:[(0,a.jsx)(o.e,{mb:2,children:Object.entries(h.XD).map(e=>{let[n,{icon:o,selectedIcon:r,label:s}]=e,d=t.chartType===n;return(0,a.jsx)(f.Tz,{placement:"top",label:s(),children:(0,a.jsx)(i.K,{"aria-label":s(),flex:1,variant:"plain",size:"md",icon:d?r:o,boxShadow:"none",background:d?"trueblue.50":"white",color:d?"trueblue.400":"gray.600",onClick:()=>l({chartType:n})})},"".concat(s()))})}),(0,a.jsx)(W,{accentColor:k,selected:t.colorScheme,steps:5,onChange:e=>{l({colorScheme:e})}}),(0,a.jsx)(A,{icon:(0,a.jsx)(m.g,{icon:c.n2$}),label:g.Ru._({id:"sgzcYD"}),control:(0,a.jsx)(r.d,{isChecked:!t.hideLabels,onChange:e=>l({hideLabels:!e.target.checked})})}),z&&(0,a.jsx)(A,{icon:(0,a.jsx)(m.g,{icon:c.jon}),label:g.Ru._({id:"hw0byi"}),control:(0,a.jsx)(r.d,{isChecked:t.showInlineLabels,onChange:e=>l({showInlineLabels:e.target.checked})})}),x&&(0,a.jsx)(A,{icon:(0,a.jsx)(m.g,{icon:c.ecg}),label:g.Ru._({id:"0j+RGO"}),control:(0,a.jsx)(o.e,{dir:"ltr",spacing:1,size:"sm",children:v.gj.map(e=>{let{name:t,icon:l,checkActive:n,apply:o}=e;if(n&&o)return(0,a.jsx)(y.I,{label:t(),icon:l,onClick:()=>{o(x)},isActive:n(x),my:0},t())})})}),S&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(s.c,{my:3}),(0,a.jsx)(S,{...e})]})]}),w&&(0,a.jsx)(d.s,{px:5,py:3,bg:"gray.100",alignItems:"center",justify:"center",children:(0,a.jsx)(u.$,{variant:"link",size:"sm",colorScheme:"gray",my:0,leftIcon:(0,a.jsx)(m.g,{icon:c.MT7}),onClick:()=>w(!0),children:C?(0,a.jsx)(p.x6,{id:"BhcOHV"}):(0,a.jsx)(p.x6,{id:"UHoZ5e"})})})]})}},98757:(e,t,l)=>{"use strict";l.d(t,{$:()=>o});var a=l(12327),n=l(50885);let o=e=>{let t={bar:{rows:[{id:"nFhPL"},{id:"y1R2-"},{id:"3r4Ua"},{id:"MSE5x"},{id:"FcqdP"}],columns:[{id:"mX0nZ",type:"label",label:a.Ru._({id:"EWo9RV"}),format:"raw"},{id:"BOdWT",type:"data",label:a.Ru._({id:"VbWX2u"}),format:"raw"}],cells:{nFhPL:{mX0nZ:{type:"label",label:a.Ru._({id:"lOahyi"})},BOdWT:{isEmpty:!1,type:"data",data:45}},"y1R2-":{mX0nZ:{type:"label",label:a.Ru._({id:"j1OP+i"})},BOdWT:{isEmpty:!1,type:"data",data:60}},"3r4Ua":{mX0nZ:{type:"label",label:a.Ru._({id:"/9w9pX"})},BOdWT:{isEmpty:!1,type:"data",data:40}},MSE5x:{mX0nZ:{type:"label",label:a.Ru._({id:"o/x3y/"})},BOdWT:{isEmpty:!1,type:"data",data:25}},FcqdP:{mX0nZ:{type:"label",label:a.Ru._({id:"ubsult"})},BOdWT:{isEmpty:!1,type:"data",data:35}}}},"horizontal-bar":{rows:[{id:"1I_TU"},{id:"20qEC"},{id:"5Jsuy"},{id:"hzkOo"},{id:"ULLT1"},{id:"BZInJ"}],columns:[{id:"oJsDt",type:"label",label:a.Ru._({id:"XbvKCP"}),format:"raw"},{id:"V-dVk",type:"data",label:a.Ru._({id:"pzRr22"}),format:"raw"}],cells:{"1I_TU":{oJsDt:{type:"label",label:a.Ru._({id:"RBu6h+"})},"V-dVk":{isEmpty:!1,type:"data",data:4e3}},"20qEC":{oJsDt:{type:"label",label:a.Ru._({id:"OwYxvS"})},"V-dVk":{isEmpty:!1,type:"data",data:2500}},"5Jsuy":{oJsDt:{type:"label",label:a.Ru._({id:"fZmoQy"})},"V-dVk":{isEmpty:!1,type:"data",data:2e3}},hzkOo:{oJsDt:{type:"label",label:a.Ru._({id:"7wOL0x"})},"V-dVk":{isEmpty:!1,type:"data",data:1500}},ULLT1:{oJsDt:{type:"label",label:a.Ru._({id:"8Dlczv"})},"V-dVk":{isEmpty:!1,type:"data",data:1200}},BZInJ:{oJsDt:{type:"label",label:a.Ru._({id:"nhrYIN"})},"V-dVk":{isEmpty:!1,type:"data",data:900}}}},line:{rows:[{id:"7qjO7"},{id:"pUSEi"},{id:"Zu-WJ"},{id:"sXcmX"}],columns:[{id:"Ig69-",type:"label",label:a.Ru._({id:"2vudsu"}),format:"raw"},{id:"5L4m1",type:"data",label:a.Ru._({id:"pzRr22"}),format:"raw"}],cells:{"7qjO7":{"Ig69-":{type:"label",label:a.Ru._({id:"i+odAu"})},"5L4m1":{isEmpty:!1,type:"data",data:220}},pUSEi:{"Ig69-":{type:"label",label:a.Ru._({id:"K6Dm4P"})},"5L4m1":{isEmpty:!1,type:"data",data:458}},"Zu-WJ":{"Ig69-":{type:"label",label:a.Ru._({id:"KHx01x"})},"5L4m1":{isEmpty:!1,type:"data",data:359}},sXcmX:{"Ig69-":{type:"label",label:a.Ru._({id:"quAHHk"})},"5L4m1":{isEmpty:!1,type:"data",data:500}}}},pie:{rows:[{id:"O-_SP"},{id:"WDnaO"},{id:"b3NQG"}],columns:[{id:"LyrdY",type:"label",label:a.Ru._({id:"+zy2Nq"}),format:"raw"},{id:"nKpLt",type:"data",label:a.Ru._({id:"wBMjJ2"}),format:"raw"}],cells:{"O-_SP":{LyrdY:{type:"label",label:a.Ru._({id:"QsDjlD"})},nKpLt:{isEmpty:!1,type:"data",data:7}},WDnaO:{LyrdY:{type:"label",label:a.Ru._({id:"dv/+ow"})},nKpLt:{isEmpty:!1,type:"data",data:5}},b3NQG:{LyrdY:{type:"label",label:a.Ru._({id:"DOTf1E"})},nKpLt:{isEmpty:!1,type:"data",data:3}}}},donut:{rows:[{id:"4ZhNy"},{id:"wPMNK"},{id:"rQ2Pv"}],columns:[{id:"GzvxQ",type:"label",label:a.Ru._({id:"kpSWBA"}),format:"raw"},{id:"mznT3",type:"data",label:a.Ru._({id:"wBMjJ2"}),format:"raw"}],cells:{"4ZhNy":{GzvxQ:{type:"label",label:a.Ru._({id:"dCeEtx"})},mznT3:{isEmpty:!1,type:"data",data:7}},wPMNK:{GzvxQ:{type:"label",label:a.Ru._({id:"IMSFDD"})},mznT3:{isEmpty:!1,type:"data",data:12}},rQ2Pv:{GzvxQ:{type:"label",label:a.Ru._({id:"Cj3qRS"})},mznT3:{isEmpty:!1,type:"data",data:11}}}}},l=n.A.parse(t[e]).clone();return n.A.serialize(l)}},1279:(e,t,l)=>{"use strict";l.d(t,{H:()=>o,j:()=>i});var a=l(81570),n=l(68566);function o(e){return 0==e.openStart&&0==e.openEnd&&1==e.content.childCount?e.content.firstChild:null}let i=(e,t,l)=>{if(!l)return!0;let i=o(l),r=i&&e.state.selection instanceof a.nh,s=i?e.state.tr.replaceSelectionWith(i,e.input.shiftKey):e.state.tr.replaceSelection(l),d=(0,n.i)(s);return d?s.setSelection(d):r&&s.setSelection(a.nh.create(s.doc,e.state.selection.from)),e.dispatch(s.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}},82064:(e,t,l)=>{"use strict";l.d(t,{h:()=>a});let a=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[].slice.call(e.querySelectorAll(t),0);return l&&a.reverse(),a}},1712:(e,t,l)=>{"use strict";l.d(t,{Mu:()=>f,kf:()=>g,tE:()=>p});var a=l(13236),n=l(14139),o=l(81570),i=l(95580),r=l(77214),s=l(92405),d=l(68566),u=l(37672),c=l(67408);let m=e=>"gallery"===e.type.name,f=(e,t,l)=>{var u;let f=b(l);if(f.length>0)return f.forEach(t=>{let{mark:l}=t;(0,c.E0)(l)||(0,c.uI)(l.attrs.href,e)}),!1;let g=null===(u=t.clipboardData)||void 0===u?void 0:u.getData("text/plain");if(!g||!p(g))return!1;let{selection:y}=e.state;if(y instanceof o.U3&&!y.empty)return t.preventDefault(),h(e,g),!0;if(g.match(s.D_)||(0,r.Zj)(g))return!1;if(!e.schema.nodes.embed)return(0,c.uI)(g,e),!1;let v=y instanceof n.n,k=y.empty&&["paragraph","heading","title"].includes(y.$from.parent.type.name)&&(0,i.Op)(y.$from.parent),w=m(y.$from.parent),x=(0,a.BQ)(y)&&m(y.node);if(!(k||w||x||v))return!1;let S=y.from-1,A=x?{from:y.to-1,to:y.to-1}:k?{from:S,to:S+y.$from.parent.nodeSize}:{from:y.from,to:y.to};return e.chain().setTextSelection(A).insertEmbedAndFetchMetadata(g,void 0,!0).command(e=>{let{tr:t}=e,l=(0,d.i)(t);return l&&t.setSelection(l),!0}).run(),!0},p=e=>(0,r.Se)(e)&&!e.includes("\n")&&(0,r.AY)(e),g=e=>1===e.content.childCount&&e.content.firstChild.isTextblock&&p(e.content.firstChild.textContent),h=(e,t)=>{e.commands.setMark(u.N.name,{href:t}),(0,c.uI)(t,e)},b=e=>{let t=[];return e.content.descendants((e,l)=>{e.marks.filter(e=>"link"===e.type.name).forEach(e=>{t.push({mark:e,pos:l})})}),t}},96361:(e,t,l)=>{"use strict";l.d(t,{N:()=>i,j:()=>o});var a=l(60443),n=l(3968);let o=e=>{var t;if(null==e?void 0:null===(t=e.parentElement)||void 0===t?void 0:t.matches("ol, ul"))return e.parentElement;let l=[e],n=e;for(;(n=n.nextElementSibling)&&"LI"===n.tagName;){let t=parseInt(n.getAttribute("indent")||"0")-parseInt(e.getAttribute("indent")||"0");if(t<0)break;if(0==t){if(n.getAttribute("variant")!=e.getAttribute("variant"))break;l.push(n)}else n=o(n),l.push(n)}let i=e.getAttribute("variant")==a.e.Numbered?document.createElement("ol"):document.createElement("ul");return e.replaceWith(i),l.forEach(e=>{e.removeAttribute("variant"),e.removeAttribute("indent")}),i.append(...l),i},i=e=>{var t,l;let o;let i=e,r=0,s="false";for(e.innerHTML.startsWith("[ ]")?(o=a.e.Todo,s="false",e.innerHTML.startsWith("[ ] ")?e.innerHTML=e.innerHTML.slice(4):e.innerHTML=e.innerHTML.slice(3)):e.innerHTML.startsWith("[x]")&&(o=a.e.Todo,s="true",e.innerHTML.startsWith("[x] ")?e.innerHTML=e.innerHTML.slice(4):e.innerHTML=e.innerHTML.slice(3)),"checkbox"===e.getAttribute("role")&&(o=a.e.Todo,s=e.getAttribute("aria-checked")||"false"),("todo"===e.getAttribute("variant")||e.getAttribute("checked"))&&(o=a.e.Todo,s=e.getAttribute("checked")||"false"),(0,n.r)(e);i=null===(t=e.parentElement)||void 0===t?void 0:t.closest("li, ul, ol");){if(i.matches("ul, ol")){r++;let e=i.className.match(/lst-kix_\w+-(\d+)/);e&&(r=parseInt(e[1])+1);let t=i.getAttribute("indent");t&&(r=parseInt(t,10)+1),o||"OL"!=i.tagName?o||"UL"!=i.tagName||(o=a.e.Bullet):o=a.e.Numbered}i.after(e)}e.setAttribute("indent",Math.max(r-1,0).toString()),e.setAttribute("variant",o||a.e.Bullet),o==a.e.Todo&&e.setAttribute("checked",s),1===e.children.length&&(null===(l=e.firstElementChild)||void 0===l?void 0:l.tagName)==="P"&&(e.innerHTML=e.firstElementChild.innerHTML),e.querySelectorAll('span[class^="ListLabel_"]').forEach(e=>{e.remove()})}},65208:(e,t,l)=>{"use strict";l.d(t,{S:()=>i});var a=l(69e3),n=l(95204),o=l(3968);let i=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=(0,o.V)(e),s=new DOMParser().parseFromString(r,"text/html"),d=a.S4.fromSchema(t).parseSlice(s,{preserveWhitespace:i}),u=(0,n.o$)(d,t,l);return{content:u.content,dom:s.body,slice:u}}},57215:(e,t,l)=>{"use strict";l.d(t,{H:()=>o});var a=l(82064),n=l(96361);let o=e=>((0,a.h)(e,"li").forEach(e=>{(0,n.j)(e)}),e)},95204:(e,t,l)=>{"use strict";l.d(t,{o$:()=>p});var a=l(69e3),n=l(52609),o=l(63280);let i=e=>{if((0,n.Gm)()&&e&&0!==e.length)for(let t=0;t{if("text"===e.type){if(!e.text)return;let{replaced:a,nodes:n}=(0,o.Z)(e.text,e.marks);a&&t.splice(l,1,...n);return}if(e.content&&e.content.length>0)for(let t=0;t{let l={type:"document",content:[]},a=(e,t)=>{var a,n;let o=l;for(let e=0;eo?(n+=1,o=e):e1&&!t.nested){o=1,a(r,n=1);continue}a({type:"card",content:[]},(n=d()(n,1,3))-1)}else if(t.splitOnDividers&&"divider"===r.type){a({type:"card",content:[]},n-1);continue}a(r,n)}let r=c()(f(l));return console.debug("splitCards",l,r),r},f=e=>{var t;return(null===(t=e.content)||void 0===t?void 0:t.every(e=>"card"===e.type))?c()(e.content.map(f)):[e]},p=(e,t,l)=>{var n;let o=null===(n=e.toJSON())||void 0===n?void 0:n.content;if(i(o),!o||0===o.length||1===o.length&&("document"===o[0].type||"card"===o[0].type))return e;if(o.every(e=>t.nodes[e.type].isInline))return a.Ji.fromJSON(t,{...e,content:o});try{return o=h(o,t),o=g(o),l&&(o=m(o,l)),a.Ji.fromJSON(t,{...e,content:o})}catch(t){return console.error("Error transforming slice",t),e}},g=e=>{let t=[...e];return e.forEach((l,a)=>{var n;if(a<1)return;let o=e[a-1];if(o.type!==l.type||!o.content)return;let i=null===(n=l.content)||void 0===n?void 0:n[0];i&&"footnote"===i.type&&(o.content=o.content.concat(l.content),t[a]=null)}),t.filter(e=>null!==e)},h=(e,t)=>{let l=[];return e.forEach(e=>{var a,n;if(e.type){if(null===(a=t.nodes[e.type])||void 0===a?void 0:a.isBlock)l.push(e);else{let a=l[l.length-1];if(!a||!a.content||!t.nodes[a.type].isTextblock||"text"===e.type&&(null===(n=e.text)||void 0===n?void 0:n.trim())==="")return;a.content.push(e)}}}),l}},3968:(e,t,l)=>{"use strict";l.d(t,{r:()=>w,V:()=>v});var a=l(60948),n=l(17539),o=l(82064);let i=e=>{(0,o.h)(e,"p.title").forEach(c),(0,o.h)(e,"br").forEach(u),(0,o.h)(e,"a[href]").forEach(f),(0,o.h)(e,"a[href][id]").forEach(p),(0,o.h)(e,"span").forEach(g),(0,o.h)(e,"a[href][id]").forEach(t=>b(t,e))},r=e=>{(0,o.h)(e,"h1").forEach(s),(0,o.h)(e,"li > span").forEach(d)},s=e=>{if("always"==e.style.pageBreakBefore){let t=document.createElement("hr");t.style.pageBreakBefore="always",t.classList.add("divider"),e.before(t)}},d=e=>{var t;(null===(t=e.textContent)||void 0===t?void 0:t.trim())==="•"&&e.remove()},u=e=>{var t;((null===(t=e.previousElementSibling)||void 0===t?void 0:t.tagName)=="P"||e.classList.contains("Apple-interchange-newline"))&&e.remove()},c=e=>{let t=document.createElement("h1");t.className="title",t.innerHTML=e.innerHTML,e.replaceWith(t)},m=/^https:\/\/docs\.google\.com\/document\/d\/[^/]+\/edit#heading=(h\.[^/]+)/,f=e=>{let t=e.getAttribute("href");if(t&&(t.startsWith("#h.")||m.test(t))){let t=e.closest("p");t&&t.textContent==e.textContent?t.remove():e.removeAttribute("href")}},p=e=>{var t,l;if(null===(t=e.getAttribute("id"))||void 0===t?void 0:t.startsWith("cmnt_ref")){let t=e.closest("sup");null==t||t.remove()}else if(null===(l=e.getAttribute("id"))||void 0===l?void 0:l.startsWith("cmnt")){let t=e.closest("div");null==t||t.remove()}},g=e=>{e.innerHTML=e.innerHTML.replace(/( ){2,}/g,"").replace(/ /g," ")},h=/ftnt_ref(\d+)/,b=(e,t)=>{let l=e.getAttribute("id");if(l&&l.startsWith("ftnt_ref")){var a;let n=parseInt((null===(a=l.match(h))||void 0===a?void 0:a[1])||""),o=e.closest("sup"),i=t.querySelector("#ftnt".concat(n)),r=null==i?void 0:i.closest("div");if(!n||!o||!r)return;null==i||i.remove();let s=document.createElement("div");s.className="imported-footnote",s.appendChild(r),o.replaceWith(s)}};var y=l(96361);let v=e=>{try{let t=new DOMParser().parseFromString(e,"text/html");return(0,o.h)(t,k).forEach(w),(0,o.h)(t,"li",!0).forEach(y.N),(0,o.h)(t,"img").forEach(x),(0,o.h)(t,"img").forEach(A),(0,o.h)(t,"script, style").forEach(e=>e.remove()),r(t),i(t),(0,o.h)(t,"p").forEach(S),t.body.innerHTML}catch(t){return console.error("Error transforming pasted HTML",t),e}},k="p, h1, h2, h3, h4, h5, h6",w=e=>{e.querySelectorAll(k).forEach(e=>{if(e.tagName.match(/H\d/)){let t=document.createElement("b");t.innerHTML=e.innerHTML,e.replaceWith(t)}e.replaceWith(...e.childNodes)})},x=e=>{let t=e.closest("p, h1, h2, h3, h4, h5, h6, ul, ol, li");t&&t.after(e)},S=e=>{if((0,a.qQ)(e)){var t;(null===(t=e.parentElement)||void 0===t?void 0:t.childElementCount)!==1&&e.remove()}},A=e=>{if(e.src){if(e.src.startsWith("data:")){let t=(0,n.Xz)(e.src),l=URL.createObjectURL(t);e.src=l}else e.src.startsWith("blob:")||e.src.startsWith("http")||e.remove()}}},60948:(e,t,l)=>{"use strict";l.d(t,{$R:()=>s,qQ:()=>r,t8:()=>o});var a=l(69e3),n=l(57215);let o=(e,t,l)=>{null!=l||(l=a.ZF.fromSchema(t));let o=l.serializeFragment(e);return(0,n.H)(o)},i=["img"],r=e=>{var t;return!e.hasChildNodes()||!((null===(t=e.textContent)||void 0===t?void 0:t.trim())!=""||i.includes(e.nodeName))&&[...e.childNodes].every(e=>r(e))},s=(e,t,l)=>{let a=o(e,t,l),n=document.createElement("div");return n.appendChild(a),n.innerHTML}},20379:(e,t,l)=>{"use strict";l.d(t,{e:()=>n});let a={cardLayoutsEnabled:!1},n=e=>{if(!e)return{...a};let t=null;return("doc"===e.type.name?t=e.nodeAt(0):"document"===e.type.name&&(t=e),t)?{...a,...t.attrs.docFlags}:(console.debug("[getDocFlags] could not find document node, returning defaults"),{...a})}},69771:(e,t,l)=>{"use strict";l.d(t,{T:()=>u,U:()=>d});var a=l(13236),n=l(81570),o=l(46343),i=l.n(o),r=l(61690);class s{compute(e){let t=e.firstChild;if(!t)return this;let l=t.attrs;return i()(l,this.value)||(this.hasChanges=!0),this.value=l,this}apply(e,t){return e.docChanged&&this.compute(e.doc),this}processChanges(e){this.hasChanges&&this.value&&e((0,r.H3)({docAttrs:this.value})),this.hasChanges=!1}constructor(){this.hasChanges=!1,this.value=null}}let d=new n.hs("documentAttrs"),u=a.YY.create({name:"documentAttrs",addProseMirrorPlugins:()=>[new n.k_({key:d,state:{init:()=>new s,apply:(e,t,l,a)=>t.apply(e,a)}})]})},58335:(e,t,l)=>{"use strict";l.d(t,{C:()=>a});let a={aiOptions:{imageOptions:{}},docId:null,background:l(11081).SS,format:null,docFlags:{},customCode:{},settings:{},generateStatus:null,generateInfo:{}}},6157:(e,t,l)=>{"use strict";l.d(t,{lI:()=>s,zK:()=>d,i4:()=>p,Sm:()=>m});var a=l(65998),n=l(20501),o=l(12327);let i={deck_default:{label:()=>o.Ru._({id:"ovBPCi"}),formatType:"deck",cardDimensionsDesc:()=>o.Ru._({id:"f5YDMB"}),recommendedFor:()=>o.Ru._({id:"S/rCId"}),icon:n.NPP,docSettings:()=>({stylesDerivedFrom:"deck_default",cardDimensions:"fluid",verticalAlign:"center",defaultFullBleed:"contained",defaultContentWidth:"lg",fontSize:"md",scaleContentToFit:!1})},deck_traditional:{label:()=>o.Ru._({id:"064GKQ"}),formatType:"deck",cardDimensionsDesc:()=>"16:9",recommendedFor:()=>o.Ru._({id:"Pbe2bO"}),icon:n.Cpz,docSettings:()=>({stylesDerivedFrom:"deck_traditional",cardDimensions:"16x9",verticalAlign:"center",defaultFullBleed:"contained",defaultContentWidth:"lg",fontSize:"md",scaleContentToFit:a.of.get("scalePresentationsToFit")})},deck_tall:{label:()=>o.Ru._({id:"HF6Iah"}),formatType:"deck",cardDimensionsDesc:()=>"4:3",recommendedFor:()=>o.Ru._({id:"zIXNPy"}),icon:n.vti,docSettings:()=>({stylesDerivedFrom:"deck_tall",cardDimensions:"4:3",verticalAlign:"center",defaultFullBleed:"contained",defaultContentWidth:"lg",fontSize:"md",scaleContentToFit:a.of.get("scalePresentationsToFit")})},document_default:{label:()=>o.Ru._({id:"ovBPCi"}),formatType:"document",cardDimensionsDesc:()=>o.Ru._({id:"f5YDMB"}),recommendedFor:()=>o.Ru._({id:"51gKC2"}),icon:n.NPP,docSettings:()=>({stylesDerivedFrom:"document_default",cardDimensions:"fluid",verticalAlign:"center",defaultFullBleed:"contained",defaultContentWidth:"md",fontSize:"md",scaleContentToFit:!1})},document_pageless:{label:()=>o.Ru._({id:"zDIc+A"}),formatType:"document",recommendedFor:()=>o.Ru._({id:"Wj1f8F"}),cardDimensionsDesc:()=>o.Ru._({id:"f5YDMB"}),icon:n.ecg,docSettings:()=>({stylesDerivedFrom:"document_pageless",cardDimensions:"fluid",verticalAlign:"center",defaultFullBleed:"full",defaultContentWidth:"md",fontSize:"md",scaleContentToFit:!1})},document_letter:{label:()=>o.Ru._({id:"S4Fsut"}),formatType:"document",recommendedFor:()=>o.Ru._({id:"radFB0"}),cardDimensionsDesc:()=>o.Ru._({id:"7ZpeOG"}),icon:n.b0A,docSettings:()=>({stylesDerivedFrom:"document_letter",cardDimensions:"letter_portrait",verticalAlign:"start",defaultFullBleed:"contained",defaultContentWidth:"md",fontSize:"md",scaleContentToFit:!1})},document_a4:{label:()=>o.Ru._({id:"i+5kKa"}),formatType:"document",recommendedFor:()=>o.Ru._({id:"radFB0"}),cardDimensionsDesc:()=>o.Ru._({id:"i+5kKa"}),icon:n.b0A,docSettings:()=>({stylesDerivedFrom:"document_a4",cardDimensions:"a4_portrait",defaultFullBleed:"contained",verticalAlign:"start",defaultContentWidth:"md",fontSize:"md",scaleContentToFit:!1})},social_portrait:{label:()=>o.Ru._({id:"3bV9gD"}),formatType:"social",recommendedFor:()=>o.Ru._({id:"p+4Kp5"}),icon:n.b0A,cardDimensionsDesc:()=>"4:5",docSettings:()=>({stylesDerivedFrom:"social_portrait",cardDimensions:"4:5",verticalAlign:"center",defaultContentWidth:"sm",defaultFullBleed:"contained",fontSize:"lg",scaleContentToFit:!0})},social_square:{label:()=>o.Ru._({id:"1DA6ap"}),formatType:"social",recommendedFor:()=>o.Ru._({id:"MgOHXt"}),icon:n.Nfw,cardDimensionsDesc:()=>"1:1",docSettings:()=>({stylesDerivedFrom:"social_square",cardDimensions:"square",verticalAlign:"center",defaultContentWidth:"sm",defaultFullBleed:"contained",fontSize:"lg",scaleContentToFit:!0})},social_stories:{label:()=>o.Ru._({id:"Dn+NK3"}),formatType:"social",recommendedFor:()=>o.Ru._({id:"MuPKmZ"}),icon:n.GrJ,cardDimensionsDesc:()=>"9:16",docSettings:()=>({stylesDerivedFrom:"social_stories",cardDimensions:"16x9_portrait",verticalAlign:"center",defaultContentWidth:"sm",defaultFullBleed:"contained",fontSize:"lg",scaleContentToFit:!0})},webpage_fluid:{label:()=>o.Ru._({id:"YVokw8"}),formatType:"webpage",recommendedFor:()=>o.Ru._({id:"iYYI5I"}),cardDimensionsDesc:()=>o.Ru._({id:"f5YDMB"}),icon:n.c9S,docSettings:()=>({stylesDerivedFrom:"webpage_fluid",cardDimensions:"fluid",verticalAlign:"center",defaultContentWidth:"lg",defaultFullBleed:"full",fontSize:"md",scaleContentToFit:!1})}};function r(e){return Object.keys(i).filter(t=>i[t].formatType===e)}n.vGi,r("deck"),n.bLf,r("document"),n.GrJ,r("social"),n.c9S,r("webpage");let s=e=>e.state.doc.firstChild.attrs,d=e=>e.format||"deck",u=["cardDimensions","defaultFullBleed"],c=(e,t)=>{if("custom"===e.stylesDerivedFrom)return"custom";let l=Object.entries(i).find(l=>{let[a,n]=l;return u.every(t=>e[t]===n.docSettings()[t])&&n.formatType===t});return null==l?void 0:l[0]},m=(e,t)=>{let l=i[t&&c(e,t)||"custom"],{animationsEnabled:a,defaultContentWidth:n,verticalAlign:o,presentBackdrop:r,fontSize:s,cardDimensions:d,defaultFullBleed:u,scaleContentToFit:m}=e;return{stylesDerivedFrom:e.stylesDerivedFrom,metaDescription:e.metaDescription,animationsEnabled:a||!1,presentBackdrop:r||!1,cardDimensions:d||"fluid",defaultFullBleed:u||"contained",defaultContentWidth:n||"md",fontSize:s||(l?l.docSettings().fontSize:"md"),verticalAlign:o||(l?l.docSettings().verticalAlign:"center"),scaleContentToFit:m||!1}},f=e=>{var t,l;return null===(l=e.content)||void 0===l?void 0:null===(t=l.content)||void 0===t?void 0:t[0]},p=(e,t)=>{let l=f(e);return(null==l?void 0:l.attrs.settings)[t]}},87825:(e,t,l)=>{"use strict";l.d(t,{C:()=>a,b:()=>n});let a="10vh",n="80vh"},91725:(e,t,l)=>{"use strict";l.d(t,{A:()=>b});var a=l(31085),n=l(14041),o=l(64130),i=l(88957),r=l(61690),s=l(18924),d=l(4468),u=l(87643),c=l(12408),m=l(35789),f=l(95986),p=l(86186);let g=e=>{let{icon:t="⋮",isVisible:l,isSelected:n,label:o,onClick:i,onDragStart:r,...s}=e,{color:d,bg:u,hoverColor:c,hoverBg:g,borderColor:h}=(0,p.Nb)(n);return(0,a.jsx)(f.Tz,{placement:"top",label:n?void 0:o,children:(0,a.jsx)(m.o,{position:"absolute",width:"16px",height:"22px",fontWeight:"900",fontFamily:"Inter, sans-serif",background:u,backdropFilter:"blur(8px)",border:"1px solid",borderColor:h,color:d,borderRadius:"sm",boxShadow:"sm",fontSize:"16px",cursor:"pointer",opacity:n||l?1:0,_hover:{color:c,background:g,opacity:1},...s,className:"drag-handle",onClick:i,onDragStart:r,draggable:!0,contentEditable:!1,_after:{position:"absolute",content:'""',inset:-2},children:t})})},h=e=>({top:{top:"0",insetInlineStart:"50%",height:"16px",width:"26px",pt:"1px",icon:"⋯",zIndex:"3",transform:"translateY(-50%) translateX(".concat(e?"50%":"-50%",")"),fontSize:"15px"},left:{top:"50%",insetInlineStart:"0",height:"26px",width:"16px",zIndex:"3",transform:"translateY(-50%) translateX(".concat(e?"50%":"-50%",")"),fontSize:"15px"},outside:{top:0,insetInlineStart:-6},inside:{top:2,insetInlineStart:3}}),b=e=>{let{handlePlacement:t="outside",editor:l,getPos:m,decorations:f,isVisible:p,onClick:b,node:y,selected:v,extension:k,updateAttributes:w,deleteNode:x,...S}=e,A=(0,i.GV)(r.nD),C=(0,o.fW)(),z=(0,n.useCallback)(e=>{l.commands.selectNodeAtPos(m()),e.stopPropagation()},[l,m]),I=(0,n.useCallback)(e=>{var t;let a=(null===(t=e.target.closest("[data-node-view-wrapper]"))||void 0===t?void 0:t.querySelector("[data-selection-ring]"))||void 0;(0,s.b)(l,e.nativeEvent,m(),a),e.stopPropagation()},[l,m]);if(!A)return null;let j=(0,d.JL)(f),F=(0,c.Ms)(f),B=(0,u.b0)(f);return null!=p||(p=j||F),(0,a.jsx)(g,{isSelected:B,isVisible:p,onClick:b||z,onDragStart:I,...h(C)[t],...S})}},86186:(e,t,l)=>{"use strict";l.d(t,{Nb:()=>s,wP:()=>d});var a=l(14041),n=l(87747),o=l(24293);let i=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l={borderColor:e?"var(--chakra-colors-whiteAlpha-300)":"var(--chakra-colors-blackAlpha-200)"};return t?{...l,bg:e?"var(--chakra-colors-trueblue-300)":"var(--chakra-colors-trueblue-50)",color:e?"var(--chakra-colors-trueblue-900)":"var(--chakra-colors-trueblue-300)",hoverBg:e?"var(--chakra-colors-trueblue-200)":"var(--chakra-colors-trueblue-100)",hoverColor:e?"var(--chakra-colors-trueblue-900)":"var(--chakra-colors-trueblue-600)"}:{...l,bg:e?"var(--chakra-colors-gradient-dark)":"var(--chakra-colors-whiteAlpha-900)",color:e?"var(--chakra-colors-gray-100)":"var(--chakra-colors-gray-500)",hoverBg:e?"var(--chakra-colors-gray-800)":"var(--chakra-colors-gray-100)",hoverColor:e?"var(--chakra-colors-trueblue-200)":"var(--chakra-colors-gray-800)"}},r=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return t?i(e,!0):{bg:"var(--global-drag-handle-background)",color:"var(--global-drag-handle-color)",hoverBg:"var(--global-drag-handle-hover-background)",hoverColor:"var(--global-drag-handle-hover-color)",borderColor:"var(--global-drag-handle-border)"}},s=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=(0,n.rd)();return(0,a.useMemo)(()=>r(t,e),[t,e])},d=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=s(e);return{height:o.PN,borderRadius:"sm",fontSize:"xs",px:2,shadow:"sm",bg:t.bg,color:t.color,borderColor:t.borderColor,_active:{shadow:"var(--global-drag-handle-shadow-inner)"},_hover:{color:t.hoverColor,background:t.hoverBg}}}},57036:(e,t,l)=>{"use strict";l.d(t,{M:()=>u});var a=l(11329),n=l(95580),o=l(63915),i=l(42849),r=l(77646);let s=(e,t)=>!!d(e),d=e=>{if(!(e.parent&&(0,r.jg)(e.parent)))return!0;let t=(0,n.TK)(e,r.jg)[0];if(!t)return!0;let l=e.doc.resolve(t.pos);return 0===Object.keys((0,i.l0)(l)).length},u=(e,t,l)=>{var i;let r=e.posAtCoords({left:t.clientX,top:t.clientY});if(!r||r.inside<0||!e.state.doc.resolve(r.pos))return null;let d=r.pos,u=e.state.doc.resolve(r.inside),c=e.state.doc.nodeAt(r.inside),m=e.state.doc.nodeAt(r.pos);if((null==c?void 0:c.type.name)==="smartLayout"&&(null==m?void 0:m.type.name)==="smartLayoutCell")return null;let f=(0,n.IV)(u,o.q)[0];return f&&(d=r.inside,f.pos===d)||!d||l&&null==(d=(0,a.Um)(e.state.doc,d,l))||!s(e.state.doc.resolve(d),null===(i=e.dragging)||void 0===i?void 0:i.slice)?null:d}},7259:(e,t,l)=>{"use strict";l(64130),l(19534),l(69646),l(82354),l(17835),l(90406),l(46896)},27664:(e,t,l)=>{"use strict";l.d(t,{CD:()=>d,IN:()=>r,Wp:()=>s,rZ:()=>u});var a=l(99742),n=l(88957),o=l(56632),i=l(61690);let r=(e,t,l)=>{e&&t&&e.replacePageContent(t.shapes,t.bindings,l)},s=(e,t)=>{e.setSetting("isSnapping",t),setTimeout(()=>{(0,o.lN)(e,t?128:10)})},d=(e,t)=>{(0,n.KA)().dispatch((0,i.v5)(t?{drawingId:e}:{drawingId:null}))},u=()=>(0,a.Ak)(5)},46291:(e,t,l)=>{"use strict";l.d(t,{Hf:()=>x,mk:()=>S});var a=l(31085),n=l(13236),o=l(81570),i=l(14041),r=l(52609),s=l(95580),d=l(43873),u=l(38234);let c=(e,t)=>(l,a)=>{let n={...l.getState(e.view.state)};n.active=!0,n.key=a,n.query="",t.setMeta(l,n)};var m=l(88957),f=l(61690),p=l(60490),g=l(59707);let h=e=>{let{ref:t,pickerInstance:l}=e;(0,i.useImperativeHandle)(t,()=>{let e=e=>{var t,a,n;let o=null===(n=l.component)||void 0===n?void 0:null===(a=n.refs)||void 0===a?void 0:null===(t=a.searchInput)||void 0===t?void 0:t.current;if(o){let{key:t,code:l}=e;o.dispatchEvent(new KeyboardEvent("keydown",{key:t,code:l}))}return e.stopPropagation(),e.preventDefault(),!0};return{onKeyDown:t=>{let{event:l}=t;return!!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Enter"].includes(l.key)&&e(l)}}})},b=(0,i.forwardRef)((e,t)=>{let{query:l,onSelect:n}=e,o=(0,m.GV)(f.Jo),s=(0,p.Iy)("edit",o),[d,u]=(0,i.useState)(null),c=(0,i.useCallback)(e=>{if(u(e),e.shadowRoot){let t=document.createElement("style");t.innerHTML="nav + div.padding-lr { display: none }",e.shadowRoot.appendChild(t)}e.addEventListener("mousedown",g.Fw)},[]);h({ref:t,pickerInstance:d}),(0,i.useEffect)(()=>{var e,t,a;if(!d)return;let n=null===(a=d.component)||void 0===a?void 0:null===(t=a.refs)||void 0===t?void 0:null===(e=t.searchInput)||void 0===e?void 0:e.current;n&&(n.value=l,n.dispatchEvent(new Event("input",{bubbles:!0})))},[d,l]);let b=(0,i.useCallback)(e=>{let t=(0,r.F8)(e.id);t&&n(t)},[n]);return s?(0,a.jsx)(r.pP,{onCreate:c,perLine:9,searchPosition:"sticky",handlePick:b,shouldFocusSearch:!1,dataTargetName:"emoji-list"}):(0,a.jsx)(a.Fragment,{})});var y=l(63280);let v=/:([a-zA-Z0-9_+-]+):$/,k=new o.hs("EmojiMenu"),w=e=>{let t=(0,r.$n)(e);return{id:e.id,native:t}},x=n.bP.create({name:"emoji",group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:()=>({id:{},native:{}}),addStorage:()=>({hasMigrated:!1,isMigrationScheduled:!1}),parseHTML:()=>[{tag:"span.emoji:not([id])",skip:!0},{tag:"span[class=emoji]"}],addCommands(){return{openEmojiPicker:function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return t=>{let{commands:l,tr:a,editor:n}=t;return c(n,a)(k,":"),!e||l.insertContent(":")}},migrateNativeEmojis:()=>e=>{let{editor:t}=e;return!this.storage.hasMigrated&&!this.storage.isMigrationScheduled&&(this.storage.isMigrationScheduled=!0,r.eX.then(()=>{t.commands.command(e=>{let{tr:t,state:l}=e,{doc:a,schema:n}=l;return a.descendants((e,l,a)=>{A({node:e,pos:l,parent:a,tr:t,schema:n})}),this.storage.hasMigrated=!0,this.storage.isMigrationScheduled=!1,!0})}),!0)}}},addInputRules:()=>[new n.fV({find:v,handler:e=>{let{range:t,match:l,commands:a}=e,n=l[1],o=(0,r.F8)(n);if(!o)return;let i=w(o);a.insertContentAt(t,{type:"emoji",attrs:i})}})],renderHTML(e){let{HTMLAttributes:t,node:l}=e;return["span",(0,n.KV)(t,{class:"emoji"}),"".concat(l.attrs.native||"�")]},renderHTMLforAI(e){let{node:t}=e;return t.attrs.native||""},renderText(e){let{node:t}=e;return"".concat(t.attrs.native||"�")},addProseMirrorPlugins:()=>[new o.k_({key:new o.hs("emojiTransform"),appendTransaction:(e,t,l)=>(0,s.g4)(e,l,A)})]}),S=(0,u.e$)({name:"emojiShortcuts",char:":",pluginKey:k,MenuComponent:(0,i.forwardRef)((e,t)=>{let{query:l,editor:n}=e;return n.isEditable?(0,a.jsx)(b,{ref:t,query:l,onSelect:e=>{let{id:t}=e,a=(0,r.$n)(e),o=n.state.selection;n.chain().deleteRange({from:o.from-l.length-1,to:o.to}).insertContent({type:"emoji",attrs:{id:t,native:a}}).insertContent(" ").run()}}):null}),priority:d.y.EmojiShortcuts}),A=e=>{let{node:t,pos:l,tr:a,schema:n}=e;if(!(0,r.Gm)())return!1;if(!t.isText||!t.text)return!0;let o=t.marks.map(e=>e.toJSON()),{replaced:i,nodes:s}=(0,y.Z)(t.text,o);try{i&&a.replaceWith(a.mapping.map(l),a.mapping.map(l+t.nodeSize),s.map(e=>n.nodeFromJSON(e)))}catch(e){console.error("[migratePlugin] Error migrating emoji",{err:e,pos:l,text:t.text,node:t,nodes:s})}return!0}},44018:(e,t,l)=>{"use strict";l.d(t,{n:()=>n});var a=l(81354);let n=l.n(a)()()},63280:(e,t,l)=>{"use strict";l.d(t,{Z:()=>o});var a=l(52609),n=l(44018);let o=(e,t)=>{let l=[],o=e.matchAll(n.n),i=0;for(let n of o){let o=n.index;if(void 0===o)continue;let r=o+n[0].length,s=n[0],d=(0,a.zB)(s);if(!d)continue;let u=(0,a.F8)(d),c=e.slice(i,o);c.length>0&&l.push({type:"text",text:c,marks:t});let m={type:"emoji",attrs:{native:s,id:null==u?void 0:u.id},marks:t};i=r,l.push(m),console.debug("[migratePlugin] Replacing bad emoji",{start:o,end:r,native:s,newNode:m,textBefore:c,match:n})}let r=e.slice(i);return 0===i?{replaced:!1,nodes:l}:(r&&l.push({type:"text",text:r,marks:t}),{replaced:!0,nodes:l})}},74336:(e,t,l)=>{"use strict";l.d(t,{h:()=>s,v:()=>d});var a=l(13236),n=l(81570),o=l(73686),i=l(95580);let r=e=>e.isTextblock||["gallery","cardLayoutItem","buttonGroup","navbarLinks","navbarButtons","toggleSummary"].includes(e.type.name),s=a.YY.create({name:"emptyNodes",addOptions:()=>({emptyNodeClass:"is-empty",showOnlyWhenEditable:!0,showOnlyCurrent:!1}),addProseMirrorPlugins(){return[new n.k_({key:new n.hs("emptyNodes"),props:{decorations:e=>{let{doc:t,selection:l}=e,a=[],n=this.editor.isEditable||!this.options.showOnlyWhenEditable||this.editor.isThumbnail,{anchor:s}=l;if(n)return t.descendants((e,t)=>{if(!r(e))return;let l=s>=t&&s<=t+e.nodeSize,n=(0,i.mf)(e);(l||!this.options.showOnlyCurrent)&&n&&a.push(o.NZ.node(t,t+e.nodeSize,{class:this.options.emptyNodeClass},{isEmpty:!0}))}),o.zF.create(t,a)}}})]}}),d=e=>e.some(e=>e.spec.isEmpty)},51183:(e,t,l)=>{"use strict";l.d(t,{A3:()=>k});var a=l(81313),n=l(13236),o=l(81570),i=l(73686),r=l(88957),s=l(65084),d=l(10458),u=l(61690),c=l(14e3),m=l(95580),f=l(45864),p=l(69646),g=l(77646),h=l(86047),b=l(15944),y=l(46896);let v=new o.hs("expandableNodes"),k=e=>e.some(e=>e.spec.isExpandableNode),w=e=>e instanceof f.J&&0===e.side&&x(e.node),x=e=>!0===e.type.spec.expandable,S=(e,t)=>{if(!(null==t?void 0:t.from))return!1;let l=(0,m.jB)(e,t.from),a=(0,s.cH)(l);return(null==a?void 0:a.inView)===!0},A=(e,t,l)=>{let a=(0,g.Py)(e.view.nodeDOM(t)),n=(0,s.cH)(a);if(!n)return!1;let{bottomInView:o,topInView:i}=n;return"top"===l?i:o},C=function(e,t,l){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],n=e.state.selection,i=n instanceof f.J&&1===n.side?n.to:n.from;if(i<=t){if(A(e,t,"top"))return null}else if(i>=l){if(A(e,t,"bottom"))return null}else{if(S(e,n))return null;let t=e.state.doc.resolve(i);if(S(e,o.LN.findFrom(t,-1,!1))||S(e,o.LN.findFrom(t,1,!1)))return null}let r=(0,m.XL)({editor:e,side:a?"bottom":"top",margin:200});if(r.pos){let t=o.LN.findFrom(e.state.doc.resolve(r.pos),a?1:-1,!1);return(null==t?void 0:t.from)||null}return null};n.YY.create({name:"expandableNodes",extendNodeSchema(e){var t;return{expandable:null!==(t=(0,n.gk)((0,n.iI)(e,"expandable",e)))&&void 0!==t&&t}},addCommands:()=>({expandOrCollapseExpandableNode:e=>t=>{let{state:l,chain:a}=t,n=null!=e?e:l.selection.from,o=l.doc.nodeAt(n);if(!o||!x(o))return!1;let i=(0,r.KA)();switch(o.type.name){case"card":if(i.dispatch((0,u.mF)({attached:!1})),null===d.zS||void 0===d.zS||d.zS.track(d.VV.CARD_EXPANDED,{is_present_mode:!0,method:"enter_key"}),(0,p.Wq)(o.attrs.id))return a().descendIntoCurrentCard(n).reHighlightExpandableNode().run();return a().spotlightCollapseCard(n).reHighlightExpandableNode().run();case"toggle":{(0,y.bG)(o.attrs.id,!(0,y.vb)(o.attrs.id));let t=a();return e&&t.spotlightNextBlock(),t.reHighlightExpandableNode().run(),!0}case"image":case"video":case"embed":return i.dispatch((0,u.a)({nodeId:o.attrs.id})),!0;case"gallery":{let e=o.firstChild;if(e)return i.dispatch((0,u.a)({nodeId:e.attrs.id})),!0;return!1}default:return!1}},goToNextExpandableNode:e=>t=>{var l;let{editor:a,tr:n,state:o}=t,i=b.n.getState(a.state),r=(0,g.W0)(a,i.cardId);if(!r)return!1;let d=r.node.attrs.id,u=r.pos,c=r.pos+r.node.nodeSize,m=a.state.selection,p=w(m),y=m instanceof f.J,k=C(a,u,c,e),S=(null===(l=v.getState(o))||void 0===l?void 0:l.lastApplied)||+new Date;if(p&&!k&&+new Date-S>3e3)return a.commands.reHighlightExpandableNode();n.setMeta(v,{});let A=y&&(-1===m.side&&e||1===m.side&&!e)?-1:0,z=Math.min(Math.max(k||(p||!y?m.from:1===m.side?m.to+A:m.from+A),u),c-1),I=(0,h.vi)(a,d,z,x,e);if(console.debug("[ExpandableNodes] goToNextExpandableNode",{posToUse:z,overridePos:k},I),!I.pos||!I.domNode||I.cardId!==d)return n.setSelection(f.J.create(a.state.doc,u,e?-1:1)),!1;let j=(0,s.cH)(I.domNode,50);return(null==j?void 0:j.inView)?(n.setSelection(f.J.create(a.state.doc,I.pos)),(0,s.H1)("editor").scrollElementIntoView({element:I.domNode,attempts:0,offsetFromTop:null}),!0):(p&&n.setSelection(f.J.create(a.state.doc,m.from,e?-1:1)),!1)},reHighlightExpandableNode:()=>e=>{let{tr:t,editor:l}=e;return t.setMeta(v,{shouldAddResetClass:!0}),requestAnimationFrame(()=>{l.commands.command(e=>{let{tr:t}=e;return t.setMeta(v,{shouldAddResetClass:!1}),!0})}),!0}}),addProseMirrorPlugins:()=>[new o.k_({key:v,state:{init:()=>({lastApplied:0,shouldAddResetClass:!1}),apply(e,t){let l=e.getMeta(v);return l?{...t,lastApplied:+new Date,...l}:t}},props:{decorations(e){let t=b.n.getState(e);if(null==t?void 0:t.pos)return i.zF.empty;let l=v.getState(e);if((0,u.wC)((0,r.KA)().getState())!==c.w.SLIDE_VIEW)return i.zF.empty;let n=e.selection;if(!w(n)||!(n instanceof f.J))return i.zF.empty;let o=n.node;return i.zF.create(e.doc,[i.NZ.node(n.from,n.from+o.nodeSize,{class:(0,a.cx)("expandable-node-selected",(null==l?void 0:l.shouldAddResetClass)&&"expandable-node-reset")},{isExpandableNode:!0})])}}})]})},30138:(e,t,l)=>{"use strict";l.d(t,{Ud:()=>u,Xw:()=>d,Z4:()=>s,mD:()=>c});var a=l(13236),n=l(98380),o=l(45965),i=l(98057),r=l(18733);let s=a.YY.create({name:"fontSize",addProseMirrorPlugins:()=>[(0,i.u)()],addInputRules:()=>Object.entries((0,o.ZD)()).map(e=>{let[t,{inputRegex:l,type:a}]=e;return l?(0,n.fI)({find:l,getAttributes:e=>("heading"!==a||u(e).includes("heading"))&&("title"!==a||u(e).includes("title"))?{fontSize:t}:null}):null}).filter(e=>!!e),addKeyboardShortcuts(){return Object.entries((0,o.ZD)()).reduce((e,t)=>{let[l,{level:a,type:n}]=t;return"heading"===n&&a?{...e,["Mod-Alt-".concat(a)]:()=>this.editor.commands.setFontSize(l)}:e},{})},addCommands:()=>({setFontSize:e=>t=>{let{tr:l,dispatch:a,state:n}=t;return!a||(l.selection.ranges.forEach(t=>{let a=t.$from.pos,o=t.$to.pos,{type:i,level:s}=(0,r.o)(e),{nodes:d}=n.schema;n.doc.nodesBetween(a,o,(t,a)=>{var n;if("footnote"===t.type.name)return!1;if(t.isTextblock){if("heading"===i&&!u(t).includes("heading")){l.setNodeMarkup(a,d.heading,{...t.attrs,level:s}).setMeta("annotationEvent",{type:"update-node-attrs",pos:a});return}if("title"===i&&!u(t).includes("title")){l.setNodeMarkup(a,d.title,{...t.attrs,level:s}).setMeta("annotationEvent",{type:"update-node-attrs",pos:a});return}(null===(n=t.type.spec.attrs)||void 0===n?void 0:n.fontSize)?l.setNodeMarkup(a,void 0,{...t.attrs,fontSize:e}).setMeta("annotationEvent",{type:"update-node-attrs",pos:a}):["heading","title"].includes(t.type.name)&&l.setNodeMarkup(a,d.paragraph,{...t.attrs,fontSize:e}).setMeta("annotationEvent",{type:"update-node-attrs",pos:a})}})}),!0)}}),extendNodeSchema(e){var t;return{allowFontSizes:null!==(t=(0,a.gk)((0,a.iI)(e,"allowFontSizes",e)))&&void 0!==t?t:""}}}),d=e=>{let{state:t}=e,{from:l,to:n}=t.selection;return[...new Set((0,a.Nx)(t.doc,{from:l,to:n},e=>e.isTextblock).reverse().map(e=>{let{node:t}=e;return t.attrs.fontSize}).filter(e=>void 0!==e))]},u=e=>{var t,l;return null!==(l=null===(t=e.type.spec.allowFontSizes)||void 0===t?void 0:t.split(" "))&&void 0!==l?l:[]},c={default:null,keepOnSplit:!0,renderHTML:e=>({"data-font-size":e.fontSize}),parseHTML:e=>e.getAttribute("data-font-size")}},98057:(e,t,l)=>{"use strict";l.d(t,{P:()=>s,u:()=>r});var a=l(81570),n=l(73686),o=l(18733);let i=e=>["calloutBox","smartLayoutCell"].includes(e.type.name),r=()=>new a.k_({key:new a.hs("fontSize"),props:{decorations(e){let t=[];if(e.doc.descendants((e,l)=>{if(!i(e)||!e.firstChild)return;let a=(0,o.NA)(e.firstChild);t.push(n.NZ.node(l,l+e.nodeSize,{},{isFirstChildFontSizeDecoration:!0,firstChildSize:a}))}),0!=t.length)return n.zF.create(e.doc,t)}}}),s=e=>{var t;return(null===(t=e.find(e=>e.spec.isFirstChildFontSizeDecoration))||void 0===t?void 0:t.spec)||{}}},45965:(e,t,l)=>{"use strict";l.d(t,{KG:()=>r,QD:()=>d,Y5:()=>s,ZD:()=>i});var a=l(12327),n=l(40074),o=l.n(n);let i=()=>({sm:{label:a.Ru._({id:"LBkaLa"}),size:.8,flagged:!0,type:"body",shortcut:"/sm"},default:{label:a.Ru._({id:"5NwZ8t"}),size:1,type:"body",shortcut:"/md"},lg:{label:a.Ru._({id:"0Sz17G"}),size:1.25,flagged:!0,type:"body",shortcut:"/lg"},h4:{label:a.Ru._({id:"nJeKmw"}),size:1.25,mobileSize:1.1,level:4,type:"heading",inputRegex:/^####\s$/,shortcut:"####"},h3:{label:a.Ru._({id:"SFN6dN"}),size:1.5,mobileSize:1.25,level:3,type:"heading",inputRegex:/^###\s$/,shortcut:"###"},h2:{label:a.Ru._({id:"El7NbA"}),size:2,mobileSize:1.5,level:2,type:"heading",inputRegex:/^##\s$/,shortcut:"##"},h1:{label:a.Ru._({id:"lXKZGw"}),size:2.5,mobileSize:2,level:1,type:"heading",inputRegex:/^#\s$/,shortcut:"#"},title:{label:a.Ru._({id:"MHrjPM"}),size:3.45,mobileSize:2.25,level:1,type:"title",inputRegex:/^!\s$/,shortcut:"!"},titleLg:{label:a.Ru._({id:"Xm/s+u"}),size:5,level:2,mobileSize:2.5,type:"title",inputRegex:/^!!\s$/,shortcut:"!!"},titleXl:{label:a.Ru._({id:"bSLwU6"}),size:7.5,level:3,mobileSize:2.75,type:"title",inputRegex:/^!!!\s$/,shortcut:"!!!"}}),r=()=>o()(Object.entries(i()).filter(e=>{let[t,{type:l}]=e;return"heading"===l}),e=>{let[t,{level:l}]=e;return l}),s=()=>o()(Object.entries(i()).filter(e=>{let[t,{type:l}]=e;return"title"===l}),e=>{let[t,{level:l}]=e;return l}),d=()=>o()(Object.entries(i()).filter(e=>{let[t,{type:l}]=e;return"body"===l}),e=>{let[t,{size:l}]=e;return l})},93765:(e,t,l)=>{"use strict";l.d(t,{Uw:()=>i,bh:()=>r,eL:()=>o,tX:()=>s});var a=l(45965),n=l(18733);let o=1.25,i=1.6,r=(e,t)=>{let{size:l,mobileSize:a}=(0,n.o)(e);if(e&&(0,n.Ii)(e)){var o,i;let e=(null!==(o=t.config.headingFontSize)&&void 0!==o?o:1)/(null!==(i=t.config.fontSize)&&void 0!==i?i:1),n=l*e,r=a?a*e:void 0;return{fontSize:r?["".concat(r,"em"),"".concat(n,"em")]:"".concat(n,"em"),"@media print":{fontSize:"".concat(n,"em")},lineHeight:"var(--line-height-heading)"}}return{fontSize:a?["".concat(a,"em"),"".concat(l,"em")]:"".concat(l,"em"),"@media print":{fontSize:"".concat(l,"em")},lineHeight:"var(--line-height-body)"}},s=e=>{let t={".block-paragraph":{...r("default",e)},".block-heading":{'.heading[level="1"]':{...r("h1",e)},'.heading[level="2"]':{...r("h2",e)},'.heading[level="3"]':{...r("h3",e)},'.heading[level="4"]':{...r("h4",e)}},".block-title":{".title":{...r("title",e)},'.title[level="1"]':{...r("title",e)},'.title[level="2"]':{...r("titleLg",e)},'.title[level="3"]':{...r("titleXl",e)}}};return Object.keys((0,a.ZD)()).forEach(l=>{let a=r(l,e);t['[data-font-size="'.concat(l,'"]')]=a}),t}},18733:(e,t,l)=>{"use strict";l.d(t,{FF:()=>s,Ii:()=>d,NA:()=>r,bZ:()=>o,bn:()=>i,o:()=>n});var a=l(45965);let n=e=>null==e||void 0==e?(0,a.ZD)().default:(0,a.ZD)()[e]||(0,a.ZD)().default,o=e=>{var t;return null===(t=Object.entries((0,a.ZD)()).find(t=>{let[l,a]=t;return"heading"===a.type&&a.level==e}))||void 0===t?void 0:t[0]},i=e=>{var t;return null===(t=Object.entries((0,a.ZD)()).find(t=>{let[l,a]=t;return"title"===a.type&&a.level==e}))||void 0===t?void 0:t[0]},r=e=>"heading"===e.type.name?o(e.attrs.level):"title"===e.type.name?i(e.attrs.level):e.attrs.fontSize,s=e=>{let{type:t}=n(e);return t},d=e=>{let{type:t}=n(e);return"heading"===t||"title"===t}},69180:(e,t,l)=>{"use strict";l.d(t,{N3:()=>u,Wj:()=>d,bk:()=>c,pN:()=>m,uI:()=>f});var a=l(12784),n=l.n(a),o=l(99742),i=l(81570),r=l(88957),s=l(61690);let d=(e,t)=>{let l=(0,r.KA)();l.dispatch((0,s.U)(t?{noteId:e}:{noteId:null}));let a=l.getState();!t&&(0,s.rp)(a)&&l.dispatch((0,s.Zf)({isEditingMedia:!1})),!t&&(0,s.dK)(a)&&l.dispatch((0,s.a)({nodeId:null}))},u=n()(d,30),c=()=>{let e=(0,r.KA)().getState();return(0,s.DH)(e)},m=()=>(0,o.Ak)(5),f=e=>e instanceof i.nh&&"footnote"===e.node.type.name},5628:(e,t,l)=>{"use strict";l.d(t,{R:()=>a,k:()=>n});let a="fromInnerEditor",n="fromOuterEditor"},49572:(e,t,l)=>{"use strict";l.d(t,{Q:()=>o,z:()=>i});var a=l(11329),n=l(5628);let o=e=>"footnote"==e.schema.topNodeType.name,i=function(e,t,l,o){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"footnote";e.forEach(e=>{let t=e.steps.filter(e=>e instanceof a.XE||e instanceof a.Ys);0==t.length||e.getMeta(n.R)||e.getMeta("appendedTransaction")||t.forEach(e=>{let{from:t,to:n,mark:r}=e;l.doc.nodesBetween(t,n,(l,s)=>{l.type.name===i&&s{"use strict";l.d(t,{B:()=>a});let a=l(60980).B.extend({addKeyboardShortcuts(){return{"Shift-Enter":()=>this.editor.commands.setHardBreak()}}})},34444:(e,t,l)=>{"use strict";l.d(t,{DZ:()=>b,Bq:()=>h});var a=l(87307),n=l(58599),o=l(98380),i=l(29362),r=l(31085),s=l(81313),d=l(12327),u=l(41900),c=l(57284),m=l(47687),f=l(95905);let p=e=>{let{node:t,decorations:l}=e,{level:a,horizontalAlign:o,placeholder:i}=t.attrs,p=(0,m.h)(l),g=i||(p?d.Ru._({id:"gLDJuJ"}):d.Ru._({id:"1nLERW",values:{level:a}}));return(0,r.jsx)(c.u,{...e,style:{display:"flex",flexDirection:"column",...(0,f.yp)(o)},children:(0,r.jsx)(n.$p,{dir:(0,f.fZ)(l),level:a,"data-placeholder":g,className:(0,s.cx)("heading",u.U6),style:{minWidth:"min(100%, 10em)",...(0,f.O8)(o)}})})},g=[1,2,3,4],h=Math.max(...g),b=a.D.extend({selectable:!1,group:"block cardNotesBlock",addAttributes:()=>({level:{default:1,rendered:!1}}),addNodeView:()=>(0,n.gu)(p,{update:i.z0}),addInputRules(){return this.options.levels.map(e=>(0,o.tC)({find:new RegExp("^(#{1,".concat(e,"})\\s$")),type:this.type,getAttributes:{level:e}},[this.editor.state.schema.nodes.bullet,this.editor.state.schema.nodes.numbered,this.editor.state.schema.nodes.todo]))}}).configure({levels:g})},95905:(e,t,l)=>{"use strict";l.d(t,{gj:()=>_,wq:()=>I,fZ:()=>F,O8:()=>z,yp:()=>x,AS:()=>C,F0:()=>v,CY:()=>k,Ro:()=>w,er:()=>B,lI:()=>S});var a=l(20501),n=l(12327),o=l(13236),i=l(81570),r=l(7908),s=l(64130),d=l(95580),u=l(43873),c=l(73686);let m=["paragraph","heading","title","drawing","diagram","image","contributors","mediaPlaceholder","buttonGroup","navbarLinks","gallery","chart","toggleSummary"],f=["title","heading","paragraph","bullet","todo","numbered","image","contributors","diagram","mediaPlaceholder","buttonGroup","gallery","chart"],p=["toggle"],g=new i.hs("horizontalAlign");class h{isRelevantNode(e){return f.includes(e.type.name)}isRelevantParentNode(e){return p.includes(e.type.name)}apply(e){if(!e.docChanged&&this.hasInitialized)return this;this.hasInitialized=!0;let t=[],l=(0,s.C)();return e.doc.descendants((e,a)=>{if(this.isRelevantParentNode(e)){let l=(0,r.KQ)(e);t.push(c.NZ.node(a,a+e.nodeSize,{},{dir:l})),"toggle"===e.type.name&&e.forEach((e,n,o)=>{if("toggleSummary"===e.type.name){let o=a+1+n;t.push(c.NZ.node(o,o+e.nodeSize,{},{dir:l}))}})}if(this.isRelevantNode(e)){let n=(0,r.KQ)(e);n?l=n:t.push(c.NZ.node(a,a+e.nodeSize,{},{dir:l}))}return!0}),this.decorations=c.zF.create(e.doc,t),this}constructor(e=c.zF.empty){this.hasInitialized=!1,this.decorations=e}}let b=()=>new i.k_({key:g,state:{init:()=>new h,apply:(e,t)=>t.apply(e)},props:{decorations(e){let t=g.getState(e);return null==t?void 0:t.decorations}}}),y=["left","right","center"],v=e=>y.find(t=>e.isActive({horizontalAlign:t})),k=e=>{let t=e.state.selection.$head.node().textContent;return(0,r.R_)(t)||(0,s.C)()},w=e=>t=>{let{dir:l,ctx:a}=t||{};return"menu"===a?null:e&&"center"!==e&&"ltr"!==l?"left"===e?"right":"left":e},x=(e,t)=>{let l=S(e,t);return{textAlign:e||void 0,alignItems:l||"var(--flex-align)","--flex-align":l}},S=(e,t)=>{if(e)return A(e,t||(0,s.C)())},A=(e,t)=>e?"rtl"===t?({left:"flex-end",center:"center",right:"flex-start"})[e]:({left:"flex-start",center:"center",right:"flex-end"})[e]:void 0,C=(e,t)=>{let l={"--descendant-align-self-left":"rtl"===t?"flex-end":"flex-start","--descendant-align-self-center":"center","--descendant-align-self-right":"rtl"===t?"flex-start":"flex-end"};return e?{"--descendant-align-self":A(e,t),...l}:l},z=e=>e?{alignSelf:"var(".concat({left:"--descendant-align-self-left",center:"--descendant-align-self-center",right:"--descendant-align-self-right"}[e],", --descendant-align-self)")}:{alignSelf:"var(--descendant-align-self, self-start)"},I=o.YY.create({name:"horizontalAlign",priority:u.y.HorizontalAlign,addOptions:()=>({types:m,alignments:y,defaultAlignment:null}),addGlobalAttributes(){return[{types:this.options.types,attributes:{horizontalAlign:{default:this.options.defaultAlignment,keepOnSplit:!0,parseHTML:e=>e.style.textAlign||e.getAttribute("align")||this.options.defaultAlignment,renderHTML:e=>e.horizontalAlign?{style:"text-align: ".concat(e.horizontalAlign)}:{}}}}]},addCommands:()=>({toggleHorizontalAlign:e=>t=>{let{tr:l,dispatch:a,state:n,editor:o}=t;if(!a)return!0;let i=j(o,e)?null:e;return l.selection.ranges.forEach(e=>{let t=e.$from.pos,a=e.$to.pos;n.doc.nodesBetween(t,a,(e,t)=>{if("footnote"===e.type.name)return!1;m.includes(e.type.name)&&l.setNodeMarkup(t,void 0,{...e.attrs,horizontalAlign:i}).setMeta("annotationEvent",{type:"update-node-attrs",pos:t})})}),!0}}),addKeyboardShortcuts(){return{"Mod-Shift-l":()=>this.editor.commands.toggleHorizontalAlign("left"),"Mod-Shift-e":()=>this.editor.commands.toggleHorizontalAlign("center"),"Mod-Shift-r":()=>this.editor.commands.toggleHorizontalAlign("right"),Backspace:()=>{let{selection:e}=this.editor.state;if(!(e instanceof i.U3)||!e.empty)return!1;let t=e.$from.parent;return!!m.includes(t.type.name)&&!!t.isTextblock&&!(t.nodeSize>2)&&t.attrs.horizontalAlign!=this.options.defaultAlignment&&this.editor.commands.toggleHorizontalAlign(this.options.defaultAlignment)}}},addProseMirrorPlugins:()=>[b()]}),j=(e,t)=>{let l=y.filter(e=>e!==t);return e.isActive({horizontalAlign:t})&&!l.some(t=>e.isActive({horizontalAlign:t}))},F=(e,t)=>{var l;if(!t)return(null===(l=e.find(e=>e.spec.dir))||void 0===l?void 0:l.spec.dir)||"auto"},B=(e,t,l)=>{var a;let n=g.getState(e);if(!n)return null;let o=null===(a=n.decorations.find(t,l,e=>e.dir))||void 0===a?void 0:a[0];return o?o.spec.dir:null},R=e=>!(0,d.iA)(e,"horizontalAlign"),_=[{key:"alignLeft",name:()=>n.Ru._({id:"VjjKVj"}),icon:a.ecg,checkActive:e=>j(e,"left"),checkDisabled:R,apply:e=>e.chain().toggleHorizontalAlign("left").run(),shortcut:"Mod+Shift+L",enabledForTables:!0,alignment:"left"},{key:"alignCenter",name:()=>n.Ru._({id:"95ckMP"}),icon:a._ur,checkActive:e=>j(e,"center"),checkDisabled:R,apply:e=>e.chain().toggleHorizontalAlign("center").run(),shortcut:"Mod+Shift+E",enabledForTables:!0,alignment:"center"},{key:"alignRight",name:()=>n.Ru._({id:"vTKw81"}),icon:a.jbh,checkActive:e=>j(e,"right"),checkDisabled:R,apply:e=>e.chain().toggleHorizontalAlign("right").run(),shortcut:"Mod+Shift+R",enabledForTables:!0,alignment:"right"}]},94669:(e,t,l)=>{"use strict";l.d(t,{K:()=>n});var a=l(68566);let n=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=t.nodeAfter;if(!n)return!1;e.deleteRange(t.pos,t.pos+n.nodeSize);let o=e.doc.nodeAt(t.pos),i=t.pos,r=1;(!l&&t.nodeBefore||l&&!o&&t.nodeBefore)&&(i=t.pos-t.nodeBefore.nodeSize,r=-1);let s=e.doc.resolve(i+1),d=(0,a.n)(e.doc.resolve(r>0?s.pos:s.end()),r);return d&&e.setSelection(d),!0}},13934:(e,t,l)=>{"use strict";l.d(t,{Z:()=>a,e:()=>n});let a=4,n={type:"gridCell",content:[{type:"paragraph"}]}},89565:(e,t,l)=>{"use strict";l.d(t,{M5:()=>d,Vk:()=>i,rj:()=>r,wC:()=>s});var a=l(98371),n=l(474);let o=e=>{var t;let{view:l,event:a}=e,n=null===(t=l.posAtCoords({left:a.clientX,top:a.clientY}))||void 0===t?void 0:t.inside;if(!n||-1==n)return null;let{doc:o}=l.state,i=o.nodeAt(n);return{pos:n,node:i}},i=(e,t,l)=>{var i;if(l&&!(0,n.Ny)(l,e.state.schema)||!((null===(i=t.target)||void 0===i?void 0:i.hasAttribute("data-media-node-wrapper"))||(0,a.xX)(t.target,e.dom,e=>e.hasAttribute("data-media-node-wrapper"))))return null;let s=o({view:e,event:t});if(!s||l&&l.content.firstChild===s.node)return null;let d=r(t.target,e);return d&&s.node?{pos:s.pos,node:s.node,side:d}:null},r=(e,t)=>{let l=(0,a.GE)(e,t.dom,"data-media-add-side");return null==l?void 0:l.getAttribute("data-media-add-side")},s=e=>{let{side:t,pasteContent:l,node:a}=e;return{type:"gridLayout",content:[{type:"gridCell",content:"left"===t?l:[a.toJSON()]},{type:"gridCell",content:"left"===t?[a.toJSON()]:l}]}},d=e=>{let{side:t,node:l}=e;return"left"===t?2:l.nodeSize+4}},474:(e,t,l)=>{"use strict";l.d(t,{DF:()=>h,NJ:()=>s,Ny:()=>p,Ob:()=>b,X6:()=>r,ds:()=>d,nX:()=>v,xK:()=>k});var a=l(13236),n=l(95580);let o=["card","document","gridLayout","gallery"],i=e=>e.isBlock&&!o.includes(e.type.name)&&!(e.isTextblock&&(0,n.Op)(e)),r=e=>"gridLayout"===e.type.name,s=e=>"gridCell"===e.type.name,d=(e,t,l)=>{let a=l&&u(e,l,t);if(a)return a;if(l&&!p(l,e.state.schema))return null;let n=c(e,t,"right")||c(e,t,"left");return!n||l&&l.content.firstChild===n.node?null:n},u=(e,t,l)=>{var o;if(!g(t,e.state.schema))return null;let i=null===(o=e.posAtCoords({left:l.clientX,top:l.clientY}))||void 0===o?void 0:o.inside;if(!i||-1==i)return null;let{doc:r}=e.state,d=r.resolve(i),u=r.nodeAt(i),c=u&&s(u)?{node:u,pos:i}:(0,a.eL)(d,s),m=(null==c?void 0:c.pos)&&(0,n.q0)(c.pos,e);if(!c||!m)return null;let f=l.clientX>m.left+m.width/2?"right":"left";return{pos:c.pos,node:c.node,rect:m,side:f}},c=(e,t,l)=>{var o;let r=null===(o=e.posAtCoords({left:t.clientX+("left"==l?30:-30),top:t.clientY}))||void 0===o?void 0:o.inside;if(!r||-1==r)return null;let{doc:s,schema:d}=e.state,u=s.resolve(r),c=s.nodeAt(r),p=c&&i(c)?{node:c,pos:r}:(0,a.eL)(u,i);if(!p)return null;let g=(0,n.q0)(r,e);if(!g)return null;let h="left"==l?t.clientX-g.left:g.right-t.clientX,b=h<0,y=(null==c?void 0:c.type.name)==="gridCell"?0:30;if(!(b&&h>-y||"right"==l&&h<(g.right-g.left)*.15))return null;let v=s.resolve(p.pos),k=(null==c?void 0:c.type.name)==="gridCell"&&m(v,d)||f(v,d);if(b||!k){let t=(0,a.eL)(u,e=>"gridCell"===e.type.name);if(t&&m(s.resolve(t.pos),d)){let a=(0,n.q0)(t.pos,e);return a?{pos:t.pos,node:t.node,side:l,rect:a}:null}}return k?{pos:p.pos,rect:g,node:p.node,side:l}:null},m=(e,t)=>e.parent.canReplaceWith(e.index(),e.index(),t.nodes.gridCell),f=(e,t)=>e.parent.canReplaceWith(e.index(),e.indexAfter(),t.nodes.gridLayout),p=(e,t)=>t.nodes.gridCell.validContent(e.content),g=(e,t)=>t.nodes.gridLayout.validContent(e.content),h=e=>y(e,"gridLayout"),b=e=>{let t=y(e,"gridLayout");if(!t||!t.nodeAfter)throw Error();let l=t.nodeAfter,a=[],n=t.start(t.depth+1);for(let e=0;e{var l;if((null===(l=e.nodeAfter)||void 0===l?void 0:l.type.name)===t)return e;let a=e.doc;for(let l=e.depth;l>0;l--)if(e.node(l).type.name===t)return a.resolve(e.before(l));return null},v=(e,t)=>{let l=b(e),a=l[-1===t?l.length-1:t];return a?e.doc.resolve(a.pos):null},k=e=>b(e).findIndex(t=>t.pos===e.pos)},37672:(e,t,l)=>{"use strict";l.d(t,{N:()=>W});var a=l(13236),n=l(35864),o=l(69e3),i=l(81570),r=l(88957),s=l(77256),d=l(438),u=l(61690),c=l(95580),m=l(27042),f=l(22544),p=l(25845),g=l(43873),h=l(62216),b=l(90406),y=l(61128),v=l(50201);let k=e=>new i.k_({key:new i.hs("handleCmdClickLink"),props:{handleDOMEvents:{click:(t,l)=>{var a;let n=(0,r.KA)(),o=(0,u.nD)(n.getState()),i=null===(a=l.target)||void 0===a?void 0:a.closest("a"),s=null==i?void 0:i.href;if(!s||(null==i?void 0:i.closest("[data-comments-wrapper]")))return!1;l.preventDefault();let d=l.ctrlKey||l.metaKey,m=(0,c.Ww)(s),f=(0,u.bO)(n.getState()),p=(0,c.Cf)(s,f);if(o){if(!d)return!1;if(p)return(0,v.T)(e,l,m),!1}else if(!d&&p)return(0,v.T)(e,l,m),!1;return window.open(s,"_blank"),!1}}}});var w=l(31085),x=l(80532),S=l(61778),A=l(40173),C=l(92712),z=l(52177),I=l(27372),j=l(63373),F=l(14041),B=l(73893),R=l(4876),_=l(747),M=l(82257),E=l(58599),T=l(44507),O=l(62849),P=l(57750);let N=(0,I.P)(x.az),D=e=>{let{node:t,children:l}=e,{href:a,meta:n}=t.attrs,o=(0,M.oR)(),{linkUrl:i,handleClick:r}=(0,_.c)({url:a||""}),{interceptLinkClick:s,linkUrlSafe:d,isUntrusted:u,linkInterceptEnabled:c}=(0,R.i)(i),m=(0,F.useCallback)(e=>{if(null==r||r(e),c)return s(e)},[r,s,c]),{popperRef:f,referenceRef:p,isHovering:g,onMouseOver:h,onMouseOut:b,getPopperProps:y}=(0,O.bf)({disabled:(0,T.mG)()}),v=!o&&!B.$.GAMMA_CYPRESS_TEST&&(0,T.H8)();return(0,w.jsxs)(E.VR,{as:"span",children:[u?(0,w.jsx)(S.E,{as:"span",textDecoration:"underline",color:"gray.500",children:(0,w.jsx)(z.x6,{id:"b7jHrl"})}):(0,w.jsxs)(S.E,{as:"a",className:"link",rel:"noopener nofollow",href:c?d||"":i,onClick:m,onMouseOver:h,onMouseOut:b,ref:p,children:[v&&(0,w.jsx)("span",{contentEditable:!1,children:"​"}),o?l:(0,w.jsx)(E.$p,{as:"span"}),v&&(0,w.jsx)("span",{contentEditable:!1,children:"​"})]}),!1===o&&g&&i&&n?(0,w.jsx)(A.Z,{children:(0,w.jsx)(j.N,{children:(0,w.jsx)(N,{position:"relative",zIndex:"popover",ref:f,onMouseOver:h,onMouseOut:b,className:"link-preview-hover",...y(),...O._w,w:"min(500px, 80vw)",minW:"auto !important",children:(0,w.jsxs)(C.Q,{backgroundColor:"white",border:"1px solid",borderColor:"gray.200",shadow:"lg",borderRadius:"lg",_hover:{backgroundColor:"trueblue.50"},children:[(0,w.jsx)(P.Ch,{node:t}),(0,w.jsx)(C.r,{href:i,target:"_blank",rel:"noopener nofollow",onClick:m})]})})})}):null]})};var L=l(67408);let W=n.Ay.extend({priority:g.y.Link,inclusive:!1,excludes:"underline footnoteLabel link",addAttributes:()=>({href:{default:""},source:{},thumbnail:{...(0,c.tb)("thumbnail")},embed:{...(0,c.tb)("embed")},meta:{...(0,c.tb)("meta")}}),onCreate(){let e=(0,r.KA)().getState(),t=(0,u.nD)(e),l=(0,m.mB)(e);if(!(t&&l))return;let{view:a,state:n}=this.editor,{doc:o,schema:i,tr:s}=n;try{let e=!1;(0,d.Zo)(o,i.marks.link).forEach(t=>{let{node:l,pos:a}=t,n=l.marks.find(e=>"link"===e.type.name);n&&"string"!=typeof n.attrs.href&&(e=!0,s.removeMark(a,a+l.nodeSize,n).addMark(a,a+l.nodeSize,i.marks.link.create({...n.attrs,href:String(n.attrs.href)})))}),e&&a.dispatch(s)}catch(e){console.error("[Link.onCreate] error",e)}},renderHTML(e){var t;let{HTMLAttributes:l}=e;return"string"==typeof l.href&&(null===(t=l.href)||void 0===t?void 0:t.startsWith("javascript:"))?["a",(0,a.KV)(this.options.HTMLAttributes,{...l,href:""}),0]:l.href?["a",(0,a.KV)(this.options.HTMLAttributes,l),0]:["a",(0,a.KV)(this.options.HTMLAttributes,{...l,href:null}),0]},addCommands(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),convertLinkToMedia:e=>t=>{let{chain:l,editor:a}=t,{href:n,...o}=a.getAttributes("link");if(!n||(0,L.hc)(n))return!1;if(!o.source)return l().extendMarkRange("link").insertEmbedAndFetchMetadata(n,e,!1).run(),!0;let i=h.Fn[o.source],r=(null==i?void 0:i.nodeName)||"embed";return l().extendMarkRange("link").insertContent({type:r,attrs:{...o,sourceUrl:n,url:n,displayStyle:e}}).selectInsertedNode().run(),!0},convertMediaToLink:()=>e=>{let{state:t,chain:l}=e;if(!(t.selection instanceof i.nh))return!1;let{from:a,to:n,node:o}=t.selection;if(!(0,b._Y)(o))return!1;let{sourceUrl:r,meta:s}=o.attrs,d=(null==s?void 0:s.title)||r||"link",u={from:a+1,to:a+1+d.length};return l().insertContentAt({from:a,to:n},[{type:"paragraph",attrs:{},content:[{type:"text",text:d}]}],{updateSelection:!0}).setTextSelection(u).setMark(W.name,{...o.attrs,href:r}).run(),!0},convertLinkToButton:()=>e=>{let{editor:t,chain:l}=e,{href:a=""}=t.getAttributes("link");return l().extendMarkRange("link").deleteSelection().insertContentAndSelect((0,s.GO)().buttonGroup).updateAttributes("button",{href:a}).run(),!0},convertButtonToLink:()=>e=>{let{chain:t,state:l,editor:n}=e,{selection:i}=l,r=(0,a.KP)(e=>"button"===e.type.name)(i),s=(0,a.KP)(e=>"buttonGroup"===e.type.name)(i);if(!s||!r)return!1;let{node:d,pos:u}=r,{node:c,pos:m}=s;if(!d)return!1;let f={type:"paragraph",content:d.content.toJSON()},p=c.maybeChild(0)===d,g=p?m:u,h=g+(p?1:2),b=h+o.bP.fromJSON(n.schema,f).content.size,y=t();return 1===c.childCount?y.deleteNode("buttonGroup"):y.deleteNode("button"),y.insertContentAt(g,f,{updateSelection:!1}).setTextSelection({from:h,to:b}).setMark(W.name,{href:d.attrs.href}).focus().run(),!0},convertButtonToMedia:e=>t=>{let{chain:l,state:n}=t,{selection:o}=n,i=(0,a.KP)(e=>"button"===e.type.name)(o),r=(0,a.KP)(e=>"buttonGroup"===e.type.name)(o);if(!i||!r)return!1;let{node:s,pos:d}=i,{node:u,pos:c}=r;if(!s||!u)return!1;let{href:m}=s.attrs;if(!m||(0,L.hc)(m))return!1;if(u.maybeChild(0)===s){let t=[];u.forEach(e=>{"button"===e.type.name&&e!==s&&t.push(e.toJSON())});let a=l();a.setNodeSelection(c).deleteNode("buttonGroup").insertEmbedAndFetchMetadata(m,e,!1),1!==u.childCount&&t.length>0&&a.insertContentAt(c+1,{type:"buttonGroup",content:t},{updateSelection:!1}),a.focus().run()}else l().setNodeSelection(d).insertEmbedAndFetchMetadata(m,e,!1).selectInsertedNode().focus().run();return!0},convertMediaToButton:()=>e=>{let{chain:t,state:l}=e;if(!(l.selection instanceof i.nh))return!1;let{node:a}=l.selection;if(!(0,b._Y)(a))return!1;let{sourceUrl:n=""}=a.attrs;return t().deleteSelection().insertContentAt(l.selection.from,(0,s.GO)().buttonGroup).updateAttributes("button",{href:n}).focus().run(),!0},updateSurroundingLink:e=>t=>{let{state:l,chain:a,editor:n}=t,{from:o,to:i}=l.selection;return(0,L.uI)(e,n),a().extendMarkRange(W.name).unsetMark(W.name).setMark(W.name,{href:e}).setMeta("preventAutolink",!0).setTextSelection({from:o,to:i}),!0},removeSurroundingLink:()=>e=>{let{state:t,chain:l}=e,{from:a,to:n}=t.selection;return l().extendMarkRange("link").unsetMark("link").setMeta("preventAutolink",!0).setTextSelection({from:a,to:n}).focus(),!0}}},addKeyboardShortcuts(){return{"Mod-k":e=>{let{editor:t}=e,{selection:l}=t.state;return!l.empty&&t.commands.toggleMark(this.name)}}},addProseMirrorPlugins(){var e;let t=(null===(e=this.parent)||void 0===e?void 0:e.call(this))||[];return f.D1||t.push((0,p.f)(this,D)),t.push(k(this.editor)),t}}).configure({HTMLAttributes:{target:void 0,rel:"noopener noreferrer",class:"link"},validate:L.KB,protocols:y.r,linkOnPaste:!1})},61128:(e,t,l)=>{"use strict";l.d(t,{r:()=>a});let a=["tel","mailto"]},50201:(e,t,l)=>{"use strict";l.d(t,{T:()=>i});var a=l(83479),n=l(95580),o=l(38678);let i=(e,t,l)=>{if(!l)return;let i=(0,n.MY)(e,100);i&&(0,a.g5)({data:{fromPos:i.pos,fromPct:i.pct},emitChange:!1}),(0,o.o)({cardId:l,method:"push",data:{fromPos:null,fromPct:null}})}},67408:(e,t,l)=>{"use strict";l.d(t,{E0:()=>s,KB:()=>i,hc:()=>d,uI:()=>r});var a=l(66712),n=l(438),o=l(61128);let i=e=>!!e.includes("://"),r=(e,t)=>{d(e)||(0,a.Yq)(e,l=>{let{doc:a,schema:o,tr:i}=t.state;(0,n.Zo)(a,t.schema.marks.link).forEach(t=>{let{node:a,pos:n}=t,r=a.marks.find(t=>"link"===t.type.name&&t.attrs.href==e);r&&i.removeMark(n,n+a.nodeSize,r).addMark(n,n+a.nodeSize,o.marks.link.create({...r.attrs,...l}))}),t.view.dispatch(i)}).catch(e=>{console.error("[Link.fetchUrlThenUpdateMarks]",e)})},s=e=>e.attrs.source||e.attrs.meta||e.attrs.embed,d=e=>{if(!e)return!1;let t=e&&e.toLowerCase();for(let e of o.r)if(t.startsWith(e+":"))return!0;return!1}},90397:(e,t,l)=>{"use strict";l.d(t,{z:()=>f,J:()=>p});var a=l(13236);l(7496);var n=l(80096),o=l(81570),i=l(65998);let r=a.bP.create({name:"math_display",group:"block math",content:"text*",atom:!0,code:!0,renderHTML(e){let{HTMLAttributes:t}=e;return["math-display",(0,a.KV)(t,{class:"math-node"}),0]},parseHTML:()=>[{tag:"math-display"}]});var s=l(44916);let d=a.bP.create({name:"math_inline",group:"inline math",content:"text*",inline:!0,atom:!0,renderHTML(e){let{HTMLAttributes:t}=e;return["math-inline",(0,a.KV)(t,{class:"math-node"}),0]},parseHTML:()=>[{tag:"math-inline"}],addCommands(){return{insertMathInline:()=>e=>{let{state:t,dispatch:l,view:a}=e;return(0,s.CH)(this.type," ")(t,l,a)},convertToMathInline:()=>e=>{let{state:t,chain:l}=e,a=t.doc.textBetween(t.selection.from,t.selection.to);return l().insertContent({type:"math_inline",content:[{type:"text",text:a}]}).run(),!0}}}}),u=/\$([^ $]+)\$[ ]$/,c=/^\${2}\s+$/,m=/^\${2}(.+)\${2}$/,f=a.YY.create({name:"math",addExtensions:()=>[d,r],addProseMirrorPlugins(){let e=i.of.get("math")?[new o.k_({props:{clipboardTextSerializer:e=>s.ju.serializeSlice(e)}}),(0,n.sM)({rules:[(0,s.sV)(c,this.editor.schema.nodes.math_display),(0,s.sV)(m,this.editor.schema.nodes.math_display),(0,s.C1)(u,this.editor.schema.nodes.math_inline)]})]:[];return[(0,s.CO)({undo:()=>this.editor.commands.undo(),redo:()=>this.editor.commands.redo()})].concat(e)}}),p=e=>"math_display"===e.type.name||"math_inline"===e.type.name},44916:(e,t,l)=>{"use strict";let a;l.d(t,{CH:()=>C,sV:()=>x,C1:()=>w,o6:()=>y,CO:()=>f,ju:()=>I});var n=l(81570),o=l(73686),i=l(11329),r=l(60703),s=l(25715);function d(e,t,l){let a=!(arguments.length>3)||void 0===arguments[3]||arguments[3];return(o,i)=>{let r=e.state,{to:s,from:d}=r.selection,{to:u,from:c}=o.selection;if(a&&u!==c)return!1;let m=t>0?u:c;if(l){let e=o.doc.nodeSize-2;if(t>0&&m0)return!1}return i&&(e.dispatch(r.tr.setSelection(n.U3.create(r.doc,t>0?s:d))),e.focus()),!0}}class u{destroy(){this.closeEditor(!1),this._mathRenderElt&&(this._mathRenderElt.remove(),delete this._mathRenderElt),this._mathSrcElt&&(this._mathSrcElt.remove(),delete this._mathSrcElt),this.dom.remove()}ensureFocus(){this._innerView&&this._outerView.hasFocus()&&this._innerView.focus()}update(e,t){if(!e.sameMarkup(this._node))return!1;if(this._node=e,this._innerView){let t=this._innerView.state,l=e.content.findDiffStart(t.doc.content);if(null!=l){let a=e.content.findDiffEnd(t.doc.content);if(a){let{a:n,b:o}=a,i=l-Math.min(n,o);i>0&&(n+=i,o+=i),this._innerView.dispatch(t.tr.replace(l,o,e.slice(l,n)).setMeta("fromOutside",!0))}}}return this._isEditing||this.renderMath(),!0}updateCursorPos(e){let t=this._getPos(),l=this._node.nodeSize;e.selection.from0&&null!==e[0].textContent&&(t=e[0].textContent.trim()),t.length<1){for(this.dom.classList.add("empty-math");this._mathRenderElt.firstChild;)this._mathRenderElt.firstChild.remove();return}if(this.dom.classList.remove("empty-math"),!a){this._mathRenderElt.textContent=t;return}try{a.render(t,this._mathRenderElt,this._katexOptions),this._mathRenderElt.classList.remove("parse-error"),this.dom.setAttribute("title","")}catch(e){if(e instanceof Error)console.error(e),this._mathRenderElt.classList.add("parse-error"),this.dom.setAttribute("title",e.toString());else throw e}}dispatchInner(e){if(!this._innerView)return;let{state:t,transactions:l}=this._innerView.state.applyTransaction(e);if(this._innerView.updateState(t),!e.getMeta("fromOutside")){let e=this._outerView.state.tr,t=i.Lm.offset(this._getPos()+1);for(let a=0;a(t&&t(e.tr.insertText(" ")),!0),Backspace:(0,s.st)(s.ic,(e,t,l)=>!!e.selection.empty&&!(this._node.textContent.length>0)&&(this._outerView.dispatch(this._outerView.state.tr.insertText("")),this._outerView.focus(),!0)),"Ctrl-Backspace":(e,t,l)=>(this._outerView.dispatch(this._outerView.state.tr.insertText("")),this._outerView.focus(),!0),Enter:(0,s.st)(s.pC,d(this._outerView,1,!1)),"Ctrl-Enter":d(this._outerView,1,!1),ArrowLeft:d(this._outerView,-1,!0),ArrowRight:d(this._outerView,1,!0),ArrowUp:d(this._outerView,-1,!0),ArrowDown:d(this._outerView,1,!0),"Mod-z":this._options.undo,"Shift-Mod-z":this._options.redo})]}),dispatchTransaction:this.dispatchInner.bind(this)});let t=this._innerView.state;this._innerView.focus();let l=null===(e=this._mathPluginKey.getState(this._outerView.state))||void 0===e?void 0:e.prevCursorPos;null==l&&console.error("[prosemirror-math] Error: Unable to fetch math plugin state from key.");let a=(null!=l?l:0)<=this._getPos()?0:this._node.nodeSize-2;this._innerView.dispatch(t.tr.setSelection(n.U3.create(t.doc,a))),this._isEditing=!0}closeEditor(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this._innerView&&(this._innerView.destroy(),this._innerView=void 0),e&&this.renderMath(),this._isEditing=!1}constructor(e,t,n,o={},i,r){l.e(4852).then(l.bind(l,9263)).then(e=>{a=e.default,this.renderMath()}),this._node=e,this._outerView=t,this._getPos=n,this._onDestroy=r&&r.bind(this),this._mathPluginKey=i,this.cursorSide="start",this._isEditing=!1,this._options=o,this._katexOptions=Object.assign({globalGroup:!0,throwOnError:!1},o.katexOptions),this._tagName=o.tagName||this._node.type.name.replace("_","-"),this.dom=document.createElement(this._tagName),this.dom.classList.add("math-node"),this._mathRenderElt=document.createElement("span"),this._mathRenderElt.textContent="",this._mathRenderElt.classList.add("math-render"),this.dom.appendChild(this._mathRenderElt),this._mathSrcElt=document.createElement("span"),this._mathSrcElt.classList.add("math-src"),this.dom.appendChild(this._mathSrcElt),this.dom.addEventListener("click",()=>this.ensureFocus()),this.renderMath()}}let c=new n.hs("prosemirror-math");function m(e,t){return(l,a,n)=>{let o=c.getState(a.state);if(!o)throw Error("no math plugin!");let i=o.activeNodeViews,r=new u(l,a,n,{katexOptions:{displayMode:e,macros:o.macros},...t},c,()=>{i.splice(i.indexOf(r))});return i.push(r),r}}let f=e=>new n.k_({key:c,state:{init:(e,t)=>({macros:{},activeNodeViews:[],prevCursorPos:0}),apply:(e,t,l,a)=>({activeNodeViews:t.activeNodeViews,macros:t.macros,prevCursorPos:l.selection.from})},props:{nodeViews:{math_inline:m(!1,e),math_display:m(!0,e)}}});var p=l(69e3);function g(e){var t;let l=e.querySelector("img.mwe-math-fallback-image-inline[alt]");return null!==(t=null==l?void 0:l.getAttribute("alt"))&&void 0!==t&&t}function h(e){var t;let l=e.querySelector("math[alttext]");return null!==(t=null==l?void 0:l.getAttribute("alttext"))&&void 0!==t&&t}function b(e){var t;let l=e.querySelector("math annotation[encoding='application/x-tex'");return null!==(t=null==l?void 0:l.textContent)&&void 0!==t&&t}let y=(()=>["p",0],(e,t)=>{let{$from:l}=e.selection,a=l.nodeBefore;if(!a)return!1;if("math_inline"==a.type.name){let a=l.index(l.depth),o=e.doc.resolve(l.posAtIndex(a-1));return t&&t(e.tr.setSelection(new n.nh(o))),!0}return a.type.name,!1});var v=l(80096);let k=/\$(.+)\$/;function w(e,t,l){return new v.fV(e,(e,a,n,o)=>{let i=e.doc.resolve(n),r=i.index(),s=e.doc.resolve(o),d=l instanceof Function?l(a):l;if(!i.parent.canReplaceWith(r,s.index(),t))return null;let u=[t.create(d,t.schema.text(a[1]))];return a[0].endsWith(" ")&&" "!==e.doc.textBetween(o,o+1)&&u.push(t.schema.text(" ")),e.tr.replaceWith(n,o,u)})}function x(e,t,l){return new v.fV(e,(e,a,o,i)=>{let r=e.doc.resolve(o),s=l instanceof Function?l(a):l;if(!r.node(-1).canReplaceWith(r.index(-1),r.indexAfter(-1),t))return null;let d=e.tr.delete(o,i).setBlockType(o,o,t,s);return a[1]&&d.insertText(a[1],o,o),d.setSelection(n.nh.create(d.doc,d.mapping.map(r.pos-1)))})}(()=>{try{return RegExp("(?{let{from:t,to:l}=e.selection,a=e.selection.content().content,n=[];return a.descendants((e,l,a)=>"text"!=e.type.name&&(!e.type.name.startsWith("math_")||(n.push({start:Math.max(t+l-1,0),end:t+l+e.nodeSize-1}),!1))),o.zF.create(e.doc,n.map(e=>{let{start:t,end:l}=e;return o.NZ.node(t,l,{class:"math-select"})}))},A=new n.k_({state:{init:(e,t)=>S(t),apply:(e,t)=>e.selection&&e.selectionSet?S(e):t},props:{decorations:e=>A.getState(e)}});function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return function(l,a){let{$from:o}=l.selection,i=o.index();if(!o.parent.canReplaceWith(i,i,e))return!1;if(a){let i=e.create({},t?l.schema.text(t):null),r=l.tr.replaceSelectionWith(i);a(r=r.setSelection(n.nh.create(r.doc,o.pos)))}return!0}}class z{serializeFragment(e){let t;let l="",a=!0,n=e.size;return e.nodesBetween(0,n,(e,o)=>{let i=this.serializeNode(e);if(null!==i)return l+=i,!1;if(e.isText){var r;l+=(null===(r=e.text)||void 0===r?void 0:r.slice(Math.max(0,o)-o,n-o))||"",a=!1}else e.isLeaf&&t?(l+=t,a=!1):!a&&e.isBlock&&(l+="\n\n",a=!0)},0),l}serializeSlice(e){return this.serializeFragment(e.content)}serializeNode(e){let t=this.nodes[e.type.name];return void 0!==t?t(e):null}constructor(e,t){this.nodes={...null==t?void 0:t.nodes,...e.nodes},this.marks={...null==t?void 0:t.marks,...e.marks}}}let I=new z({nodes:{math_inline:e=>"$".concat(e.textContent,"$"),math_display:e=>"\n\n$$\n".concat(e.textContent,"\n$$")}})},35923:(e,t,l)=>{"use strict";l.d(t,{BF:()=>L,lw:()=>eI,M9:()=>eB});var a=l(31085),n=l(61778),o=l(26848),i=l(20501),r=l(3040),s=l(95986),d=l(52177),u=l(13236),c=l(14041),m=l(22844),f=l(88957),p=l(82257),g=l(80532),h=l(24221);let b={card:i.vti,doc:i.vGi,user:i.Hzw},y=e=>{let{type:t}=e,l=b[t];return(0,a.jsx)(g.az,{as:"span",display:"inline-flex",className:"mention",minW:"5em",opacity:"0.6",borderRadius:"sm",color:"gray.800",children:(0,a.jsx)(g.az,{display:"inline-flex",py:"0.125em",children:(0,a.jsx)(h.g,{icon:l,style:{marginLeft:"0.5em",alignSelf:"center"}})})})};var v=l(50201),k=l(58599),w=l(61690),x=l(30503),S=l(92405),A=l(43873),C=l(7263),z=l(29362);let I=e=>{let{filterFn:t,getAttributesFn:l}=e;return e=>(function(e){let{type:t}=e;if(!t.isInline)throw Error("[nodePasteRule] This paste rule was only designed to consider inline nodes.");return new u._n({find:e.find,handler:t=>{let{state:l,range:a,match:n}=t,{tr:o}=l,i=a.from,r=a.to,s=(0,u.gk)(e.getAttributes,void 0,n)||{};o.replaceWith(i,r,e.type.create(s))}})})({find:e=>{let l=[...e.matchAll(S.D_)];return l?l.map(e=>{var t;return{index:null!==(t=e.index)&&void 0!==t?t:-1,text:e[0],match:e}}).filter(e=>{let l=(0,S.TY)(e.text),{cardId:a}=(0,S.$9)(e.text);return t(l,a,e)}):[]},type:e,getAttributes:e=>{let t=(0,S.TY)(e[0]),{cardId:a}=(0,S.$9)(e[0]);return l({match:e,docId:t,cardId:a})}})};var j=l(62313),F=l(3706),B=l(43342),R=l(34747),_=l.n(R),M=l(73893);let E={borderRadius:"md",padding:"0.05em 0.1em",display:"inline",color:"gray.800"},T=(0,c.forwardRef)((e,t)=>{let{mentionLabel:l,mentionIcon:o,mentionTargetUrl:i,onClick:r,hasError:s=!1,isSimpleLinkVersion:d=!1,...u}=e,c=d?_():"span";return(0,a.jsxs)(g.az,{ref:t,position:"relative","data-selection-ring":!0,className:"mention",onClick:r,...E,color:s?"gray.600":E.color,...u,as:c,href:d?i:void 0,cursor:r||d?"pointer":"default",children:[(0,a.jsxs)(j.z,{display:"inline-flex",spacing:0,children:[o&&(0,a.jsx)(g.az,{display:"inline-block",textAlign:"center",minWidth:4,children:(0,a.jsx)(h.g,{icon:o,fixedWidth:!0,size:"sm",style:{marginLeft:"0.1em",marginRight:"0.3em"}})}),(0,a.jsx)(n.E,{noOfLines:1,whiteSpace:"normal",wordBreak:"break-all",flex:1,lineHeight:"normal",children:l})]}),M.$.GAMMA_PUPPETEER_SERVICE&&i&&(0,a.jsx)(F.N,{href:i,h:"100%",w:"100%",position:"absolute",zIndex:"-10","data-pdf-link":!0,top:"0",left:"0"})]})});T.displayName="MentionTag";let O=()=>(0,a.jsx)(g.az,{as:"span",className:"mention",...E,children:(0,a.jsx)(B.y,{size:"xs",opacity:"0.8",margin:"0 0.1em"})}),P="Untitled",N=e=>{let{node:t,editor:l}=e,{id:u,docId:g}=t.attrs,h=(0,f.GV)((0,m.F1)(u)),b=(0,f.GV)(w.bO).includes(u),y=(0,f.GV)(w.nD);(0,c.useEffect)(()=>{l.storage[L.name][u]=h},[h,l.storage,u]);let A=(0,c.useCallback)(e=>{(0,v.T)(l,e,u)},[l,u]),C=(0,p.oR)(),z=(0,c.useMemo)(()=>{let e=(0,S.Io)({cardId:u,docId:g||l.gammaDocId});return C?(0,x.M7)({url:e}):e},[u,g,l,C]);return(0,a.jsx)(k.VR,{as:"span",children:b?(0,a.jsx)(T,{"data-testid":"card-mention",onClick:y?void 0:A,onDoubleClick:y?A:void 0,mentionLabel:h||P,mentionIcon:i.vti,mentionTargetUrl:z}):(0,a.jsx)(s.Tz,{label:(0,a.jsx)(n.E,{children:(0,a.jsx)(d.x6,{id:"HAIPtO",components:{0:(0,a.jsx)(o.u,{fontSize:"sm",color:"blackAlpha.800"})}})}),children:(0,a.jsx)(T,{"data-testid":"card-mention",hasError:!0,mentionLabel:"Cannot find referenced card",mentionIcon:r.AEl})})})},D=e=>(0,a.jsx)(k.VR,{as:"span",children:(0,a.jsx)(y,{type:"card"})}),L=u.bP.create({name:"cardMention",addStorage:()=>({}),addOptions:()=>({HTMLAttributes:{},suggestion:{char:C.A}}),priority:A.y.CardMention,group:"inline",inline:!0,selectable:!0,atom:!0,addAttributes:()=>({id:{default:null},docId:{default:null},mentionedById:{default:null}}),addPasteRules(){return[I({filterFn:(e,t)=>e===this.editor.gammaDocId&&!!t,getAttributesFn:e=>{let{docId:t,cardId:l}=e;return{id:l,docId:t}}})(this.type)]},addCommands(){return{addCardMention:(e,t)=>{let{id:l,docId:a,mentionedById:n}=e;return e=>{var o;let{state:i,chain:r}=e,s=i.selection.$to.nodeAfter;return(null==s?void 0:null===(o=s.text)||void 0===o?void 0:o.startsWith(" "))&&(t.to+=1),r().focus().insertContentAt(t,[{type:this.name,attrs:{id:l,docId:a,mentionedById:n}},{type:"text",text:" "}]).run(),!0}}}},parseHTML(){return[{tag:'a[data-type="'.concat(this.name,'"]'),priority:51}]},renderHTML(e){let{HTMLAttributes:t,node:l}=e,{id:a,docId:n}=l.attrs,o=this.storage[a]||P;return["a",(0,u.KV)({"data-type":this.name,href:(0,S.Io)({docId:n,cardId:a})},this.options.HTMLAttributes,t),o]},renderText(e){let{node:t}=e,{id:l,docId:a}=t.attrs,n=this.storage[l]||P,o=(0,S.Io)({docId:a,cardId:l});return"[".concat(n,"](").concat(o,")")},addNodeView(){return this.editor.isThumbnail?(0,k.gu)(D,{update:z.z0}):(0,k.gu)(N,{update:z.z0})}});var W=l(39286);let U="docMention";var G=l(40173),H=l(27372),V=l(92712),q=l(31595),K=l(76003),J=l(25420),$=l(25676),Q=l(18651),Y=l(18201),X=l(12327),Z=l(14979),ee=l(44507),et=l(62849);let el=e=>e&&e.length?e:X.Ru._({id:"7ZviFu",values:{GAMMA_ARTIFACT_PROPER_NOUN:W.TP}}),ea=e=>{let{createdByName:t,createdByProfileImageUrl:l,createdByYou:o,timestampDescription:i}=e;return(0,a.jsxs)(J.s,{align:"center",children:[(0,a.jsx)(s.Vc,{size:"xs",fontSize:"xs",name:t,src:l,tooltipProps:{placement:"top"}}),(0,a.jsxs)(g.az,{marginInlineStart:2,marginInlineEnd:2,w:"100%",children:[(0,a.jsx)(n.E,{noOfLines:1,fontSize:"xs",w:"100%",wordBreak:"break-all",children:o?(0,a.jsx)(d.x6,{id:"WZTg05"}):(0,a.jsx)(d.x6,{id:"pS1F3d",values:{createdByName:t}})}),i&&(0,a.jsx)(n.E,{noOfLines:1,fontSize:"11px",color:"gray.400",children:i})]})]})};var en=l(78872),eo=l(32202),ei=l(33023),er=l(63341),es=l(18528),ed=l(9021),eu=l(72821),ec=l(81575),em=l(33683);let ef=e=>{let{href:t,title:l,createdByName:o,createdByEmail:u,createdTime:c,isDuplicateEnabled:m,isRenameEnabled:f,isShareEnabled:p,isTrashed:b,isFavorited:y,isTrashAndRestoreEnabled:v,isRemoveFromChannelEnabled:k,onDuplicate:w,onFavorite:x,onUnfavorite:S,onTrash:A,onPermanentDelete:C,onRestore:z,onShareClick:I,onRename:j,onRemoveFromChannel:F}=e,{onCopy:B}=(0,en.i)("".concat(window.location.origin).concat(t)),R=(0,eo.d)(),{isOpen:_,onOpen:M,onClose:E}=(0,ei.j)();return(0,a.jsxs)(er.W,{isLazy:!0,closeOnSelect:!1,modifiers:[{name:"flip",enabled:!0,options:{fallbackPlacements:["bottom","bottom-start","bottom-end","right-start","left-start","right-end","left-end"]}}],children:[(0,a.jsx)(es.I,{"data-dashboard-doc-menu":!0,as:ed.K,size:"xs",variant:"ghost",borderRadius:"full",onClick:M,icon:(0,a.jsx)(h.g,{fixedWidth:!0,icon:i.vHW}),color:"gray.400",_hover:{color:"gray.800",bg:"gray.200"},children:(0,a.jsx)(d.x6,{id:"7L01XJ"})}),_&&(0,a.jsx)(G.Z,{children:(0,a.jsxs)(eu.c,{maxW:"sm",zIndex:"overlay",children:[(0,a.jsxs)(g.az,{px:4,py:0,wordBreak:"break-word",children:[(0,a.jsx)(n.E,{children:l}),(0,a.jsx)(n.E,{fontSize:"sm",color:"gray.500",noOfLines:1,children:(0,a.jsx)(d.x6,{id:"MXSt4t",values:{0:(0,Z.Yq)(c,"MMMM do, yyyy")}})}),u&&o&&(0,a.jsx)(s.Tz,{label:u,children:(0,a.jsx)(n.E,{display:"inline-block",fontSize:"sm",color:"gray.500",noOfLines:1,children:(0,a.jsx)(d.x6,{id:"Wpe4mQ",values:{createdByName:o}})})})]}),(p||f||k)&&(0,a.jsx)(ec.N,{}),k&&(0,a.jsx)(em.D,{onClick:F,icon:(0,a.jsx)(h.g,{fixedWidth:!0,icon:i.Dfk}),children:(0,a.jsx)(d.x6,{id:"bv+Frh"})}),p&&(0,a.jsx)(em.D,{onClick:I,icon:(0,a.jsx)(h.g,{fixedWidth:!0,icon:i.t5Z}),children:(0,a.jsx)(d.x6,{id:"iyga2M"})}),f&&(0,a.jsx)(em.D,{onClick:j,icon:(0,a.jsx)(h.g,{fixedWidth:!0,icon:i.tAZ}),children:(0,a.jsx)(d.x6,{id:"Cg4Iup"})}),(0,a.jsx)(ec.N,{}),x?y?(0,a.jsx)(em.D,{icon:(0,a.jsx)(g.az,{color:"yellow.400",children:(0,a.jsx)(h.g,{fixedWidth:!0,icon:r.yy})}),onClick:S,children:(0,a.jsx)(d.x6,{id:"T/pF0Z"})}):(0,a.jsx)(em.D,{icon:(0,a.jsx)(h.g,{fixedWidth:!0,icon:i.yy}),onClick:x,children:(0,a.jsx)(d.x6,{id:"pBsoKL"})}):null,m&&!!w&&(0,a.jsx)(em.D,{icon:(0,a.jsx)(h.g,{fixedWidth:!0,icon:i.$3n}),onClick:w,children:(0,a.jsx)(d.x6,{id:"euc6Ns"})}),(0,a.jsx)(em.D,{icon:(0,a.jsx)(h.g,{fixedWidth:!0,icon:i.gnH}),onClick:()=>{B(),R({title:(0,a.jsx)(d.x6,{id:"h5GS+N"}),status:"success",duration:3e3,position:"top"})},children:(0,a.jsx)(d.x6,{id:"y1eoq1"})}),v&&(0,a.jsx)(ec.N,{}),v?b?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(em.D,{icon:(0,a.jsx)(h.g,{fixedWidth:!0,icon:r.ub2}),onClick:z,children:(0,a.jsx)(d.x6,{id:"yKu/3Y"})}),C&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ec.N,{}),(0,a.jsx)(em.D,{color:"red",icon:(0,a.jsx)(h.g,{fixedWidth:!0,icon:i.bnw}),onClick:C,children:(0,a.jsx)(d.x6,{id:"0Lbaux"})})]})]}):(0,a.jsx)(em.D,{color:"red",icon:(0,a.jsx)(h.g,{fixedWidth:!0,icon:i.yLS}),onClick:()=>{E(),null==A||A()},children:(0,a.jsx)(d.x6,{id:"1C/Yjq"})}):null]})})]})},ep=e=>{let{isFavorited:t,onFavorite:l,onUnfavorite:n,disableInteractions:o=!1,...u}=e,[m,f]=(0,c.useState)(!1),p=(0,c.useCallback)(()=>{if(!l||!n){console.error("[FavoriteButton] onFavorite or onUnfavorite is not defined");return}t?(f(!1),n()):(f(!0),setTimeout(()=>{f(!1)},1e3),l())},[t,l,n]);return(0,a.jsx)(s.Tz,{label:t?(0,a.jsx)(d.x6,{id:"T/pF0Z"}):(0,a.jsx)(d.x6,{id:"pBsoKL"}),placement:"top",children:(0,a.jsx)(ed.K,{...u,...o?{tabIndex:-1,pointerEvents:"none"}:{},zIndex:"1","data-favorite-button":!0,"aria-label":X.Ru._({id:"pBsoKL"}),className:"star-wrapper ".concat(m?"active":""),onClick:p,variant:"ghost",size:"xs",color:t?"yellow.400":"gray.400",_hover:{color:t?"yellow.500":"gray.400",bg:t?void 0:"blackAlpha.100"},bg:t?"yellow.50":"transparent",borderRadius:"full",icon:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h.g,{icon:t?r.yy:i.yy}),(0,a.jsxs)(g.az,{fontSize:"2.5px",children:[(0,a.jsxs)("div",{className:"star",children:[(0,a.jsx)("div",{className:"tl"}),(0,a.jsx)("div",{className:"tr"}),(0,a.jsx)("div",{className:"bl"}),(0,a.jsx)("div",{className:"br"})]}),(0,a.jsx)("div",{className:"ring"}),(0,a.jsx)("div",{className:"circles"})]})]})})})},eg=e=>{let{href:t,NextLink:l,target:n,children:o}=e;return l?(0,a.jsx)(l,{href:t,passHref:!0,target:n,legacyBehavior:!0,children:(0,a.jsx)(V.r,{outline:"none",children:o})}):(0,a.jsx)(V.r,{outline:"none",href:t,target:n,children:o})},eh=c.forwardRef((e,t)=>{let{id:l,title:o,thumbnailImageUrl:i,NextLink:r,href:d,createdByYou:u=!1,createdByName:c,createdByEmail:m,createdTime:f,createdByProfileImageUrl:p,timestampDescription:h,editors:b,isDuplicateEnabled:y=!0,isRenameEnabled:v=!1,isShareEnabled:k=!1,isTrashAndRestoreEnabled:w=!0,isRemoveFromChannelEnabled:x=!1,isTrashed:S=!1,isFavorited:A=!1,onDuplicate:C,onFavorite:z,onUnfavorite:I,onTrash:j,onPermanentDelete:F,onRestore:B,onShareClick:R,onRename:_,onRemoveFromChannel:M,context:E="grid",tags:T=[],menuEnabled:O=!1,openInNewWindow:P=!1,activity:N,isOffline:D,...L}=e,W=(0,et.En)(),U=P?"_blank":void 0,G=b&&b.length>0&&(0,a.jsx)(q.Z,{size:"xs",max:5,fontSize:"xs",children:b.map(e=>(0,a.jsx)(s.Vc,{shadow:"md",borderWidth:"1px",name:W?X.Ru._({id:"bxVoEp",values:{0:e.user.displayName,1:(0,Z.Gx)(e.lastEdited)}}):" ",src:e.user.profileImageUrl,tooltipProps:{placement:"top"}},"".concat(l,"-").concat(e.user.id)))});return(0,a.jsx)(V.Q,{overflow:"hidden",ref:t,"data-doc-grid-item-id":l,bg:"linen.50",borderRadius:"5px",shadow:"md",as:K.E,_focusWithin:{shadow:"outline",_hover:{shadow:"outline"}},cursor:"pointer",_hover:{shadow:"lg",bgColor:"popover"===E?"white":"gray.100"},transition:"box-shadow .2s ease",role:"group",className:"highlight-mask",...L,children:(0,a.jsxs)(J.s,{direction:"column",wordBreak:"break-word",alignContent:"space-between",height:"100%",children:[i&&(0,a.jsx)(eg,{NextLink:r,href:d,target:U,children:(0,a.jsx)($.g,{ratio:40/21,bgColor:"gray.100",children:(0,a.jsxs)(J.s,{borderBottomWidth:"1px",borderBottomColor:"gray.100",children:[(0,a.jsx)(Q._,{src:null==i?void 0:i.src,fallbackSrc:null==i?void 0:i.fallbackSrc,fit:"cover"}),!!G&&(0,a.jsx)(g.az,{position:"absolute",right:0,bottom:0,borderRadius:"full",p:3,zIndex:1,children:G})]})})}),(0,a.jsxs)(J.s,{p:3,position:"relative",direction:"column",justifyContent:"space-between",h:"100%",alignItems:"flex-start",children:[(0,a.jsx)(eg,{NextLink:r,href:d,target:U,children:(0,a.jsx)(n.E,{noOfLines:2,h:12,mb:2,children:el(o)})}),(0,a.jsxs)(J.s,{direction:"column",w:"100%",children:[T&&T.length>0&&r&&(0,a.jsx)(s.Op,{tags:T,NextLink:r,overflowButtonLabel:X.Ru._({id:"K0UBDD"}),isDisabled:D}),(0,a.jsxs)(J.s,{mt:2,align:"flex-start",w:"100%",justify:"space-between",children:[N&&N,c&&(0,a.jsx)(ea,{createdByYou:u,createdByName:c,createdByProfileImageUrl:p,timestampDescription:h}),(0,a.jsx)(Y.h,{}),O&&(0,a.jsx)(ef,{href:d,title:el(o),createdByName:c,createdByEmail:m,createdTime:f,isDuplicateEnabled:y,isRenameEnabled:v,isShareEnabled:k,isTrashAndRestoreEnabled:w,isRemoveFromChannelEnabled:x,isTrashed:S,isFavorited:A,onDuplicate:C,onFavorite:z,onUnfavorite:I,onTrash:j,onPermanentDelete:F,onRestore:B,onShareClick:R,onRename:_,onRemoveFromChannel:M})]})]})]}),!!z&&!!I&&(0,a.jsx)(g.az,{position:"absolute",top:3,right:3,zIndex:3,children:(0,a.jsx)(ep,{isFavorited:A,onFavorite:z,onUnfavorite:I,opacity:A?1:(0,ee.Xb)()?1:0,_groupHover:(0,ee.Xb)()||D&&!A?void 0:{opacity:1},_focus:D?void 0:{opacity:1,shadow:"outline"},disableInteractions:D})})]})},l)});eh.displayName="DocumentGridItem";var eb=l(46210),ey=l(77914),ev=l(65998),ek=l(747),ew=l(60490);let ex="Private ".concat(W.TP),eS=(0,H.P)(g.az),eA=e=>{var t,l;let{node:n,editor:o}=e,{id:r}=n.attrs,u=(0,ev.u)("screenshotsEnabled"),m=(0,p.oR)(),{user:f}=(0,ew.ur)(),[g]=(0,ey.D7K)(),h=(0,et.En)(),{data:b,error:y,loading:v,subscribeToMore:w}=(0,ey.AZr)({variables:{id:r},skip:m||!r}),x=!!(!m&&f);(0,c.useEffect)(()=>{if(x)return w({document:ey.Tyz,variables:{id:r},updateQuery:(e,t)=>{let{subscriptionData:l}=t;return l.data&&l.data.doc?{doc:{...e.doc,...l.data.doc,__typename:"Doc"}}:e}})},[r,w,x]);let{title:A,createdTime:C,createdBy:z,editedTime:I,editors:j,docUser:F}=(null==b?void 0:b.doc)||{},{linkUrl:B,handleClick:R}=(0,ek.c)({url:(0,S.LN)({docId:r,docTitle:A,absolute:!0}),nonPublishedUrl:(0,S.LN)({docId:r,docTitle:A})});(0,c.useEffect)(()=>{o.storage[U][r]=y?ex:A},[A,o.storage,r,y]);let _={src:u?null==b?void 0:null===(l=b.doc)||void 0===l?void 0:null===(t=l.titleCard)||void 0===t?void 0:t.previewUrl:eb.A.src,fallbackSrc:eb.A.src},M=e=>()=>{if(!f)return;let t={input:{docId:r,userId:f.id,favorited:e}};g({variables:t,update:(e,t)=>{let{data:l}=t;e.writeFragment({id:"Doc:".concat(r),fragment:ey.pfv,data:{docUser:null==l?void 0:l.updateDocUser}})},optimisticResponse:{updateDocUser:{...F,favorited:t.input.favorited,__typename:"DocUser"}}})},{popperRef:E,referenceRef:P,isHovering:N,onMouseOver:D,onMouseOut:L,getPopperProps:H}=(0,et.bf)();return(0,a.jsxs)(k.VR,{as:"span",children:[v?(0,a.jsx)(O,{}):B?(0,a.jsx)(T,{onMouseOver:m?void 0:D,onMouseOut:m?void 0:L,onClick:R,ref:P,isSimpleLinkVersion:m,mentionLabel:A||"",mentionIcon:i.vGi,mentionTargetUrl:B}):y?(0,a.jsx)(s.Tz,{label:"You don't have access to the linked ".concat(W.TP,". Try asking the owner of this ").concat(W.TP," for access."),children:(0,a.jsx)(T,{hasError:!0,mentionLabel:ex,mentionIcon:i.DW4})}):null,(0,a.jsx)(G.Z,{children:N&&b&&b.doc&&!m&&(0,a.jsx)(eS,{width:"320px","data-target-name":"doc-mention-popup",border:"1px solid",borderColor:"gray.200",borderRadius:"lg",overflow:"hidden",shadow:"lg",maxW:"80vw",zIndex:"tooltip",ref:E,onMouseOver:D,onMouseOut:L,...H(),...et._w,children:(0,a.jsx)(eh,{createdByYou:(null==z?void 0:z.id)===(null==f?void 0:f.id),title:A||"",timestampDescription:h?(0,a.jsx)(d.x6,{id:"yxz5Og",values:{0:(0,Z.Bo)(I)}}):"---",NextLink:null,href:B,onClick:R,id:r,createdByName:(null==z?void 0:z.displayName)||"",createdByEmail:(null==z?void 0:z.email)||"",createdByProfileImageUrl:(null==z?void 0:z.profileImageUrl)||"",createdTime:C,thumbnailImageUrl:_,editors:j,isFavorited:!!(null==F?void 0:F.favorited),onFavorite:M(new Date),onUnfavorite:M(null),menuEnabled:!1,openInNewWindow:!0})})})]})},eC=e=>(0,a.jsx)(k.VR,{as:"span",children:(0,a.jsx)(y,{type:"doc"})}),ez="Unknown ".concat(W.TP),eI=u.bP.create({name:U,addStorage:()=>({}),addOptions:()=>({HTMLAttributes:{},suggestion:{char:C.A}}),priority:A.y.DocMention,group:"inline",inline:!0,selectable:!0,atom:!0,addAttributes:()=>({id:{default:null},mentionedById:{default:null}}),addPasteRules(){return[I({filterFn:(e,t)=>e!==this.editor.gammaDocId||!t,getAttributesFn:e=>{let{docId:t}=e;return{id:t}}})(this.type)]},addCommands(){return{addDocMention:(e,t)=>{let{id:l,mentionedById:a}=e;return e=>{var n;let{state:o,chain:i}=e,r=o.selection.$to.nodeAfter;return(null==r?void 0:null===(n=r.text)||void 0===n?void 0:n.startsWith(" "))&&(t.to+=1),i().focus().insertContentAt(t,[{type:this.name,attrs:{id:l,mentionedById:a}},{type:"text",text:" "}]).run(),!0}}}},parseHTML(){return[{tag:'a[data-type="'.concat(this.name,'"]'),priority:51}]},renderHTML(e){let{HTMLAttributes:t,node:l}=e,a=this.storage[l.attrs.id]||ez;return["a",(0,u.KV)({"data-type":this.name,href:(0,S.LN)({docId:l.attrs.id,absolute:!0})},this.options.HTMLAttributes,t),a]},renderText(e){let{node:t}=e,l=this.storage[t.attrs.id]||ez,a=(0,S.LN)({docId:t.attrs.id,absolute:!0});return"[".concat(l,"](").concat(a,")")},addNodeView(){return this.editor.isThumbnail?(0,k.gu)(eC,{update:z.z0}):(0,k.gu)(eA,{update:z.z0})}}),ej=e=>{let{node:t}=e,{label:l}=t.attrs;return(0,a.jsx)(k.VR,{as:"span",children:(0,a.jsx)(T,{mentionLabel:"@".concat(l)})})},eF=e=>(0,a.jsx)(k.VR,{as:"span",children:(0,a.jsx)(y,{type:"user"})}),eB=u.bP.create({name:"mention",addOptions:()=>({HTMLAttributes:{},renderLabel(e){var t;let{options:l,node:a}=e;return"".concat(l.suggestion.char).concat(null!==(t=a.attrs.label)&&void 0!==t?t:a.attrs.id)},suggestion:{char:C.A}}),priority:A.y.UserMention,group:"inline",inline:!0,selectable:!0,atom:!0,addAttributes:()=>({id:{default:null,parseHTML:e=>e.getAttribute("data-id"),renderHTML:e=>e.id?{"data-id":e.id}:{}},label:{default:null,parseHTML:e=>e.getAttribute("data-label"),renderHTML:e=>e.label?{"data-label":e.label}:{}},profileImageUrl:{default:null,parseHTML:e=>e.getAttribute("data-profile-image-url"),renderHTML:e=>e.profileImageUrl?{"data-profile-image-url":e.profileImageUrl}:{}},mentionedById:{default:null,parseHTML:e=>e.getAttribute("data-mentioned-by-id"),renderHTML:e=>e.mentionedById?{"data-mentioned-by-id":e.mentionedById}:{}}}),addCommands(){return{addUserMention:(e,t)=>{let{id:l,label:a,profileImageUrl:n,mentionedById:o}=e;return e=>{var i;let{state:r,chain:s}=e,d=r.selection.$to.nodeAfter;return(null==d?void 0:null===(i=d.text)||void 0===i?void 0:i.startsWith(" "))&&(t.to+=1),s().focus().insertContentAt(t,[{type:this.name,attrs:{id:l,label:a,profileImageUrl:n,mentionedById:o}},{type:"text",text:" "}]).run(),!0}}}},parseHTML(){return[{tag:'span[data-type="'.concat(this.name,'"]')}]},renderHTML(e){let{node:t,HTMLAttributes:l}=e;return["span",(0,u.KV)({"data-type":this.name},this.options.HTMLAttributes,l),this.options.renderLabel({options:this.options,node:t})]},renderText(e){let{node:t}=e;return this.options.renderLabel({options:this.options,node:t})},addNodeView(){return this.editor.isThumbnail?(0,k.gu)(eF,{update:z.z0}):(0,k.gu)(ej,{update:z.z0})}})},7263:(e,t,l)=>{"use strict";l.d(t,{A:()=>eP,c:()=>eN});var a=l(81570),n=l(31085),o=l(61778),i=l(62313),r=l(48574),s=l(25420),d=l(43342),u=l(20501),c=l(3040),m=l(24221),f=l(95986),p=l(52177),g=l(89897),h=l.n(g),b=l(56005),y=l.n(b),v=l(14041),k=l(77914),w=l(22844),x=l(39286),S=l(62911),A=l(88957);l(23832);var C=l(44507),z=l(23013),I=l(18588),j=l(59742),F=l(57238),B=l(18658),R=l(32133),_=l(78776),M=l(78354),E=l(12567),T=l(38452),O=l(60490);let P=(0,E.Ay)("mod+K"),N=e=>{let{isEnabledFn:t=()=>!0,isOpen:l=!1}=e,{user:a}=(0,O.ur)(),n=(0,R.wA)();(0,v.useEffect)(()=>{if(!(0,C.Xb)()&&a)return T.WC.on("keydown","GLOBAL_SEARCH",e=>!!(P(e)&&t())&&(e.preventDefault(),n((0,z.q8)({isOpen:!l})),!0))},[n,t,a,l])};var D=l(65446),L=l(17228),W=l.n(L),U=l(62849),G=l(86724),H=l(14691),V=l(20931),q=l(76166),K=l(35436),J=l(20671),$=l(12327);let Q=e=>{let{onChange:t,query:l,isDisabled:a,isLoading:o,isFocused:i}=e,r=(0,v.useRef)(null);return(0,v.useEffect)(()=>{r.current&&i&&(r.current.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),r.current.focus())},[r,i]),(0,n.jsxs)(q.M,{size:"lg",variant:"unstyled",sx:{input:{paddingInlineStart:12}},children:[(0,n.jsx)(K.W,{p:4,pointerEvents:"none",color:"gray.300",children:(0,n.jsx)(V.W,{})}),(0,n.jsx)(J.p,{isDisabled:a,placeholder:$.Ru._({id:"NiZZRh"}),p:3,border:"none",outline:"none",shadow:"none",value:l,onChange:t,_placeholder:{opacity:1,color:"gray.300"},ref:r}),(0,n.jsx)(K.t,{p:4,pointerEvents:"none",color:"gray.500",opacity:o?1:0,transitionProperty:"common",transitionDuration:"normal",marginInlineEnd:(0,C.Xb)()?8:0,children:(0,n.jsx)(d.y,{size:"sm"})})]})};var Y=l(23970),X=l(27559),Z=l(70323),ee=l(26848),et=l(18201),el=l(9021);let ea=e=>{let{onClose:t,showTip:l}=e;return(0,n.jsxs)(X.S,{in:l,children:[(0,n.jsx)(Z.c,{}),(0,n.jsxs)(i.z,{p:4,px:6,children:[(0,n.jsxs)(o.E,{fontSize:"sm",color:"gray.600",children:[(0,n.jsxs)("span",{role:"img","aria-label":"Wave",children:["\uD83D\uDC4B"," "]}),(0,n.jsx)(p.x6,{id:"3SXj0j",values:{0:(0,f.lp)("Mod+K")},components:{0:(0,n.jsx)(ee.u,{})}})]}),(0,n.jsx)(et.h,{}),(0,n.jsx)(el.K,{"aria-label":$.Ru._({id:"yz7wBu"}),icon:(0,n.jsx)(Y.U,{boxSize:2.5}),isRound:!0,size:"xs",variant:"ghost",onClick:t})]})]})};var en=l(35687),eo=l(92712),ei=l(80532);let er=u.ao0;var es=l(92405);let ed=e=>{let{result:t,isActive:l,focusedItemEl:a,onMouseMove:r}=e,{name:s,id:d,slug:u,isMember:c,memberCount:g,members:h}=t;return(0,n.jsx)(eo.Q,{children:(0,n.jsxs)(i.z,{ref:l?a:null,className:"search-result",wordBreak:"break-word",onMouseMove:r,p:3,align:"flex-start",alignItems:"center",borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",role:"group",bg:l?"gray.100":"transparent",cursor:"pointer",color:"gray.800",borderWidth:"1px",borderColor:l?"gray.200":"transparent",spacing:{base:0,sm:4},children:[(0,n.jsx)(ei.az,{p:2,children:(0,n.jsx)(m.g,{icon:er})}),(0,n.jsx)(en.B,{spacing:2,flex:"1",children:(0,n.jsxs)(eo.r,{href:(0,es.gU)({id:d,slug:u}),children:[(0,n.jsx)(o.E,{children:s}),(0,n.jsx)(o.E,{fontSize:"sm",color:"gray.400",children:c?(0,n.jsx)(p.x6,{id:"tWPlLK",values:{0:g||0}}):(0,n.jsx)(p.x6,{id:"pkIIls",values:{0:g||0}})})]})}),(0,n.jsx)(et.h,{}),(0,n.jsx)(f.KZ,{overflowTooltipLabel:$.Ru._({id:"25VyZX"}),size:"xs",avatars:h||[],max:3})]})})};var eu=l(18651),ec=l(31595),em=l(46210),ef=l(65998),ep=l(13166);let eg=e=>{let{result:t,isActive:l,focusedItemEl:a,onMouseMove:r,context:s="globalSearch"}=e,d=(0,ef.u)("screenshotsEnabled"),{title:u,text:c,previewUrl:m,editors:g,editedTime:b,id:y,createdBy:v}=t,k="mentionsList"===s;return(0,n.jsx)(eo.Q,{children:(0,n.jsxs)(i.z,{ref:l?a:null,className:"search-result",wordBreak:"break-word",onMouseMove:r,p:k?0:[2,3],py:k?.5:void 0,align:"flex-start",borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",role:"group",bg:l?"gray.100":"transparent",cursor:"pointer",color:"gray.800",borderWidth:"1px",borderColor:l?"gray.200":"transparent",spacing:{base:0,sm:4},sx:{em:{bg:"var(--chakra-colors-trueblue-100)",fontStyle:"normal",borderRadius:"base",display:"inline-block",padding:"0px 2px",margin:"0px -2px"}},children:[(0,n.jsx)(eu._,{display:{base:"none",xs:"block"},h:"100%",src:d?m:em.A.src,w:{base:"0px",sm:"25%"},border:"1px solid",borderColor:"gray.200",borderRadius:"md",shadow:"lg",fallbackSrc:em.A.src}),(0,n.jsxs)(en.B,{spacing:(0,C.Xb)()?1:2,flex:"1",children:[(0,n.jsxs)(eo.r,{href:"globalSearch"===s?(0,es.LN)({docId:y}):void 0,children:[(0,n.jsx)(o.E,{fontSize:"md",fontWeight:"600",noOfLines:k?1:2,dangerouslySetInnerHTML:{__html:u?h().sanitize(u):""}}),(null==v?void 0:v.displayName)&&(0,n.jsx)(o.E,{fontSize:"xs",color:"gray.600",fontWeight:"500",children:(0,n.jsx)(p.x6,{id:"ab98Hp",values:{0:null==v?void 0:v.displayName}})})]}),(0,n.jsx)(o.E,{fontSize:k?"xs":"sm",noOfLines:2,whiteSpace:"normal",wordBreak:"break-word",dangerouslySetInnerHTML:{__html:c?h().sanitize(c):""}}),(0,n.jsxs)(i.z,{children:[g&&g.length>0&&(0,n.jsx)(ec.Z,{size:"xs",fontSize:"xs",max:5,children:null==g?void 0:g.map(e=>{let{user:t}=e,{id:l,displayName:a,profileImageUrl:o}=t;return(0,n.jsx)(f.Vc,{label:a,src:o,shadow:"base"},l)})}),b&&(0,n.jsx)(o.E,{fontSize:"xs",color:"gray.600",fontWeight:"500",children:(0,n.jsx)(p.x6,{id:"5cC8f2",values:{0:(0,ep.OG)(b)}})})]})]})]})})},eh=e=>{let{results:t,focusedIndex:l,focusedItemEl:a,onMouseMove:o}=e;return(0,n.jsx)(en.B,{spacing:1,px:4,h:["lg","xl"],maxHeight:["lg","xl"],pb:4,overflow:"auto","data-testid":"search-results-wrapper",children:t.map((e,t)=>"DocResult"===e.__typename||"PseudoDocResult"===e.__typename?(0,n.jsx)(eg,{result:e,isActive:l===t,focusedItemEl:a,onMouseMove:()=>{o(t)}},e.id):"Channel"===e.__typename?(0,n.jsx)(ed,{result:e,isActive:l===t,focusedItemEl:a,onMouseMove:()=>{o(t)}},e.id):null)})},eb=(0,E.Ay)("mod+K"),ey=e=>{let{query:t,isOpen:l,setResults:a,currentWorkspaceId:n}=e,{data:o}=(0,k.b_w)({variables:{first:5,workspaceId:n,archived:!1,sortBy:{field:k.vY2.LastViewed,direction:k.UEL.Desc}},fetchPolicy:"cache-first",skip:!l});(0,v.useEffect)(()=>{!(t.length>0)&&l&&a(((null==o?void 0:o.docs.edges.map(e=>e.node))||[]).slice(0,5).map(e=>{let{id:t,title:l,archived:a,titleCard:n,createdBy:o,editors:i,createdTime:r,editedTime:s,updatedTime:d}=e;return{id:t,title:l,archived:a,previewUrl:null==n?void 0:n.previewUrl,createdBy:o,editors:i,text:"",createdTime:r,editedTime:s,updatedTime:d,__typename:"PseudoDocResult"}}))},[l,t.length,null==o?void 0:o.docs.edges,a])},ev=()=>{let{user:e,currentWorkspace:t}=(0,O.ur)(),{isConnected:l}=(0,k.utY)(),a=(0,A.GV)(z.MQ),[o,i]=(0,v.useState)([]),[r,d]=(0,v.useState)(!0),[u,c]=(0,v.useState)(-1),[m,g]=(0,G.M)(H.E.hasDismissedSearchTip,!1),h=(0,v.useRef)(null),[b,y]=(0,v.useState)(!1),w=(0,A.GV)(z.xo),[x,I]=(0,v.useState)(()=>w||""),[j,{data:F,loading:B}]=(0,k.eXh)();ey({query:x,isOpen:a,setResults:i,currentWorkspaceId:null==t?void 0:t.id});let R=(0,U.lW)(j,600);(0,v.useEffect)(()=>{0!=w.length&&I(w)},[w]);let _=(0,v.useCallback)(function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{target:"_self"},{target:l}=t||{},a=(null==h?void 0:null===(e=h.current)||void 0===e?void 0:e.querySelector("[href]")).href;a||console.error("[SearchModal] No href found"),window.open(a,l)},[h]),M=(0,v.useRef)({focusedIndex:u,results:o,goToItem:_,searchInputFocused:r});M.current={focusedIndex:u,results:o,goToItem:_,searchInputFocused:r},(0,v.useEffect)(()=>{if(a)return T.WC.on("keydown","GLOBAL_SEARCH",e=>{let{key:t}=e;if(eb(e))return!0;let l=M.current;switch(t){case"Escape":return e.preventDefault(),e.stopPropagation(),!0;case"Tab":return e.preventDefault(),l.searchInputFocused?c(W()(l.focusedIndex-1,0,l.results.length-1)):c(-1),d(!l.searchInputFocused),!0;case"Enter":return e.preventDefault(),l.searchInputFocused?R.flush():l.results.length>0&&l.goToItem({target:e.metaKey||e.ctrlKey?"_blank":"_self"}),!0;case"ArrowUp":return e.preventDefault(),l.focusedIndex<0?(d(!1),c(l.results.length-1)):0==l.focusedIndex?(d(!0),c(-1)):(d(!1),c(W()(l.focusedIndex-1,-1,l.results.length-1))),y(!0),!0;case"ArrowDown":return e.preventDefault(),l.focusedIndex<0?(d(!1),c(0)):l.focusedIndex>=l.results.length-1?(d(!0),c(-1)):(d(!1),c(W()(l.focusedIndex+1,-1,l.results.length-1))),y(!0),!0;default:return d(!0),c(-1),!1}})},[u,R,a,r]),(0,v.useEffect)(()=>{(null==F?void 0:F.search)&&i(null==F?void 0:F.search.filter(e=>void 0!==e&&("DocResult"===e.__typename||"Channel"===e.__typename)))},[null==F?void 0:F.search]);let E=(0,v.useCallback)(e=>{let{value:l}=e.target;l?(I(l),R({variables:{workspaceId:null==t?void 0:t.id,query:l}})):(R.cancel(),I(""),i([]),c(-1),d(!0))},[null==t?void 0:t.id,R]),P=(0,v.useCallback)(e=>{y(!1),c(e)},[]),N=(0,U.wb)(P,50),L=!m&&o.length>0;(0,v.useEffect)(()=>{var e;h.current&&b&&(null==h||null===(e=h.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}))},[u,b]);let V=x.length>0?(0,n.jsx)(p.x6,{id:"5WYZKZ"}):(0,n.jsx)(p.x6,{id:"AOvC3b"});return e?(0,n.jsxs)(s.s,{direction:"column",children:[(0,n.jsx)(Q,{onChange:E,query:x,isDisabled:!l,isLoading:B,isFocused:r}),(0,n.jsx)(S.r,{mx:4,mt:2,mb:4,isConnected:l,description:(0,n.jsx)(p.x6,{id:"R4lJxt"})}),l&&(0,n.jsx)(f._x,{p:4,children:V}),l&&o&&o.length>0&&(0,n.jsx)(eh,{focusedItemEl:h,results:o,focusedIndex:u,onMouseMove:N}),!(0,C.Xb)()&&(0,n.jsx)(ea,{onClose:()=>{g(!0)},showTip:L}),(0,C.Xb)()&&(0,n.jsx)(D.s,{})]}):null};(0,_.A)(e=>{let{isEnabledFn:t}=e,l=(0,A.GV)(z.MQ);N({isEnabledFn:t,isOpen:l});let a=(0,R.wA)(),o=(0,M.h5)({base:"sm",sm:"md",md:"lg",lg:"2xl"}),i=(0,v.useCallback)(()=>{a((0,z.q8)({isOpen:!1,initialQuery:""}))},[a]);return(0,n.jsxs)(I.aF,{isOpen:l,onClose:i,size:o,onOverlayClick:i,returnFocusOnClose:!1,children:[(0,n.jsx)(j.m,{}),(0,n.jsx)(F.$,{children:(0,n.jsx)(B.c,{p:0,children:(0,n.jsx)(ev,{})})})]})});var ek=l(38234),ew=l(59707),ex=l(61690),eS=l(91559);let eA=(e,t,l)=>RegExp(t?e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"):e,l?"gu":"gui"),eC="Type to mention a person or a ".concat(x.TP),ez=e=>{let{html:t}=e;return(0,n.jsx)(o.E,{paddingInlineStart:"0.2rem",wordBreak:"break-word",noOfLines:1,maxW:300,lineHeight:"1.5",dangerouslySetInnerHTML:{__html:t?h().sanitize(t):""}})},eI=e=>e.replace(/(|<\/em>)/g,""),ej=e=>{let{result:t}=e,{__typename:l}=t;return"User"===l?(0,n.jsxs)(i.z,{children:[(0,n.jsx)(r.e,{size:"2xs",minWidth:4,m:0,name:t.displayName&&eI(t.displayName),src:t.profileImageUrl}),(0,n.jsx)(ez,{html:t.displayName})]}):"Card"===l?(0,n.jsxs)(i.z,{children:[(0,n.jsx)(s.s,{color:"gray.600",minWidth:4,justifyContent:"flex-end",children:(0,n.jsx)(m.g,{icon:c.ZPt,transform:{size:6}})}),(0,n.jsx)(ez,{html:t.title})]}):"DocResult"===l?(0,n.jsx)(eg,{result:t,context:"mentionsList"}):(console.warn("[MentionList] Invalid __typename for search result:",t.__typename),null)},eF=(0,v.forwardRef)((e,t)=>{let{result:l,index:a,selectedIndex:o,selectItem:i,...r}=e;return(0,n.jsx)(f.nh,{ref:t,tabIndex:a===o?0:-1,onClick:()=>i(a),onMouseDown:ew.Fw,...r,children:(0,n.jsx)(ej,{result:l})},a)}),eB=(0,n.jsx)(m.g,{icon:u.vti}),eR=(0,n.jsx)(m.g,{icon:u.vGi}),e_=(0,n.jsx)(m.g,{icon:u.hP6}),eM={Card:{title:(0,n.jsx)(p.x6,{id:"gXnPmp",values:{GAMMA_ARTIFACT_PROPER_NOUN:x.TP}}),iconComponent:eB},DocResult:{title:y()(x.Ix),iconComponent:eR},User:{title:(0,n.jsx)(p.x6,{id:"1wdjme"}),iconComponent:e_}},eE=(0,v.forwardRef)((e,t)=>{let{editor:l,query:a,command:r}=e,{isConnected:u}=(0,k.utY)(),c=(0,A.GV)(e=>{var t;return((null===(t=(0,ex.Jo)(e))||void 0===t?void 0:t.collaborators)||[]).map(e=>e.user)});a&&l.gammaOrgId;let{data:m,previousData:g,error:h,loading:b}=function(e,t){let{isConnected:l}=(0,eS.u)(),a=!e||!t||!l;return function(e){function t(e,t,l){l&&(e[t]||(e[t]={search:[]}),e[t].search=[...e[t].search,...l.search])}return e.reduce((e,l)=>{let{data:a,previousData:n,error:o,loading:i}=l;return!a&&i&&n&&(a=n),t(e,"data",a),t(e,"previousData",n),i&&(e.loading=!0),o&&(e.error=o),e},{})}([(0,k.SzF)({variables:{workspaceId:t,types:[k.nXf.User],query:e},skip:a}),(0,k.SzF)({variables:{workspaceId:t,types:[k.nXf.Doc],query:e},skip:a})])}(a,l.gammaOrgId),{user:y}=(0,O.ur)(),{searchDocs:x,searchUsers:C}=(0,v.useMemo)(()=>{let e=eA(a,!0,!1),t=(m?m.search:g?g.search:[]).filter(e=>"User"===e.__typename),l=(m?m.search:g?g.search:[]).filter(e=>"DocResult"===e.__typename),n=c.filter(e=>!t.find(t=>t.id===e.id)).filter(e=>{var t,l;return(null===(t=e.email)||void 0===t?void 0:t.startsWith(a.toLowerCase()))||(null===(l=e.displayName)||void 0===l?void 0:l.toLowerCase().includes(a.toLowerCase()))}),o=[...t,...n].map(t=>{var l;return{...t,displayName:null===(l=t.displayName)||void 0===l?void 0:l.replace(e,"$&")}});return{searchDocs:a?[...l]:[],searchUsers:a?o:[]}},[m,g,a,c]),z=(0,A.GV)(w.rZ),I=[...C,...(0,v.useMemo)(()=>{let e=eA(a,!0,!1);return a?z.map(t=>{let l=t.title||"";if(l.match(e)){let a=l.replace(e,"$&");return{...t,title:a,__typename:"Card"}}return null}).filter(Boolean):[]},[z,a]),...x],j=e=>{let t=I[e]?{...I[e]}:null;t&&("User"===t.__typename&&t.displayName&&(t.displayName=eI(t.displayName)),"Card"===t.__typename&&(t.docId=l.gammaDocId),r({item:t,user:y}))},{selectedIndex:F,selectedItemEl:B}=(0,ek.Rj)({ref:t,selectItem:j,options:I}),R=l.state.selection,_=!R.$anchor.parent.isLeaf&&R.$anchor.parent.textContent===eP;return 0===a.length&&_?(0,n.jsx)(s.s,{w:"100%",p:1,align:"flex-start",justify:"flex-start",flex:"1",mt:-9,ml:3,"data-testid":"mention-list-empty",children:(0,n.jsx)(o.E,{fontSize:"md",color:"gray.400",children:eC})}):(0,n.jsx)(f.qF,{"data-testid":"mention-list",children:(0,n.jsxs)(f.QE,{"data-target-name":"mention-list",w:"540px",maxW:"90vw",overflowY:"auto",maxH:"65vh",sx:{em:{bg:"var(--chakra-colors-trueblue-100)",fontStyle:"normal",borderRadius:"base",display:"inline-block",padding:"0px 2px",margin:"0px -2px"}},children:[(0,n.jsx)(S.r,{isConnected:u,description:(0,n.jsx)(p.x6,{id:"KnLL/m"})}),h?(0,n.jsx)(s.s,{p:1,align:"center",justify:"center",flex:"1",minH:12,children:(0,n.jsxs)(o.E,{fontSize:"sm",color:"gray.500",children:[(0,n.jsx)(p.x6,{id:"sBH7nV"}),h&&(null==h?void 0:h.message)]})}):0===a.length?(0,n.jsxs)(s.s,{p:1,align:"center",justify:"center",flex:"1",minH:12,"data-testid":"mention-list-empty",children:[(0,n.jsx)(o.E,{fontSize:"md",color:"gray.400",children:eC})," "]}):!b&&a.length>1&&0===I.length?(0,n.jsx)(s.s,{p:1,align:"center",justify:"center",flex:"1",minH:12,children:(0,n.jsx)(o.E,{fontSize:"sm",color:"gray.500",children:"No results for this query."})}):null,I.map((e,t)=>{let l=I.findIndex(t=>t.__typename===e.__typename)===t&&e.__typename?eM[e.__typename]:null;return(0,n.jsxs)(v.Fragment,{children:[l&&(0,n.jsxs)(i.z,{mt:4,mb:2,color:"gray.500",children:[l.iconComponent,(0,n.jsx)(f._x,{children:l.title})]}),(0,n.jsx)(eF,{"data-testid":"mention-list-item-".concat(e.id),ref:t===F?B:null,result:e,index:t,selectedIndex:F,selectItem:j},t)]},e.id)}),b&&(0,n.jsx)(s.s,{p:1,align:"center",justify:"center",flex:"1",minH:12,children:(0,n.jsx)(d.y,{opacity:"0.8",size:"xs"})})]})})});var eT=l(43873);let eO=new a.hs("MentionGamma"),eP="@",eN=(0,ek.e$)({name:"GammaMention",char:eP,pluginKey:eO,allowSpaces:!0,MenuComponent:eE,priority:eT.y.MentionSuggestionMenu,command:e=>{let{editor:t,range:l,props:a}=e,{item:n,user:o}=a;if("User"===n.__typename){let{id:e,displayName:a,profileImageUrl:i}=n,{id:r}=o;t.commands.addUserMention({id:e,label:a,profileImageUrl:i,mentionedById:r},l)}else if("Card"===n.__typename){let{id:e,docId:a}=n,{id:i}=o;t.commands.addCardMention({id:e,docId:a,mentionedById:i},l)}else if("DocResult"===n.__typename){let{id:e}=n,{id:a}=o;t.commands.addDocMention({id:e,mentionedById:a},l)}}})},50881:(e,t,l)=>{"use strict";l.d(t,{f:()=>h});var a=l(13236),n=l(67291),o=l(58599),i=l(30138),r=l(29362),s=l(31085),d=l(92448),u=l(57284),c=l(12554),m=l(74336),f=l(95905),p=l(12408);let g=e=>{let{node:t,decorations:l,editor:a}=e,n=(0,m.v)(l),i=(0,p.Ms)(l),r=(0,f.fZ)(l),{horizontalAlign:g,fontSize:h,placeholder:b}=t.attrs,y=(0,f.yp)(g),v="left"===g&&"ltr"===r||"right"===g&&"rtl"===r,k=i&&n&&(!g||v)&&!(0,c.NO)(a)&&!b;return(0,s.jsxs)(u.u,{...e,style:{position:"relative"},children:[(0,s.jsx)(o.$p,{dir:r,"data-font-size":h,"data-multiline-placeholder":b,style:{textAlign:y.textAlign}}),k&&(0,s.jsx)(d.B,{...e,dir:r})]})},h=n.A.extend({name:"paragraph",group:"block cardNotesBlock",selectable:!1,addNodeView:()=>(0,o.gu)(g,{update:r.z0}),allowFontSizes:"body",addAttributes:()=>({fontSize:i.mD}),parseHTML:()=>[{tag:"p"}],renderHTML(e){let{HTMLAttributes:t}=e;return["p",(0,a.KV)(t,{class:"paragraph"}),0]},renderHTMLforAI(e){let{HTMLAttributes:t}=e;return["p",t,0]}})},71002:(e,t,l)=>{"use strict";l.d(t,{o:()=>M});var a=l(13236),n=l(81570),o=l(22574),i=l(58599),r=l(95580),s=l(43873),d=l(94669),u=l(29362),c=l(16397),m=l(63915),f=l(1279),p=l(20265),g=l(93090),h=l(40452),b=l(48365);class y{constructor(e=null){this.dragging=e}}let v=new n.hs("smartLayoutPlugin"),k=e=>new n.k_({key:v,state:{init:()=>new y,apply:(e,t)=>t},props:{decorations:e=>(0,h.r$)(e),handleDOMEvents:{drop(e){var t;let l=null===(t=e.dragging)||void 0===t?void 0:t.annotations,a=v.getState(e.state);if(!a)return!1;a.dragging=l}},handleDrop:(t,l,a)=>{let n=v.getState(t.state),o=null==n?void 0:n.dragging;return n&&(n.dragging=null),!!(x(e,t,l,a)||S(e,t,l,a,o)||w(e,t,l,a))},handlePaste:(t,l,a)=>{let{selection:o}=t.state;if(!(o instanceof n.nh&&(0,m.q)(o.node)))return!1;let i=(0,g.bC)(e,l,a),r=(0,f.H)(a);if(r&&"image"!==r.type.name&&!i)return!1;let s=i?i.attrs:null==r?void 0:r.attrs;return e.commands.updateNestedAttributesAtPos(o.from,{image:s}),i&&i.upload(),!0}}}),w=(e,t,l,a)=>{let n=(0,b.fc)(t,l,a);if(!n)return!1;let o=(0,b.oO)(l),i=null,r=n.image;o&&(r=(i=(0,p.YC)(o,e)).content.attrs);let s=t.state.tr;return s.setNodeAttribute(n.pos,"image",r),null==i||i.upload(),s.deleteSelection(),t.dispatch(s),!0},x=(e,t,l,a)=>{let n=(0,b.TS)(t,l,a);if(!n)return!1;let o=t.state.tr;return o.setNodeAttribute(n.pos,"variantKey",n.variantKey),t.dispatch(o),e.commands.selectNodeAtPos(n.pos),!0},S=(e,t,l,a,n)=>{let o=null;try{if(!(o=(0,b.eL)(t,l,a)))return!1}catch(e){return!1}try{let{selection:l}=t.state,i=!l.empty,{node:r,pos:s,side:d}=o;if(s>l.from&&s{let{tr:t}=e;return i&&t.deleteSelection(),n&&t.setMeta("annotationEvent",{type:"drop",dragging:n,droppedBlockPos:c+1}),!0}).focusMapped(c,1).run()}catch(e){console.error("(caught) [SmartLayoutPlugin] handleDrop error:",e)}return!0};var A=l(31085),C=l(81313),z=l(12327),I=l(88957),j=l(61690),F=l(57284),B=l(91725);l(95905);var R=l(48292);let _=e=>{let{node:t,decorations:l}=e,a=t.attrs,n=(0,R.B)(a.variantKey),{Wrapper:o}=n,r=(0,h.Rv)(l),s=(0,b.aG)(a,r.direction),d=(0,I.GV)(j.nD),u=(0,I.GV)(j.SJ);return(0,A.jsxs)(F.u,{...e,dir:r.direction,className:(0,C.cx)(d&&"is-editable"),style:{position:"relative",display:"grid",gridTemplateColumns:"100%"},children:[(0,A.jsx)(o,{...r,options:s,theme:u,variant:n,node:t,children:(0,A.jsx)(i.$p,{"data-node-view-content-outer":"smartLayout"})}),(0,A.jsx)(B.A,{...e,label:z.Ru._({id:"Szg6OU"}),"data-testid":"smart-layout-drag-handle"})]})},M=a.bP.create({name:"smartLayout",group:"cardBlock layoutBlock",content:"smartLayoutCell+",isolating:!0,containerHandle:!0,defining:!0,priority:s.y.SmartLayout,addAttributes:()=>({variantKey:{default:void 0},options:{default:{},...(0,r.tb)("options")},fullWidthBlock:{default:!1}}),parseHTML:()=>[{tag:"div[class=smart-layout]"},...Object.values((0,R.a)()).filter(e=>e.htmlTag).map(e=>({tag:e.htmlTag,getAttrs:t=>{let l={variantKey:e.key,options:{...e.defaultOptions}};return e.options.forEach(e=>{let a=t.getAttribute(e.key);if(a){try{l.options[e.key]=JSON.parse(a)}catch(t){l.options[e.key]=a}return}if(e.getDefaultOnParse&&!l.options[e.key]){l.options[e.key]=e.getDefaultOnParse(t);return}}),l}}))],renderHTMLforAI(e){let{node:t}=e,l=(0,R.B)(t.attrs.variantKey),a={};return l.options.forEach(e=>{var l,n;let o=null!==(n=t.attrs.options[e.key])&&void 0!==n?n:null===(l=e.defaultValue)||void 0===l?void 0:l.call(e);a[e.key]="string"==typeof o?o:JSON.stringify(o)}),[l.htmlTag||l.key,a,0]},renderHTML(e){let{HTMLAttributes:t}=e;return["div",(0,a.KV)(t,{class:"smart-layout"}),0]},addNodeView:()=>(0,i.gu)(_,{update:u.z0,ignoreMutation:o.I}),addProseMirrorPlugins(){return[k(this.editor)]},addCommands:()=>({insertSmartLayoutCell:e=>t=>{var l,n;let{chain:o,state:i}=t,r=i.doc.resolve(e),s=(0,a.eL)(r,e=>"smartLayout"===e.type.name),d=null==s?void 0:s.node.lastChild;if(!s||!d)return!1;let u=d.attrs,m=(0,c.H)(null===(l=d.firstChild)||void 0===l?void 0:l.attrs.level);return o().insertContentAt(e,{type:"smartLayoutCell",content:m,attrs:{image:{source:null===(n=u.image)||void 0===n?void 0:n.source}}}).selectInsertedNode().run(),!0},handleSmartLayoutDelete:function(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return l=>{let{dispatch:o,state:i,tr:r,chain:s}=l;if(!o)return!0;let{selection:u}=i,c=u instanceof n.nh&&(0,m.q)(u.node)?{node:u.node,pos:u.from}:(0,a.KP)(e=>"smartLayoutCell"===e.type.name)(i.selection);if(e&&c&&c.pos!==u.from)return!1;let f=(0,a.KP)(e=>"smartLayout"===e.type.name)(i.selection);if(!c||!f)return!1;if(1==f.node.childCount)s().selectNodeAtPos(f.pos).deleteSelectionAndSelectNear(t?1:-1).run();else{let e=r.doc.resolve(c.pos);(0,d.K)(r,e,t)}return!0}},handleEmphasizeCell:(e,t)=>l=>{let{chain:n,state:o}=l,i=o.doc.resolve(e),r=(0,a.eL)(i,e=>"smartLayout"===e.type.name),s=null==r?void 0:r.pos;return null==r||r.node.forEach((l,a)=>{if(!s)return!1;let o=l.attrs.options,i=s+1+a;return n().updateNestedAttributesAtPos(i,{options:{...o,isEmphasized:i===e&&t}}).run(),!0}),!0}})})},59277:(e,t,l)=>{"use strict";l.d(t,{P3:()=>T,WP:()=>E,Wg:()=>O});var a=l(73758),n=l.n(a),o=l(77256),i=l(16723),r=l(16397),s=l(12327);let d={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/ArrowsHorizontal.a774f944.svg",height:71,width:253,blurWidth:0,blurHeight:0},u={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/ArrowsVertical.836da72e.svg",height:97,width:253,blurWidth:0,blurHeight:0},c={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/BarStats.f950fb86.svg",height:76,width:253,blurWidth:0,blurHeight:0},m={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/BigNumbers.a8dd3c72.svg",height:65,width:253,blurWidth:0,blurHeight:0},f={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/BulletsLg.095a87c4.svg",height:97,width:253,blurWidth:0,blurHeight:0},p={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/BulletsSm.b752361e.svg",height:96,width:253,blurWidth:0,blurHeight:0},g={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/CircleStats.d28f4999.svg",height:83,width:253,blurWidth:0,blurHeight:0},h={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/Funnel.49ef311d.svg",height:94,width:253,blurWidth:0,blurHeight:0},b={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/ImagesWithTextIcons.85edfaa6.svg",height:97,width:253,blurWidth:0,blurHeight:0},y={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/ImagesWithTextPhotos.a55ab106.svg",height:96,width:253,blurWidth:0,blurHeight:0},v={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/ImagesWithTextTeam.af1be4d1.svg",height:97,width:253,blurWidth:0,blurHeight:0},k={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/Pyramid.ef92f89c.svg",height:94,width:253,blurWidth:0,blurHeight:0},w={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/Stairs.d60e32c7.svg",height:94,width:253,blurWidth:0,blurHeight:0},x={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/SteppedPyramid.def15490.svg",height:94,width:253,blurWidth:0,blurHeight:0},S={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/Steps.19d5c973.svg",height:96,width:253,blurWidth:0,blurHeight:0},A={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/TextBoxes3.f6cbbf0a.svg",height:97,width:253,blurWidth:0,blurHeight:0},C={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/TextBoxes4.7125fc69.svg",height:110,width:253,blurWidth:0,blurHeight:0},z={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/TimelineHorizontalNumbered.4bc4869b.svg",height:97,width:253,blurWidth:0,blurHeight:0},I={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/TimelineHorizontalTwoSided.acd4bc4a.svg",height:97,width:253,blurWidth:0,blurHeight:0},j={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/TimelineVerticalNumbered.e4851152.svg",height:111,width:253,blurWidth:0,blurHeight:0},F={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/TimelineVerticalTwoSided.e09967af.svg",height:151,width:253,blurWidth:0,blurHeight:0},B=()=>[{name:()=>s.Ru._({id:"o6dKT5"}),key:"timelineVerticalTwoSided",keywords:["timeline","vertical","agenda"],previewImage:F,content:{type:"smartLayout",attrs:{variantKey:"timeline",options:{numbered:!1,twoSided:!0,hasLine:!0},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.Ru._({id:"o2PvSp"}),key:"timelineVerticalNumbered",keywords:["timeline","vertical","agenda"],previewImage:j,content:{type:"smartLayout",attrs:{variantKey:"timeline",options:{numbered:!0,hasLine:!1,twoSided:!1,orientation:"vertical"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.Ru._({id:"EGQH/j"}),key:"timelineHorizontalTwoSided",keywords:["timeline","horizontal","agenda"],previewImage:I,content:{type:"smartLayout",attrs:{variantKey:"timeline",options:{numbered:!1,hasLine:!0,twoSided:!0,orientation:"horizontal"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur do"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium "}]}]}]}},{name:()=>s.Ru._({id:"tmwL4E"}),key:"timelineHorizontalNumbered",keywords:["timeline","horizontal","agenda"],previewImage:z,content:{type:"smartLayout",attrs:{variantKey:"timeline",options:{numbered:!0,hasLine:!1,twoSided:!1,orientation:"horizontal"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.Ru._({id:"OsVXoX"}),key:"bulletsLg",keywords:["agenda","bullets"],previewImage:f,content:{type:"smartLayout",attrs:{variantKey:"bullets",options:{cellSize:20},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.Ru._({id:"XY2IHD"}),key:"bulletsSm",previewImage:p,keywords:["agenda","bullets"],content:{type:"smartLayout",attrs:{variantKey:"bullets",options:{cellSize:10},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.Ru._({id:"7xlpDo"}),key:"textBoxes3",keywords:["squares"],previewImage:A,content:{type:"smartLayout",attrs:{variantKey:"textBoxes",options:{cellSize:10},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Item 1"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident."}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Item 2"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident."}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Item 3"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident."}]}]}]}},{name:()=>s.Ru._({id:"X4kXBV"}),key:"textBoxes4",previewImage:C,keywords:["squares","callouts","matrix","quadrant"],content:{type:"smartLayout",attrs:{variantKey:"textBoxes",options:{cellSize:20},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.Ru._({id:"+kQMBP"}),key:"imagesWithTextTeam",previewImage:v,keywords:["team","images","headshot","bio","roles"],content:{type:"smartLayout",attrs:{variantKey:"imagesText",options:{cellSize:10,imageSize:1,horizontalAlign:"center",imageShape:"circle"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.custom",uploadStatus:0,showPlaceholder:!1,src:"https://cdn.gamma.app/zc87vhr30n8uf3n/c1414815be03462f8862cb80f89f720d/optimized/tesla.jpg",meta:{width:820,height:709,date_file_modified:"2023/02/07 22:20:08 GMT",aspect_ratio:1.157,has_clipping_path:!1,frame_count:1,colorspace:"sRGB",has_transparency:!1,average_color:"#828282",orientation:"Horizontal (normal)"},name:"tesla.jpg"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Nikola Tesla"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:"default"},content:[{type:"text",marks:[{type:"bold"}],text:"Inventor"},{type:"hardBreak"},{type:"text",text:"@ Tesla Inc. "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.custom",uploadStatus:0,showPlaceholder:!1,src:"https://cdn.gamma.app/zc87vhr30n8uf3n/53ab692111294834a286002e3ecfdf2b/optimized/marie-curie.jpg",meta:{width:1200,height:1631,date_file_modified:"2023/02/07 22:20:11 GMT",aspect_ratio:.736,has_clipping_path:!1,frame_count:1,colorspace:"sRGB",has_transparency:!1,orientation:"Horizontal (normal)",average_color:"#3b3b3b"},name:"marie-curie.jpg"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Marie Curie"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:"default"},content:[{type:"text",marks:[{type:"bold"}],text:"Physicist and Chemist"},{type:"hardBreak"},{type:"text",text:"@ Radioactivity"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.custom",uploadStatus:0,showPlaceholder:!1,src:"https://cdn.gamma.app/zc87vhr30n8uf3n/e5d0250f2e054ee3a4c63a8e11f39c36/optimized/thomas-edison.webp",meta:{width:360,height:450,date_file_modified:"2023/02/07 22:20:22 GMT",aspect_ratio:.8,has_clipping_path:!1,frame_count:1,colorspace:"sRGB",has_transparency:!1,average_color:"#606060",orientation:"Horizontal (normal)"},name:"thomas edison.webp"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Thomas Edison"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:"default"},content:[{type:"text",marks:[{type:"bold"}],text:"Inventor "},{type:"hardBreak"},{type:"text",text:"@ Light bulb "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.custom",uploadStatus:0,showPlaceholder:!1,src:"https://cdn.gamma.app/zc87vhr30n8uf3n/86aa2820df484599b26ab9bbb79737d3/optimized/einstein.jpg",meta:{width:500,height:500,date_file_modified:"2023/02/07 22:20:26 GMT",aspect_ratio:1,has_clipping_path:!1,frame_count:1,colorspace:"sRGB",has_transparency:!1,orientation:"Horizontal (normal)",average_color:"#575757"},name:"einstein.jpg"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Albert Einstein"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:"default"},content:[{type:"text",marks:[{type:"bold"}],text:"Theoretical Physicist"},{type:"hardBreak"},{type:"text",text:"@ EMC2 "}]}]}]}},{name:()=>s.Ru._({id:"kX68M5"}),key:"imagesWithTextIcons",previewImage:b,keywords:["icons"],content:{type:"smartLayout",attrs:{variantKey:"iconsText",options:{cellSize:10,shapeSize:"md",horizontalAlign:"center"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.icon",src:"https://cdn.gamma.app/zc87vhr30n8uf3n/e169d76934d642e2999d195fb50cfd88/optimized/mountain.svg",tempUrl:"https://gamma.app/api/icons/mountain.svg?provider=fa&style=light",meta:{height:512,width:512,svgViewBoxWidth:512,svgViewBoxHeight:512,date_file_modified:"2023/02/07 21:46:24 GMT",aspect_ratio:1,has_clipping_path:!1,frame_count:1,average_color:"#cbcbcb"},query:"mountain",providerMeta:{name:"fa",id:"mountain"},uploadStatus:0,showPlaceholder:!1,name:"mountain.svg"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.icon",src:"https://cdn.gamma.app/zc87vhr30n8uf3n/1f156e4486744695b40e109958afc3fb/optimized/user-astronaut.svg",tempUrl:"https://gamma.app/api/icons/user-astronaut.svg?provider=fa&style=light",meta:{height:512,width:448,svgViewBoxWidth:448,svgViewBoxHeight:512,date_file_modified:"2023/02/07 21:45:45 GMT",aspect_ratio:.875,has_clipping_path:!1,frame_count:1,average_color:"#9c9c9c"},query:"astronaut",providerMeta:{name:"fa",id:"user-astronaut"},uploadStatus:0,showPlaceholder:!1,name:"user-astronaut.svg"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.icon",uploadStatus:0,showPlaceholder:!1,tempUrl:"https://gamma.app/api/icons/bullseye-arrow.svg?provider=fa&style=light",src:"https://cdn.gamma.app/zc87vhr30n8uf3n/69f7d571bf7d4af1b2aab06149d5ce4d/optimized/bullseye-arrow.svg",meta:{height:512,width:512,svgViewBoxWidth:512,svgViewBoxHeight:512,date_file_modified:"2023/02/07 21:47:16 GMT",aspect_ratio:1,has_clipping_path:!1,frame_count:1,average_color:"#acacac"},query:"goal",providerMeta:{name:"fa",id:"bullseye-arrow"},name:"bullseye-arrow.svg"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.icon",src:"https://cdn.gamma.app/zc87vhr30n8uf3n/ce830d7ed3c543d5b88ecdf6ec6c26ad/optimized/chess-king-piece.svg",tempUrl:"https://gamma.app/api/icons/chess-king-piece.svg?provider=fa&style=light",meta:{height:512,width:256,svgViewBoxWidth:256,svgViewBoxHeight:512,date_file_modified:"2023/02/07 22:21:25 GMT",aspect_ratio:.5,has_clipping_path:!1,frame_count:1,average_color:"#a1a1a1"},providerMeta:{name:"fa",id:"chess-king-piece"},query:"strategy",uploadStatus:0,showPlaceholder:!1,name:"chess-king-piece.svg"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.Ru._({id:"tVJ1RK"}),key:"imagesWithTextPhotos",keywords:["photos","captions"],previewImage:y,content:{type:"smartLayout",attrs:{variantKey:"imagesText",options:{cellSize:15,horizontalAlign:"left"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.unsplash",src:"https://images.unsplash.com/photo-1457459686225-c7db79d4e59f?ixid=MnwxOTgwNzN8MHwxfHNlYXJjaHwxOXx8bW91bnRhaW58ZW58MXx8fHwxNjc1ODA2MDQw&ixlib=rb-4.0.3&w=2592&q=25",tempUrl:"https://images.unsplash.com/photo-1457459686225-c7db79d4e59f?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxOTgwNzN8MHwxfHNlYXJjaHwxOXx8bW91bnRhaW58ZW58MXx8fHwxNjc1ODA2MDQw&ixlib=rb-4.0.3&q=80&w=200",meta:{height:3872,width:2592},query:"mountain"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.unsplash",src:"https://images.unsplash.com/photo-1536697246787-1f7ae568d89a?ixid=MnwxOTgwNzN8MHwxfHNlYXJjaHwyfHxhc3Ryb25hdXR8ZW58MXx8fHwxNjc1ODA1OTkz&ixlib=rb-4.0.3&w=2731&q=25",tempUrl:"https://images.unsplash.com/photo-1536697246787-1f7ae568d89a?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxOTgwNzN8MHwxfHNlYXJjaHwyfHxhc3Ryb25hdXR8ZW58MXx8fHwxNjc1ODA1OTkz&ixlib=rb-4.0.3&q=80&w=200",meta:{height:4096,width:2731},query:"astronaut"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:{source:"image.unsplash",src:"https://images.unsplash.com/photo-1598091874986-7da3b270fead?ixid=MnwxOTgwNzN8MHwxfHNlYXJjaHwyNHx8Z29hbHxlbnwxfHx8fDE2NzU4MDU4NjQ&ixlib=rb-4.0.3&w=2832&q=25",tempUrl:"https://images.unsplash.com/photo-1598091874986-7da3b270fead?crop=entropy&cs=tinysrgb&fit=max&fm=jpg&ixid=MnwxOTgwNzN8MHwxfHNlYXJjaHwyNHx8Z29hbHxlbnwxfHx8fDE2NzU4MDU4NjQ&ixlib=rb-4.0.3&q=80&w=200",meta:{height:2832,width:2832},query:"goal"},label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.Ru._({id:"B52ZvK"}),key:"pyramidOutside",previewImage:k,content:{type:"smartLayout",attrs:{variantKey:"pyramid",options:{numbered:!0,hasLine:!1,twoSided:!1,orientation:"horizontal",cellSize:10,outsideText:!0},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium "}]}]}]}},{name:()=>s.Ru._({id:"WJphpV"}),key:"funnelOutside",previewImage:h,content:{type:"smartLayout",attrs:{variantKey:"funnel",options:{numbered:!0,hasLine:!1,twoSided:!1,orientation:"horizontal",cellSize:10,outsideText:!0},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.Ru._({id:"crBPvK"}),key:"staircaseOutside",previewImage:w,content:{type:"smartLayout",attrs:{variantKey:"staircase",options:{numbered:!0,hasLine:!1,twoSided:!1,orientation:"horizontal",cellSize:10,outsideText:!0,horizontalAlign:"left"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.Ru._({id:"OxTZir"}),key:"steppedPyramid",previewImage:x,content:{type:"smartLayout",attrs:{variantKey:"staircase",options:{numbered:!0,hasLine:!1,twoSided:!1,orientation:"horizontal",cellSize:10,outsideText:!0,horizontalAlign:"center"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.Ru._({id:"zd+VK0"}),key:"horizontalArrows",previewImage:d,content:{type:"smartLayout",attrs:{variantKey:"arrows",options:{numbered:!0,hasLine:!1,twoSided:!1,orientation:"horizontal",cellSize:10},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Strategy"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.Ru._({id:"bkPcLj"}),key:"verticalArrows",previewImage:u,content:{type:"smartLayout",attrs:{variantKey:"arrows",options:{numbered:!0,hasLine:!1,twoSided:!1,orientation:"vertical",cellSize:10,horizontalAlign:"left"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium"}]}]}]}},{name:()=>s.Ru._({id:"W78uBz"}),key:"stats3",previewImage:m,content:{type:"smartLayout",attrs:{variantKey:"stats",options:{cellSize:15,numberMax:100,shapeSize:"lg"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:"25%"},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:"3/4"},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit "}]}]},{type:"smartLayoutCell",attrs:{options:{numberMax:100},width:null,image:null,label:50},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.Ru._({id:"PFo2A/"}),key:"circleStats3",previewImage:g,content:{type:"smartLayout",attrs:{variantKey:"circleStats",options:{cellSize:15,imageSize:.8,shapeSize:"lg"},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:"54%"},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:75},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:"1/3"},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.Ru._({id:"0LeG7j"}),key:"barStats3",previewImage:c,content:{type:"smartLayout",attrs:{variantKey:"barStats",options:{cellSize:10,numberMax:100},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:"25%"},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Vision"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor"}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:"3/4"},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Mission"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit "}]}]},{type:"smartLayoutCell",attrs:{options:{numberMax:100},width:null,image:null,label:50},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Goal"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit volupta tem accusa ntium eius modi tempora"}]}]}]}},{name:()=>s.Ru._({id:"A9onc2"}),key:"stepsWithText",keywords:["steps","sequence","ordered"],previewImage:S,content:{type:"smartLayout",attrs:{variantKey:"steps",options:{cellSize:10},fullWidthBlock:!1},content:[{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Step 1"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Step 2"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Excepteur sint occaecat cupidatat non proident, sunt in culpa "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Step 3"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Sed ut perspiciatis unde omnis iste natus error sit "}]}]},{type:"smartLayoutCell",attrs:{options:{},width:null,image:null,label:null},content:[{type:"heading",attrs:{horizontalAlign:null,level:3},content:[{type:"text",text:"Step 4"}]},{type:"paragraph",attrs:{horizontalAlign:null,fontSize:null},content:[{type:"text",text:"Foste natus error sit volupta tem accusa ntium "}]}]}]}}];var R=l(48365),_=l(48292);let M=()=>(0,_.a)().filter(e=>!e.disabled),E=()=>M().map(e=>{let{key:t,commandName:l,description:a,icon:i,keywords:s=[],defaultAttrs:d,defaultOptions:u,featureFlag:c}=e,m={type:"smartLayout",attrs:{variantKey:t,options:u},content:n()(3).map(()=>({type:"smartLayoutCell",content:(0,r.H)(),attrs:d}))};return{key:"smartLayout-".concat(t),name:l,keywords:[...s,"layout","smart"],description:a,nodeName:"smartLayout",icon:i,execute:e=>{e.chain().focus().insertContentAndSelect(m).run()},dragStartFn:e=>(0,o.fS)(e,m),dragEndFn:e=>{(0,R.tN)(e,e.state.selection.$from)},featureFlag:c}}),T=()=>M().map(e=>{let{key:t,name:l,description:a,icon:n,featureFlag:o}=e;return{key:"listToSmartLayout-".concat(t),name:l,icon:n,description:a,group:"list",apply:e=>e.commands.listToSmartLayout(t),checkDisabled:e=>!(0,i.Jx)(e),featureFlag:o}}),O=()=>B().map(e=>{let{name:t,key:l,keywords:a=[],content:n,previewImage:i}=e,r=(0,_.B)(n.attrs.variantKey);return{key:l,name:t,keywords:[...a,...r.keywords||[],"layout","smart"],nodeName:"smartLayout",icon:r.icon,previewImage:i,execute:e=>{e.chain().focus().insertContentAndSelect(n).run()},dragStartFn:e=>(0,o.fS)(e,n),dragEndFn:e=>{(0,R.tN)(e,e.state.selection.$from)},featureFlag:r.featureFlag}})},4296:(e,t,l)=>{"use strict";l.d(t,{y:()=>u});var a=l(31085),n=l(80853),o=l(20501),i=l(24221),r=l(95986),s=l(2057),d=l(59707);let u=e=>{var t;let{value:l,updateValue:u,choices:c,defaultIcon:m,option:f}=e;return(0,a.jsxs)(s.ms,{isLazy:!0,children:[(0,a.jsx)(r.Tz,{placement:"top",label:f.name(),shouldWrapChildren:!0,children:(0,a.jsx)(s.gf,{as:n.$,variant:"toolbar",onMouseDown:d.Fw,rightIcon:(0,a.jsx)(i.g,{icon:o.Jt$,transform:"shrink-6"}),children:(0,a.jsx)(i.g,{icon:(null===(t=c[l])||void 0===t?void 0:t.icon)||m})})}),(0,a.jsx)(s.Q5,{children:Object.entries(c).map(e=>{let[t,{icon:l,name:n,disabled:o}]=e;return o?null:(0,a.jsx)(s.tJ,{icon:(0,a.jsx)(i.g,{icon:l,fixedWidth:!0}),onClick:()=>u(t),children:n},t)})})]})}},16397:(e,t,l)=>{"use strict";l.d(t,{H:()=>o,x:()=>i});var a=l(12327),n=l(79194);let o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4;return[n.w.heading(a.Ru._({id:"HX5SVx"}),{level:e}),n.w.paragraph(a.Ru._({id:"Nu4oKW"}))]},i="1em"},40452:(e,t,l)=>{"use strict";l.d(t,{Rv:()=>b,fw:()=>y,r$:()=>h});var a=l(47217),n=l.n(a),o=l(81570),i=l(73686),r=l(7908),s=l(64130),d=l(95580),u=l(32570),c=l(63751),m=l(6157),f=l(95905),p=l(71002),g=l(1906);let h=e=>{let{doc:t}=e,l=[];return t.descendants((a,u)=>{let c;if(a.type.name!==p.o.name)return;let h=n()((0,d.F2)(a.content).map(e=>(0,g.x9)(e.attrs.label))),b=v(t.resolve(u)),y=(0,f.er)(e,u,u+a.nodeSize),k=(0,r.KQ)(a)||y||(0,s.C)(),w=e.selection instanceof o.nh&&e.selection.node===a||e.selection.from>u&&e.selection.to{e.attrs.options.isEmphasized&&(c=l)});let x=(0,m.i4)(t,"scaleContentToFit"),S={isSmartLayoutDecoration:!0,direction:k,numCells:a.childCount,containerSize:b,scaleContentToFit:!!x};return l.push(i.NZ.node(u,u+a.nodeSize,{},S)),a.forEach((e,t,n)=>{let o=u+1+t,r={isSmartLayoutCellDecoration:!0,direction:k,index:n,numCells:a.childCount,maxLabelValue:h,smartLayoutAttrs:a.attrs,layoutContainerSize:b,isContentEmpty:(0,d.mf)(e),isLayoutFocused:w,emphasizedIndex:c,scaleContentToFit:!!x};l.push(i.NZ.node(o,o+e.nodeSize,{},r))}),!1}),i.zF.create(t,l)},b=e=>{let t=e.find(e=>e.spec.isSmartLayoutDecoration);return t?t.spec:(console.error("[SmartLayout] Decoration not found. This should never happen!",e),{isSmartLayoutDecoration:!0,direction:"ltr",numCells:0,containerSize:1})},y=e=>{let t=e.find(e=>e.spec.isSmartLayoutCellDecoration);return t?t.spec:(console.error("[SmartLayoutCell] Decoration not found. This should never happen!",e),{isSmartLayoutCellDecoration:!0,direction:"ltr",numCells:0,index:0,smartLayoutAttrs:{options:{},fullWidthBlock:!1},layoutContainerSize:1,isContentEmpty:!1,isLayoutFocused:!1})},v=e=>{let t=1;try{for(let a=e.depth;a>0;a--){let n=e.node(a),o=e.index(a-1);if("gridCell"===n.type.name){let l=e.node(a-1).attrs.colWidths;l&&l[o]&&(t*=parseInt(l[o])/100)}if("card"===n.type.name){var l;let{layout:a,layoutTemplateColumns:o,container:i}=n.attrs;if("left"===a){let e=o?parseInt(o.split(" ")[1])/100:u.Ib;t*=e}if("right"===a){let e=o?parseInt(o.split(" ")[0])/100:u.Ib;t*=e}let r=e.doc.firstChild.attrs,s=null!==(l=i.width)&&void 0!==l?l:r.settings.defaultContentWidth;"lg"===s?t*=c.br/c.Vy:"sm"===s&&(t*=c.lA/c.Vy);break}}}catch(e){console.error("[SmartLayout] Error getting container size decoration",e)}return t}},63915:(e,t,l)=>{"use strict";l.d(t,{M:()=>n,q:()=>a});let a=e=>"smartLayoutCell"===e.type.name,n=e=>"smartLayout"===e.type.name},54979:(e,t,l)=>{"use strict";l.d(t,{K:()=>d,z:()=>s});var a=l(31085),n=l(20501),o=l(12327),i=l(4296);let r=()=>({square:{name:o.Ru._({id:"1DA6ap"}),icon:n.Nfw},circle:{name:o.Ru._({id:"7xMmki"}),icon:n.GEE},landscape:{name:o.Ru._({id:"XxIeKn"}),icon:n.Cpz},portrait:{name:o.Ru._({id:"3bV9gD"}),icon:n.b0A}}),s={square:{aspectRatio:"1 / 1"},circle:{borderRadius:"full",aspectRatio:"1 / 1"},landscape:{aspectRatio:"1.618 / 1"},portrait:{aspectRatio:"4 / 5"}},d={key:"imageShape",defaultValue:()=>null,Control:e=>{let{value:t,updateValue:l,editor:o,option:s}=e;return(0,a.jsx)(i.y,{value:t,updateValue:l,editor:o,choices:r(),option:s,defaultIcon:n.Nfw})},name:()=>o.Ru._({id:"JbOau/"})}},48365:(e,t,l)=>{"use strict";l.d(t,{$o:()=>f,TS:()=>y,aG:()=>m,eL:()=>b,fc:()=>h,oO:()=>g,tN:()=>v});var a=l(13236),n=l(81570),o=l(95580),i=l(98371),r=l(17539),s=l(1279),d=l(93090),u=l(63915),c=l(48292);let m=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ltr",l=(0,c.B)(e.variantKey),a={};return l.options.forEach(l=>{var n;let{key:o,defaultValue:i}=l;a[o]=null!==(n=e.options[o])&&void 0!==n?n:null==i?void 0:i({dir:t})}),a},f=e=>{var t;let l=(0,c.B)(e.variantKey),a=m(e);return(null===(t=l.addDirection)||void 0===t?void 0:t.call(l,a))||"right"},p=(e,t)=>t.nodes.smartLayout.validContent(e.content),g=e=>{let t=(0,d.p$)(e).filter(e=>(0,r.u3)(e.type));return 1===t.length&&t[0]},h=(e,t,l)=>{let a=e.posAtCoords({left:t.clientX,top:t.clientY});if(!a)return null;let n=e.state.doc.resolve(a.inside),r=(0,o.IV)(n,u.q)[0],d=(0,o.IV)(n,u.M)[0],c=l&&(0,s.H)(l),m=g(t);if(!r&&!d||c&&"image"!==c.type.name||!m)return null;let f=(0,i.xX)(t.target,e.dom,e=>e.hasAttribute("data-smart-layout-image-drop-target"));if(f){let e=f.getBoundingClientRect();return{pos:a.inside,node:c,rect:e,image:{src:null==c?void 0:c.attrs.src,source:null==c?void 0:c.attrs.source,query:null==c?void 0:c.attrs.query,name:null==c?void 0:c.attrs.name,uploadStatus:null==c?void 0:c.attrs.uploadStatus}}}return null},b=(e,t,l)=>{let n;if(!l||!p(l,e.state.schema))return null;let o=e.posAtCoords({left:t.clientX,top:t.clientY});if(!o||-1==o.inside)return null;let{doc:i}=e.state,r=i.nodeAt(o.pos),s=i.nodeAt(o.inside);if(s&&(0,u.q)(s))n={node:s,pos:o.inside};else if(r&&(0,u.q)(r))n={node:r,pos:o.pos};else{let e=i.resolve(o.inside);n=(0,a.eL)(e,u.q)}let d=n&&e.nodeDOM(n.pos),c=null==d?void 0:d.querySelector("[data-content-reference]"),m=null==c?void 0:c.getBoundingClientRect();if(!n||!m)return null;let g=i.resolve(n.pos).parent;if(!g||!(0,u.M)(g))return null;let h="right"===f(g.attrs)?t.clientX>m.left+m.width/2?"right":"left":t.clientY>m.top+m.height/2?"bottom":"top";return{pos:n.pos,node:n.node,rect:m,side:h}},y=(e,t,l)=>{var o;if(!l)return null;let i=l.content.toJSON(),r=null==i?void 0:i[0];if(e.state.selection instanceof n.nh&&"smartLayout"===e.state.selection.node.type.name||!r||(null==r?void 0:r.type)!=="smartLayout")return null;let s=null===(o=r.attrs)||void 0===o?void 0:o.variantKey,d=e.posAtCoords({left:t.clientX,top:t.clientY});if(!d||-1==d.inside)return null;let{doc:c}=e.state,m=c.resolve(d.inside),f=(0,a.eL)(m,u.M);if(!f)return null;let p=e.nodeDOM(f.pos),g=null==p?void 0:p.getBoundingClientRect();return g?{pos:f.pos,node:f.node,variantKey:s,rect:g}:null},v=(e,t)=>{let l=(0,a.eL)(t,u.M);l&&e.commands.selectNodeAtPos(l.pos)}},48292:(e,t,l)=>{"use strict";l.d(t,{B:()=>t$,a:()=>tK});var a=l(31085),n=l(15672),o=l(25420),i=l(80532),r=l(81313),s=l(20501),d=l(12327),u=l(14041),c=l(41900),m=l(63413),f=l(2696),p=l(1935),g=l(95905),h=l(98029),b=l(85774),y=l(31291),v=l(88957),k=l(61690);let w=e=>{let{updateAttributes:t,value:l,placeholder:n,inputProps:o,...i}=e,r=(0,u.useCallback)(e=>{t&&t({label:""===e?null:e})},[t]),s=(0,v.GV)(k.Cl)&&t;return(0,a.jsxs)(h.F,{value:l||"",placeholder:n,onChange:r,isDisabled:!s,...i,children:[(0,a.jsx)(b.l,{width:"100%",h:"1em",py:0,noOfLines:1,userSelect:s?void 0:"none",lineHeight:1}),(0,a.jsx)(y.j,{width:"100%",my:-1,py:1,lineHeight:1,...o})]})};var x=l(16397),S=l(40197),A=l(67442),C=l(34252),z=l(1771);let I=function(e,t){var l;let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=arguments.length>3?arguments[3]:void 0,o=(0,v.GV)(k.SJ),i=null!==(l=null==t?void 0:t.color)&&void 0!==l?l:e.color,r=i,s=(0,C.M)(o),d=S.z0[s.shapeFill].opacity,m=(0,z.bh)(o);if(!r&&"custom"===s.shapeColorScheme&&m.length>0){let e=(0,z.bh)(o).map(z.Ik);r=e[a%e.length]}let f=!0===n?0:!1===n?1:d,p=(0,u.useMemo)(()=>(0,A.q9)(r,f),[r,f]),g=r?(0,c.U2)(r):void 0;return{color:r,colorVars:p,headingColorCss:g,colorOverride:i}};var j=l(62313),F=l(2600),B=l(61778),R=l(1984),_=l(43421),M=l(24221),E=l(95986),T=l(17228),O=l.n(T),P=l(14e3),N=l(22544);let D=()=>({sm:{targetColumns:4,label:d.Ru._({id:"4Revpc"}),width:10},md:{targetColumns:3,label:d.Ru._({id:"agPptk"}),width:15},lg:{targetColumns:2,label:d.Ru._({id:"k7rCa/"}),width:20},xl:{targetColumns:1,label:d.Ru._({id:"vp6Yr4"}),width:25}}),L={key:"cellSize",defaultValue:()=>D().md.width,Control:e=>{let{value:t,updateValue:l,option:n}=e,o=Object.values(D()).find(e=>e.width===t);return(0,a.jsxs)(j.z,{spacing:2,mr:2,children:[(0,a.jsx)(E.Tz,{placement:"top",label:(0,a.jsxs)(F.T,{spacing:0,children:[(0,a.jsx)(B.E,{color:"gray.400",children:n.name()}),(0,a.jsx)(B.E,{children:null==o?void 0:o.label})]}),children:(0,a.jsx)(B.E,{fontSize:"sm",fontWeight:"600",children:(0,a.jsx)(M.g,{icon:s.oZz})})}),(0,a.jsxs)(R.Ap,{min:D().sm.width,max:D().xl.width,step:5,value:t,onChange:l,w:"60px",focusThumbOnChange:!1,colorScheme:"trueblue",size:"sm",children:[(0,a.jsx)(R.hB,{children:(0,a.jsx)(R.hJ,{})}),o?(0,a.jsx)(E.Tz,{placement:"top",label:(0,a.jsxs)(F.T,{spacing:0,children:[(0,a.jsx)(B.E,{color:"gray.400",children:n.name()}),(0,a.jsx)(B.E,{children:o.label})]}),children:(0,a.jsx)(R.OQ,{background:"trueblue.500"})}):(0,a.jsx)(R.OQ,{background:"trueblue.500"})]})]})},getDefaultOnParse:e=>e.childElementCount%2==0?D().lg.width:D().md.width,name:()=>d.Ru._({id:"LNoaEH"})},W=e=>{var t;let l,{containerSize:n,numCells:o,options:r,mobileMaxColumns:s=1,forceBalance:d=!1}=e,u=(null===(t=Object.values(D()).find(e=>e.width===r.cellSize))||void 0===t?void 0:t.targetColumns)||3,c=40/u,m=(0,f.FX)(),p=(0,v.GV)(k.wC)===P.w.SLIDE_VIEW,g=(0,v.GV)(k.yh),h=(0,_.A)({base:s,sm:2,md:3,xl:4},{fallback:m?"base":"xl"})||s,b=N.D1||p||g?4:m?s:h,y=O()(40*n,10,10*b),w=Math.max(1,Math.floor(y/c)),x=Math.min(w,o);if(d&&o>x&&o<=4)for(;x>=1&&o%x!=0;x--);let S=Math.ceil(o/x),A=o%x;if(A&&"center"===r.horizontalAlign){let e=(x-A)/2;l=(0,a.jsx)(i.az,{gridColumn:"span ".concat(6*e),gridRow:"".concat(S),className:"grid-offset"})}else if(A&&"right"===r.horizontalAlign){let e=x-A;l=(0,a.jsx)(i.az,{gridColumn:"span ".concat(6*e),gridRow:"".concat(S),className:"grid-offset"})}return{maxWidth:y,targetWidth:c,targetColumns:u,maxColumns:w,columns:x,lastRowAligner:l}};var U=l(57860);let G={key:"color",Control:e=>{let{value:t,updateValue:l,editor:n}=e;return(0,a.jsx)(U.a,{color:t,setColor:e=>l(e,!0),editor:n,analyticsSource:"SmartLayout"})},name:()=>"Color"};var H=l(3040),V=l(59392);let q={key:"isEmphasized",Control:e=>{let{value:t,editor:l,pos:n}=e;return(0,a.jsx)(V.I,{label:t?d.Ru._({id:"PDMbsX"}):d.Ru._({id:"m1crrt"}),icon:t?H.yy:s.yy,onClick:()=>{n&&l.chain().handleEmphasizeCell(n,!t).run()}})},name:()=>"Emphasis"},K={key:"horizontalAlign",defaultValue:()=>null,Control:e=>{let{value:t,updateValue:l}=e;return(0,a.jsx)(j.z,{spacing:0,dir:"ltr",children:g.gj.map(e=>{let{name:n,icon:o,alignment:i}=e;return(0,a.jsx)(V.I,{label:n(),icon:o,onClick:()=>{l(i===t?null:i)},isActive:t===i},n())})})},name:()=>d.Ru._({id:"0j+RGO"})},J={key:"orientation",defaultValue:()=>"vertical",Control:e=>{let{value:t,updateValue:l,option:n}=e;return(0,a.jsx)(V.I,{label:n.name(),onClick:()=>l("horizontal"===t?"vertical":"horizontal"),isActive:"horizontal"===t,icon:"horizontal"===t?s.dmS:s.B0C,testId:"smart-layout-orientation-option"})},name:()=>d.Ru._({id:"MRB7nI"})},$="1.5em",Q=(e,t,l)=>{let a=(0,f.FX)(),{columns:n}=W({containerSize:l,numCells:t,options:e,forceBalance:!0});return"vertical"===e.orientation||a||t>1&&1===n?{columns:1,isHorizontal:!1}:{columns:n,isHorizontal:!0}},Y=(0,u.memo)(e=>{let{children:t,options:l,numCells:o,containerSize:i}=e,{isHorizontal:r,columns:s}=Q(l,o,i),d=r?{columns:s,rowGap:$}:{columns:1};return(0,a.jsx)(n.r,{"data-selection-ring":!0,...d,pos:"relative",children:t})});Y.displayName="ArrowsWrapper";let X=(0,u.memo)(e=>{let{layoutOptions:t,children:l,numCells:n,layoutContainerSize:r,dragHandle:s,cellOptions:d,direction:u}=e,{isHorizontal:c}=Q(t,n,r),f=t.horizontalAlign,p=(0,g.yp)(f),{colorVars:h}=I(t,d,e.index,!0),b=c?{minW:0,transformOrigin:"center top",p:x.x,pt:0}:{transformOrigin:"left center",p:x.x,px:0},y=c?"column":"rtl"===u&&"left"===f?"row-reverse":"ltr"===u&&"right"===f?"row-reverse":"row";return(0,a.jsxs)(o.s,{direction:y,"data-selection-ring":!0,"data-content-reference":!0,pos:"relative",gap:$,minH:c?void 0:"6em",children:[(0,a.jsx)(Z,{...e}),(0,a.jsx)(i.az,{flex:"1",sx:{...b,...p,...h},className:m.VN,children:l}),s]})});X.displayName="ArrowsCell";let Z=(0,u.memo)(e=>{let{layoutOptions:t,cellOptions:l,label:n,index:s,updateAttributes:d,numCells:u,layoutContainerSize:f,direction:h}=e,{colorVars:b}=I(t,l,s),{isHorizontal:y}=Q(t,u,f),{width:v,height:k,fontSize:x,ref:S}=(0,p.Lf)(),A=(y?4:5)*x,C=1*x,z=y?"rtl"===h?"\n M ".concat(C," 0\n L 0 ").concat(A/2,"\n L ").concat(C," ").concat(A,"\n L ").concat(v," ").concat(A,"\n L ").concat(v-C," ").concat(A/2,"\n L ").concat(v," 0 Z"):"\n M ".concat(v-C," 0\n L ").concat(v," ").concat(A/2,"\n L ").concat(v-C," ").concat(A,"\n L 0 ").concat(A,"\n L ").concat(C," ").concat(A/2,"\n L 0 0 Z"):"\n M 0 ".concat(k-C,"\n L ").concat(A/2," ").concat(k,"\n L ").concat(A," ").concat(k-C,"\n L ").concat(A," 0\n L ").concat(A/2," ").concat(C,"\n L 0 0 Z"),j={fontSize:"1.5em",pos:"absolute",my:"0.5em",alignItems:"center",justifyContent:"center"};return(0,a.jsxs)(o.s,{lineHeight:"1",contentEditable:!1,align:"center",justify:"center",position:"relative",sx:{...b,...(0,g.yp)("center")},...y?{width:"100%",height:"".concat(4,"em")}:{width:"".concat(5,"em"),height:"100%"},ref:S,"data-export-as-image":!0,className:m.lR,children:[(0,a.jsx)(i.az,{as:"svg",pos:"absolute",inset:"0",w:"100%",overflow:"visible","data-testid":"arrow-svg",children:(0,a.jsx)(i.az,{as:"path",d:z,className:m.D6})}),y?(0,a.jsx)(w,{value:n||"",updateAttributes:d,placeholder:"".concat(s+1),className:(0,r.cx)(c.U6),sx:j,display:"flex",style:{width:"100%",userSelect:"none"}}):(0,a.jsx)(o.s,{sx:j,className:(0,r.cx)(c.U6),children:s+1})]})});Z.displayName="ArrowsLabel";let ee={key:"arrows",name:()=>d.Ru._({id:"YUGjgn"}),commandName:()=>d.Ru._({id:"IsJ7Ns"}),icon:s.vFJ,options:[{...J,defaultValue:()=>"horizontal"},G,{...K,defaultValue:(0,g.Ro)("left")},{...L,checkEnabled:e=>"vertical"!==e.options.orientation}],cellOptions:[G,q],Wrapper:Y,Cell:X,addDirection:e=>"horizontal"===e.orientation?"right":"bottom",isFullWidth:e=>"horizontal"===e.orientation,htmlTag:"arrows",keywords:["sequence","ordered","arrows","chevrons","roadmap"],defaultOptions:{cellSize:D().sm.width}};var et=l(35789),el=l(44507),ea=l(45965),en=l(93765),eo=l(48365);let ei=e=>{var t,l;let{index:n,theme:i,firstChildSize:s,layoutOptions:d,cellOptions:f,children:p,positionProps:g,markerProps:h,alignText:b,getPos:y,editor:v,markerFontSize:k}=e,w=(0,en.bh)(s,i),x=null===(l=d.numbered)||void 0===l||l,S=null===(t=(0,ea.ZD)()[k||"h3"])||void 0===t?void 0:t.size,A="".concat((x?S:1)+.75,"em"),C=(0,u.useCallback)(()=>{if(!v.isEditable)return;let e=v.state.doc.resolve(y());(0,eo.tN)(v,e)},[y,v]),z=(0,u.useMemo)(()=>(0,en.bh)(k||"h3",i),[k,i]),{colorVars:j}=I(d,f,n),F={...(0,el.nr)()?(0,c.U2)():void 0};return(0,a.jsxs)(o.s,{my:b?"var(--block-margin)":0,...g,contentEditable:!1,userSelect:"none",onMouseDown:C,cursor:"default",css:j,children:[(0,a.jsx)(et.o,{sx:w,h:"".concat(w.lineHeight,"em"),children:(0,a.jsx)(et.o,{fontSize:"var(--font-size)",h:A,w:A,className:m.SA,sx:F,...h,children:(0,a.jsx)(B.E,{sx:z,className:(0,r.cx)(c.U6),textAlign:"center",style:{lineHeight:1},children:x?n+1:""})})}),p]})},er={key:"numbered",defaultValue:()=>!0,Control:e=>{let{value:t,updateValue:l,option:n}=e;return(0,a.jsx)(V.I,{label:n.name(),onClick:()=>l(!t),isActive:t,icon:s.Tsj})},name:()=>d.Ru._({id:"mVQI+S"})},es=(0,u.memo)(e=>{let{children:t}=e;return(0,a.jsx)(o.s,{gap:"1em",direction:"row",wrap:"wrap","data-selection-ring":!0,pos:"relative",children:t})});es.displayName="BulletsWrapper";let ed=(0,u.memo)(e=>{let{children:t,...l}=e,{layoutOptions:n,cellOptions:r,numCells:s,layoutContainerSize:d,dragHandle:u}=l,{columns:c}=W({options:n,numCells:s,containerSize:d}),{colorVars:f}=I(n,r,e.index,!0);return(0,a.jsxs)(o.s,{direction:"row",align:"flex-start",gap:x.x,flex:"1 1 auto",w:"calc(".concat(100/c,"% - ").concat("1em",")"),"data-selection-ring":!0,"data-content-reference":!0,pos:"relative",children:[(0,a.jsx)(ei,{...l,alignText:!0}),(0,a.jsx)(i.az,{flex:"1",minW:"0",className:m.VN,css:f,pt:"var(--block-margin)",children:t}),u]})});ed.displayName="BulletsCell";let eu={key:"bullets",commandName:()=>d.Ru._({id:"eKiifW"}),name:()=>d.Ru._({id:"RYtHky"}),icon:s.dpu,options:[L,G,er],cellOptions:[G,q],Wrapper:es,Cell:ed,htmlTag:"bullets",keywords:["bullets","layout","list","bullet"]};var ec=l(46882),em=l(25817);let ef="0.5em",ep=e=>{let{containerSize:t,columnsNeeded:l}=e,a=(0,f.FX)(),n=(0,_.A)({base:1,sm:2,md:3,xl:4})||2;return(N.D1?4:a?2:n)*t{let{children:t,layoutOptions:l,flexProps:n,...r}=e,{index:s,direction:d}=r,{colorVars:u}=I(l,e.cellOptions,s,!0),c=(0,g.AS)("rtl"===d?"right":"left",e.direction);return(0,a.jsxs)(o.s,{direction:"row",align:"flex-start",gap:x.x,w:"100%","data-selection-ring":!0,"data-content-reference":!0,pos:"relative",...n,children:[(0,a.jsx)(ei,{...r,layoutOptions:l,alignText:!0,markerFontSize:"h4"}),(0,a.jsx)(i.az,{flex:"1",minW:"0",className:m.VN,css:u,pt:"var(--block-margin)",sx:c,children:t})]})});eg.displayName="StackedSmartLayoutCell";var eh=l(83380),eb=l(90406),ey=l(81594);let ev={ring:{thickness:.075,padAngle:0,roundness:0,iconSize:.75,circleScale:.8},flower:{thickness:.97,padAngle:3,roundness:.2,iconSize:1.25,circleScale:1},cycle:{thickness:.6,padAngle:2,roundness:0,pointiness:.33,iconSize:1,circleScale:1},circle:{thickness:.6,padAngle:3,iconSize:1,circleScale:1},semiCircle:{thickness:.5,padAngle:2,iconSize:1.5,circleScale:1}},ek=(0,u.memo)((0,u.forwardRef)((e,t)=>{let{flexProps:l,coords:n,...s}=e,{image:d,selectCell:f,layoutOptions:p,cellOptions:g,index:h,numCells:b,variant:y}=s,w=p.numbered&&b>1,{iconSize:x}=ev[y.key],S=(null==d?void 0:d.src)||(null==d?void 0:d.tempUrl),A=(0,eh.f)(),C=(0,u.useCallback)(()=>{null==f||f(),A({isOpen:!0})},[f,A]),{colorVars:z}=I(p,g,h),{arcPath:j,circleWidth:F}=n,R=!!d&&(0,eb.Xs)(d),_=(0,v.GV)(k.nD);return(0,a.jsxs)(o.s,{pos:"relative",ref:t,aspectRatio:"1/1",pointerEvents:"none","data-smart-layout-emphasis":!0,css:{contain:"layout"},...l,children:[(0,a.jsx)(i.az,{as:"svg",pos:"absolute",inset:0,viewBox:"0 0 ".concat(F," ").concat(F),overflow:"visible",className:m.D6,css:z,children:(0,a.jsx)(i.az,{as:"path",d:j,transform:"translate(".concat(F/2,"px, ").concat(F/2,"px) scale(").concat(F,")"),style:{vectorEffect:"non-scaling-stroke"}})}),(0,a.jsxs)(o.s,{className:"ring"===y.key?m.SA:m.lR,top:"".concat(n.centroidTop,"px"),left:"".concat(n.centroidLeft,"px"),pos:"absolute",contentEditable:!1,transform:"translate(-50%, -50%)",borderRadius:"999px !important",aspectRatio:"1/1",h:"2.5em",align:"center",direction:"column",justify:"center",css:z,children:[!S&&w&&(0,a.jsx)(B.E,{className:(0,r.cx)(c.U6),fontSize:"1.25em",display:"flex",children:h+1}),(S||_)&&(0,a.jsx)(i.az,{"data-smart-layout-image-drop-target":"true",className:(0,r.cx)("image"),overflow:"hidden",pointerEvents:"auto",h:"1.25em",w:"1.25em",fontSize:"".concat(1.25*x,"em"),pos:"absolute",opacity:S?1:0,_hover:{opacity:1},transition:"opacity 0.2s ease-in-out",children:(0,a.jsx)(ey.Y,{...s,image:d,imageShape:"square",handleEditableClick:C,hasQuickActions:!1,editWithoutSelection:!0,isInlineColorableSvg:R})})]})]})}));ek.displayName="CircleSegment";var ew=l(2940),ex=l.n(ew),eS=l(95197);let eA=ex()(eS.JL);function eC(e,t){return[e*Math.sin(t),-e*Math.cos(t)]}function ez(e,t,l,a){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,o=n>1e-9?Math.sin(n/2)*(t-e)*(2*a):0,[i,r]=eC((e+t)/2-o,l-n/2),s=(t-e)*a;return[i+s*Math.cos(l),r+s*Math.sin(l)]}let eI=ex()(function(e){let{innerRadius:t=0,outerRadius:l=0,startAngle:a=0,endAngle:n=2*Math.PI,pointStrength:o=.5,padAngle:i=0}=e,{innerStartAngle:r,innerEndAngle:s,outerStartAngle:d,outerEndAngle:u,innerArcSpan:c,outerArcSpan:m,isClockwise:f}=function(e,t,l,a,n){let o=a>l,i=Math.abs(a-l),r=l,s=a,d=l,u=a,c=i,m=i;if(n>1e-9){let i=n/2,f=Math.sqrt(e*e+t*t),p=0;e>1e-9&&(p=Math.asin(f/e*Math.sin(i)));let g=0;t>1e-9&&(g=Math.asin(f/t*Math.sin(i))),(c-=2*p)>1e-9?o?(r+=p,s-=p):(r-=p,s+=p):r=s=(l+a)/2,(m-=2*g)>1e-9?o?(d+=g,u-=g):(d-=g,u+=g):d=u=(l+a)/2}return{isClockwise:o,innerStartAngle:r,innerEndAngle:s,outerStartAngle:d,outerEndAngle:u,innerArcSpan:c,outerArcSpan:m}}(t,l,a,n,i),p=eC(l,d),g=eC(l,u),h=eC(t,r),b=eC(t,s),y=o*(f?1:-1),v=o>0,k=ez(t,l,d,y,f?0:i),w=ez(t,l,u,y,f?i:0),x=c>=Math.PI?1:0,S=m>=Math.PI?1:0;return{arcPath:["M ".concat(p[0]," ").concat(p[1]),v&&"L ".concat(k[0]," ").concat(k[1]),"L ".concat(h[0]," ").concat(h[1]),"A ".concat(t," ").concat(t," 0 ").concat(x," ").concat(f?1:0," ").concat(b[0]," ").concat(b[1]),v&&"L ".concat(w[0]," ").concat(w[1]),"L ".concat(g[0]," ").concat(g[1]),"A ".concat(l," ").concat(l," 0 ").concat(S," ").concat(f?0:1," ").concat(p[0]," ").concat(p[1]),"Z"].filter(Boolean).join(" "),centroid:eC((t+l)/2,((r+s)/2+(d+u)/2)/2+y*Math.PI/6)}}),ej={1:90,2:-180,3:-150,4:-90,5:-90,6:-60,7:-60,8:-45},eF=ex()(e=>{var t;let l,a,{index:n,numCells:o,variant:i,direction:r,semi:s,themeRoundness:d}=e,u=(s?-90:null!==(t=ej[o])&&void 0!==t?t:0)*("rtl"===r?-1:1),c=(s?180:360)/o*("rtl"===r?-1:1),m=n*c+u,f=m+c,p=(m+f)/2,g=Math.PI/180*((90-p)%360),{thickness:h,padAngle:b,roundness:y=d,pointiness:v}=ev[i],k=.5*(1-h);if(v){let e=eI({innerRadius:k,outerRadius:.5,startAngle:m*Math.PI/180,endAngle:f*Math.PI/180,padAngle:b*Math.PI/180,pointStrength:v});l=e.arcPath,a=e.centroid}else{let e=eA({innerRadius:k,outerRadius:.5,startAngle:m*Math.PI/180,endAngle:f*Math.PI/180,padAngle:b*Math.PI/180,cornerRadius:y});l=e()||"",a=e.centroid()}let w=a[0],x=a[1],S=(p+360)%360;return{outsideX:.5*Math.cos(g),outsideY:.5*Math.sin(g),centroidX:w,centroidY:x,arcPath:l,sideX:S>0&&S<=180?"right":"left",sideY:S>90&&S<=270?"bottom":"top",startAngle:m,midpointAngle:p,endAngle:f}}),eB=e=>{let{index:t,numCells:l,variant:a,direction:n,semi:o=!1,themeRoundness:i}=e,{width:r,height:s,top:d,left:u,ref:c}=(0,p.Lf)(),m=eF({index:t,numCells:l,variant:a,direction:n,semi:o,themeRoundness:i}),{outsideX:f,outsideY:g,centroidX:h,centroidY:b}=m,y=s*(.5-g)*(o?2:1),v=s*(.5+b)*(o?2:1),k=s*(.5+f)*(o?2:1),w=s*(.5+h)*(o?2:1);return{...m,outsideTop:y,outsideLeft:k,centroidTop:v,centroidLeft:w,circleRef:c,circleWidth:r,circleHeight:s,circleTop:d,circleLeft:u}},eR=ex()(e=>{var t;let l=360/e,a=null!==(t=ej[e])&&void 0!==t?t:0,n=[],o=[],i=[];for(let t=0;t0&&r<=180?"right":"left",d=(90-e)%360*Math.PI/180,u=Math.sin(d),c={index:t,angle:e,sideX:s,sideY:r>90&&r<=270?"bottom":"top",x:Math.cos(d),y:u,columnPosition:-1};"left"===s?n.push(c):o.push(c),i.push(c)}return n.sort((e,t)=>t.y-e.y),o.sort((e,t)=>t.y-e.y),n.forEach((e,t)=>{e.columnPosition=t}),o.forEach((e,t)=>{e.columnPosition=t}),{items:i,leftItems:n,rightItems:o}}),e_=(e,t)=>{let{items:l,rightItems:a,leftItems:n}=eR(t),{columnPosition:o,sideX:i}=l[e],r=function(e,t){return Math.abs(e*t)/function(e,t){for(;0!==t;){let l=t;t=e%t,e=l}return e}(e,t)}(a.length,n.length),s="right"===i?a.length:n.length,d=1===t?3:r/s;return{rowStart:o*d+1,rowSpan:d,numRows:r,verticalAlign:"center"}},eM=(0,u.memo)(e=>{let{children:t,containerSize:l,variant:n}=e,o=ep({containerSize:l,columnsNeeded:3}),{circleScale:i}=ev[n.key];return(0,a.jsx)(ec.x,{pos:"relative","data-selection-ring":"padded",templateColumns:"1fr calc(".concat(100*(o?.8:.35*i),"% * var(--media-scale, 1)) 1fr"),autoRows:"auto",rowGap:o?ef:"1.5em",dir:"ltr",children:t})});eM.displayName="CircleWrapper";let eE=(0,u.memo)(e=>ep({containerSize:e.layoutContainerSize,columnsNeeded:3})?(0,a.jsx)(eO,{...e}):(0,a.jsx)(eT,{...e}));eE.displayName="CircleCell";let eT=(0,u.memo)(e=>{let{children:t,index:l,numCells:n,dragHandle:r,variant:s,direction:d,theme:u}=e,{roundness:c}=(0,C.M)(u),{pathRounding:f}=S.T5[c],{circleRef:p,...h}=eB({index:l,numCells:n,variant:s.key,direction:d,themeRoundness:f}),b="right"===h.sideX,y=b?"left":"right",v=(0,g.yp)(y),k=(h.midpointAngle+360)%180==90,{rowStart:w,rowSpan:x,numRows:A,verticalAlign:z}=e_(l,n),I=k?"2em":"flower"===s.key?"0em":A%2==0?"1.5em":"1em";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.s,{gridColumn:b?3:1,gridRow:"".concat(w," / span ").concat(x),zIndex:"1",sx:{...v,...(0,g.AS)(y,"ltr"),...b?{pl:I}:{pr:I}},direction:"column",justify:z,className:m.VN,minW:"0",children:(0,a.jsxs)(i.az,{"data-content-reference":!0,"data-smart-layout-emphasis":!0,"data-selection-ring":"padded",pos:"relative",w:"100%",children:[t,r]})}),(0,a.jsx)(ek,{...e,flexProps:{gridColumn:2,gridRow:"1 / span ".concat(A),alignSelf:"center"},coords:h,ref:p})]})}),eO=(0,u.memo)(e=>{let{index:t,numCells:l,direction:n,variant:o,theme:i}=e,{roundness:r}=(0,C.M)(i),{pathRounding:s}=S.T5[r],{circleRef:d,...u}=eB({index:t,numCells:l,variant:o.key,direction:n,themeRoundness:s});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ek,{...e,flexProps:{gridRow:1,gridColumn:2},coords:u,ref:d}),(0,a.jsx)(eg,{flexProps:{gridColumn:"1 / span 3",gridRow:"auto",dir:n},...e})]})});eO.displayName="CircleCellStacked";let eP={key:"circle",name:()=>d.Ru._({id:"7xMmki"}),commandName:()=>d.Ru._({id:"WfQ7Cv"}),icon:s.O0T,keywords:["circle","ring","radial","donut","circular"],options:[G,er],cellOptions:[G,q],Wrapper:eM,Cell:eE,addDirection:()=>"bottom",featureFlag:"circleSmartLayouts",defaultAttrs:{image:{source:em.Z.key}},htmlTag:"circle"},eN={...eP,key:"cycle",name:()=>d.Ru._({id:"qicHbX"}),commandName:()=>d.Ru._({id:"7kXIPI"}),icon:s.yNr,htmlTag:"cycle",keywords:["cyclical","flywheel","circle","circular","recycle"]},eD={...eP,key:"flower",name:()=>d.Ru._({id:"abEdHK"}),commandName:()=>d.Ru._({id:"A5sR7M"}),icon:s.xnU,keywords:["petals","clover","butterfly"],htmlTag:"flower"},eL={...eP,key:"ring",name:()=>d.Ru._({id:"EKlSR5"}),commandName:()=>d.Ru._({id:"pEs88A"}),icon:s.GEE,keywords:["ring","circle","circular"],htmlTag:"ring"},eW=(0,u.memo)(e=>{let{children:t,containerSize:l}=e;return ep({containerSize:l,columnsNeeded:3})?(0,a.jsx)(ec.x,{pos:"relative","data-selection-ring":"padded",templateColumns:"1fr",templateRows:"auto auto",rowGap:ef,dir:"ltr",children:t}):(0,a.jsx)(ec.x,{pos:"relative","data-selection-ring":"padded",autoColumns:"1fr",autoRows:"auto",columnGap:"1.5em",rowGap:"2em",children:t})});eW.displayName="SemiCircleWrapper";let eU=(0,u.memo)(e=>ep({containerSize:e.layoutContainerSize,columnsNeeded:3})?(0,a.jsx)(eH,{...e}):(0,a.jsx)(eG,{...e}));eU.displayName="SemiCircleCell";let eG=(0,u.memo)(e=>{let{children:t,index:l,numCells:n,dragHandle:i,variant:r,direction:s,theme:d}=e,u=(0,g.yp)("center"),{roundness:c}=(0,C.M)(d),{pathRounding:m}=S.T5[c],{circleRef:f,...p}=eB({index:l,numCells:n,variant:r.key,direction:s,semi:!0,themeRoundness:m}),h=n>4?"70%":"60%";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(o.s,{direction:"column",align:"center",justify:"flex-end",pos:"relative",zIndex:"1","data-content-reference":!0,"data-smart-layout-emphasis":!0,"data-selection-ring":"padded",sx:{...u,...(0,g.AS)("center","ltr")},mb:n>2?"-".concat(.6*p.outsideTop,"px"):void 0,children:[t,i]}),(0,a.jsx)(ek,{...e,flexProps:{gridRow:2,gridColumn:"1 / span ".concat(n),alignSelf:"start",justifySelf:"center",aspectRatio:"2/1",width:"calc(".concat(h," * var(--media-scale, 1))")},coords:p,ref:f})]})});eG.displayName="SemiCircleCellTop";let eH=(0,u.memo)(e=>{let{index:t,numCells:l,direction:n,variant:o,theme:i}=e,{roundness:r}=(0,C.M)(i),{pathRounding:s}=S.T5[r],{circleRef:d,...u}=eB({index:t,numCells:l,variant:o.key,direction:n,semi:!0,themeRoundness:s});return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ek,{...e,flexProps:{gridRow:1,gridColumn:1,alignSelf:"start",justifySelf:"center",aspectRatio:"2/1",width:"calc(100% * var(--media-scale, 1))"},coords:u,ref:d}),(0,a.jsx)(eg,{flexProps:{gridColumn:1,gridRow:"auto",dir:n},...e})]})});eH.displayName="SemiCircleCellStacked";let eV={...eP,key:"semiCircle",name:()=>d.Ru._({id:"r9sPHK"}),commandName:()=>d.Ru._({id:"yLo45W"}),Wrapper:eW,Cell:eU,addDirection:()=>"right",htmlTag:"semicircle",keywords:["semicircle","arc","circle","radial"],icon:s.jiG};var eq=l(93681),eK=l(54979),eJ=l(4296);let e$={top:{name:"Top",icon:s.qXP},left:{name:"Left",icon:s.Usg}},eQ=[{label:()=>d.Ru._({id:"yrC1Cd"}),key:"xs"},{label:()=>d.Ru._({id:"4Revpc"}),key:"sm"},{label:()=>d.Ru._({id:"agPptk"}),key:"md"},{label:()=>d.Ru._({id:"k7rCa/"}),key:"lg"},{label:()=>d.Ru._({id:"vp6Yr4"}),key:"xl"},{label:()=>d.Ru._({id:"CK1KXz"}),key:"full"}],eY={key:"shapeSize",defaultValue:()=>null,Control:e=>{let{value:t,updateValue:l,option:n}=e,o=eQ.findIndex(e=>e.key===t);-1===o&&(o=3);let{label:i}=eQ[o],r=(0,u.useCallback)(e=>{let{key:t}=eQ[e];l(t)},[l]);return(0,a.jsxs)(j.z,{spacing:2,mr:2,children:[(0,a.jsx)(E.Tz,{placement:"top",label:(0,a.jsxs)(F.T,{spacing:0,children:[(0,a.jsx)(B.E,{color:"gray.400",children:n.name()}),(0,a.jsx)(B.E,{children:i()})]}),children:(0,a.jsx)(B.E,{fontSize:"sm",fontWeight:"600",children:(0,a.jsx)(M.g,{icon:n.icon,fixedWidth:!0})})}),(0,a.jsxs)(R.Ap,{min:0,max:eQ.length-1,step:1,value:o,onChange:r,w:"60px",focusThumbOnChange:!1,colorScheme:"trueblue",size:"sm",children:[(0,a.jsx)(R.hB,{children:(0,a.jsx)(R.hJ,{})}),(0,a.jsx)(E.Tz,{placement:"top",label:(0,a.jsxs)(F.T,{spacing:0,children:[(0,a.jsx)(B.E,{color:"gray.400",children:n.name()}),(0,a.jsx)(B.E,{children:i()})]}),children:(0,a.jsx)(R.OQ,{background:"trueblue.500"})})]})]})},name:()=>d.Ru._({id:"FeDgKA"}),icon:s.j3q},eX=(0,u.memo)(e=>{let{children:t,options:l,numCells:o,containerSize:i}=e,{columns:r,lastRowAligner:s}=W({containerSize:i,options:l,numCells:o,forceBalance:!1});return(0,a.jsxs)(n.r,{columns:6*r,rowGap:"3em",columnGap:"1.5em","data-selection-ring":"padded",pos:"relative",borderRadius:"var(--box-border-radius)",children:[t,s]})});eX.displayName="ImagesWithTextWrapper";let eZ={xs:.3,sm:.44,md:.58,lg:.72,xl:.86,full:1},e0={xs:.15,sm:.2,md:.25,lg:.3,xl:.35,full:.4},e1=(0,u.memo)(e=>{var t,l,n;let{children:s,image:d,layoutOptions:c,cellOptions:f,numCells:p,layoutContainerSize:h,isContentEmpty:b,isLayoutFocused:y,variant:v,dragHandle:k,...w}=e,x="left"==c.imagePosition,S=null!==(l=c.imageShape)&&void 0!==l?l:"square",C=eK.z[S],z=v.key==e6.key,I=(null==d?void 0:d.source)==em.Z.key||z,j=c.shapeSize||!c.imageSize||I?I?e0[c.shapeSize||"md"]:eZ[c.shapeSize||"full"]:c.imageSize,F=null==d?void 0:null===(t=d.meta)||void 0===t?void 0:t.has_transparency,B=c.horizontalAlign,R=(0,g.yp)(B),_=null!==(n=null==f?void 0:f.color)&&void 0!==n?n:c.color,M=(0,u.useMemo)(()=>(0,A.q9)(_,0),[_]),{columns:E}=W({containerSize:h,options:c,numCells:p,forceBalance:!1}),T=1===E,O=j<=eZ.xs,P=(0,u.useMemo)(()=>z?"min(100%, ".concat(D().sm.width*j,"em)"):T?"min(100%, ".concat(D().xl.width*j,"em)"):"100%",[j,z,T]),N=!!d&&(0,eb.Xs)(d),L=I?{aspectRatio:"1 / 1",...N&&{"svg.colorable-icon path":{fill:_||"url(#theme-accent-gradient-linear) var(--accent-color-readable)"}},...O&&x&&{mt:".175em"}}:F?{...C}:{...eq.z,...C},U={...M},G=(0,eh.f)(),{selectCell:H}=w,V=(0,u.useCallback)(()=>{null==H||H()},[H]),q=(0,u.useCallback)(()=>{null==H||H(),G({isOpen:!0})},[H,G]);return(0,a.jsxs)(o.s,{borderRadius:"var(--box-border-radius)",gap:b&&!y?0:O?"1em":"1.25em",direction:x?"right"===B?"row-reverse":"row":"column",align:"center",justify:"center",sx:{...R,...x&&{alignItems:"flex-start"}},"data-selection-ring":"padded","data-content-reference":!0,pos:"relative",gridColumn:"span ".concat(6),children:[(0,a.jsx)(i.az,{"data-smart-layout-image-drop-target":"true",className:(0,r.cx)("image"),w:"calc(".concat(100*j,"% * var(--media-scale))"),maxW:P,overflow:"hidden",sx:L,style:{...(0,g.O8)(B),...x?{"--descendant-align-self-left":"flex-start","--descendant-align-self-right":"flex-start","--descendant-align-self-center":"flex-start","--descendant-align-self":"flex-start"}:{}},children:(0,a.jsx)(ey.Y,{image:d,imageShape:S,handleEditableClick:V,handleEditableDoubleClick:q,hasQuickActions:!0,isInlineColorableSvg:N,...w})}),(0,a.jsx)(i.az,{minW:x?"8em":"100%",maxW:"100%",flex:"1",sx:U,className:m.VN,"data-content-empty":b,css:M,children:s}),k]})});e1.displayName="ImageWithTextCell";let e2={key:"imagesText",name:()=>d.Ru._({id:"cDxTeG"}),commandName:()=>d.Ru._({id:"d+mR/1"}),keywords:["team","caption","images","text","layout"],icon:s.oMV,options:[{...L,getDefaultOnParse:()=>D().sm.width},{...eY,icon:s.Cyq,name:()=>d.Ru._({id:"8J92vb"})},eK.K,{...K,defaultValue:(0,g.Ro)("left")}],cellOptions:[q],Wrapper:eX,Cell:e1,addDirection:e=>"left"===e.imagePosition?"bottom":"right",htmlTag:"images",defaultOptions:{imageShape:"landscape"}},e6={name:()=>d.Ru._({id:"joUkNe"}),commandName:()=>d.Ru._({id:"oEHjy6"}),key:"iconsText",icon:s.cCs,keywords:["icons","text","layout"],options:[{key:"imagePosition",defaultValue:()=>"top",Control:e=>{let{value:t,updateValue:l,editor:n,option:o}=e;return(0,a.jsx)(eJ.y,{value:t,updateValue:l,defaultIcon:s.qXP,editor:n,choices:e$,option:o})},name:()=>d.Ru._({id:"p9OBc7"}),defaultValue:()=>"top",name:()=>d.Ru._({id:"5ftr3E"}),checkEnabled(e,t){let l=e.options.horizontalAlign;return!l||((null==t?void 0:t.direction)==="rtl"?"right"===l:"left"===l)}},G,{...L,getDefaultOnParse:()=>D().sm.width},{...eY,icon:s.Cyq,name:()=>d.Ru._({id:"bwZEQG"})},{...K,defaultValue:(0,g.Ro)("left"),checkEnabled(e,t){let l=e.options.imagePosition;return(null==t?void 0:t.direction)==="rtl"?"right"!==l:"left"!==l}}],cellOptions:[{...G,checkEnabled:e=>!e.image||(0,eb.Xs)(e.image)},q],Wrapper:eX,Cell:e1,addDirection:e=>"left"===e.imagePosition?"bottom":"right",defaultAttrs:{image:{source:em.Z.key}},htmlTag:"icons"},e4="40em",e5="0.25em";var e3=l(73758),e8=l.n(e3);let e7=(0,u.memo)(e=>{let{Step:t=tn,node:l,...n}=e,{children:i,numCells:r,options:s,theme:d,direction:u}=n,c=s.horizontalAlign||"center",m=(0,g.yp)(c),f="funnel"===n.variant.key,p="staircase"===n.variant.key,h=e8()(r).map(e=>{var n;let o=null===(n=l.maybeChild(e))||void 0===n?void 0:n.attrs.options;return(0,a.jsx)(e9,{index:e,numCells:r,theme:d,isFunnel:f,alignment:c,direction:u,isStepped:p,cellOptions:o,layoutOptions:s,Step:t},e)});return(0,a.jsxs)(o.s,{direction:"column","data-selection-ring":!0,align:"stretch",gap:"1em",children:[(0,a.jsx)(o.s,{direction:"column",sx:m,contentEditable:!1,gap:e5,"data-alternate-colors":!0,children:h}),(0,a.jsx)(o.s,{gap:ef,direction:"column",children:i})]})});e7.displayName="StackedPyramidWrapper";let e9=e=>{let{index:t,numCells:l,cellOptions:n,layoutOptions:o,isFunnel:i,alignment:r,direction:s,isStepped:d,Step:u}=e,c=!d&&i&&t===l-1?{pos:"relative",bottom:"0.25em"}:d||i||0!==t?{}:{pos:"relative",top:"0.25em"},{colorVars:m}=I(o,n,t,!1);return(0,a.jsx)(u,{index:t,numCells:l,isOutside:!0,isNumbered:!0,isStacked:!0,isFunnel:i,alignment:r,direction:s,stepSx:m,children:(0,a.jsx)(ta,{index:t,...c})},t)},te=(e,t)=>"right"===e?"right":"left"===e?"left":"ltr"===t?"left":"right",tt=(0,u.memo)(e=>{let t=ep({containerSize:e.containerSize,columnsNeeded:e.options.outsideText&&!e.scaleContentToFit?3:2}),{colorVars:l}=I(e.options,void 0,void 0,!0);return t?(0,a.jsx)(e7,{...e}):(0,a.jsx)(n.r,{columns:1,autoRows:"1fr","data-selection-ring":!0,gap:e5,sx:e.options.outsideText?l:void 0,children:e.children})});tt.displayName="PyramidWrapper";let tl=(0,u.memo)(e=>{let{Step:t=tn,isFunnel:l=!1,isStepped:n=!1,alignment:r="center",...s}=e,{children:d,layoutOptions:u,index:c,numCells:f,dragHandle:p,direction:h}=s,b=u.outsideText,y=ep({containerSize:s.layoutContainerSize,columnsNeeded:b&&!s.scaleContentToFit?3:2}),{colorVars:v}=I(u,s.cellOptions,c),{colorVars:k}=I(u,s.cellOptions,c,!0);if(y)return(0,a.jsx)(eg,{...s});let w=u.numbered,S=te(r,h),A={...(0,g.yp)(S,h),...(0,g.AS)(S,h)},C=n?{bottom:"-1px"}:l?{top:"calc(-1px - ".concat(e5," / 2 )")}:{bottom:"calc(-1px - ".concat(e5," / 2 )")},z=l?0===c:c===f-1,j=n?"0.5em":e5,F=w&&b&&!n,B=F&&l&&c===f-1?{pos:"relative",bottom:"15%"}:F&&!l&&0===c?{pos:"relative",top:"15%"}:{},R="rtl"===h&&"left"===r?"row-reverse":"ltr"===h&&"right"===r?"row-reverse":"row";return(0,a.jsxs)(o.s,{"data-selection-ring":!0,"data-content-reference":!0,pos:"relative",w:"100%",direction:R,justify:b||"center"!==r?void 0:"center",children:[(0,a.jsxs)(t,{numCells:f,index:c,isFunnel:l,isOutside:b,isNumbered:w,alignment:r,selectCell:s.selectCell,stepSx:v,direction:h,children:[b?w?(0,a.jsx)(ta,{index:c,...B}):null:d,p]}),b&&(0,a.jsxs)(o.s,{direction:"column",justify:"center",minW:0,flex:1,px:x.x,py:x.x,pos:"relative",sx:A,className:m.VN,css:k,children:[d,!z&&(0,a.jsx)(i.az,{contentEditable:!1,position:"absolute",...C,insetStart:j,insetEnd:j,h:"var(--line-thickness)",transform:"scaleY(0.5)",className:m.eI})]})]})});tl.displayName="PyramidCell";let ta=(0,u.memo)(e=>{let{index:t,...l}=e;return(0,a.jsx)(B.E,{className:(0,r.cx)(c.U6,m.lR),fontSize:"1.25em",display:"flex",sx:(0,g.yp)("center"),pos:"relative",contentEditable:!1,...l,children:t+1})});ta.displayName="PyramidLabel";let tn=(0,u.memo)(e=>{let{numCells:t,index:l,isFunnel:n,isOutside:i,isStacked:r,children:s,alignment:d,selectCell:u,stepSx:c,direction:f}=e,h=n?t-l-1:l,{width:b,height:y,ref:v}=(0,p.Lh)(),k=i?0:45,w=i&&!r?50:100,S=ti(t,h,k),A=.99*ti(t,h+1,k),C=w/100*A,z=(0,g.yp)(d,f),I=(0,g.AS)(d,f),j=r?void 0:i?{ms:"center"===d?"".concat((w-C)/2,"%"):void 0}:{maxW:"calc(".concat(e4," * ").concat(C/100,")")};return(0,a.jsxs)(o.s,{direction:"column",ref:v,"data-testId":"pyramid-step",pos:"relative",w:"".concat(C,"%"),sx:{...z,...I,...c},onClick:i?u:void 0,contentEditable:!i&&void 0,...j,children:[(0,a.jsx)(to,{width:b,height:y,alignment:d,topSize:n?1:S/A,bottomSize:n?S/A:1}),(0,a.jsx)(o.s,{direction:"column",justify:"center",h:"100%",p:i?"0.5em":x.x,boxSizing:"border-box",sx:{...z,alignItems:i?z.alignItems:"stretch"},className:m.lR,w:"".concat((S+A)/2/A*100,"%"),minW:"3em",children:s})]})});tn.displayName="PyramidStep";let to=(0,u.memo)(e=>{let{width:t,height:l,topSize:n,bottomSize:o,alignment:r}=e,s=t*(1-n)/2,d=t*(1-o)/2,u="left"===r?"\n M 0 0\n L ".concat(t-2*s," 0\n L ").concat(t-2*d," ").concat(l,"\n L 0 ").concat(l,"\n L 0 0 Z"):"right"===r?"\n M ".concat(2*s," 0\n L ").concat(t," 0\n L ").concat(t," ").concat(l,"\n L ").concat(2*d," ").concat(l,"\n L ").concat(2*s," 0 Z"):"\n M ".concat(s," 0\n L ").concat(t-s," 0\n L ").concat(t-d," ").concat(l,"\n L ").concat(d," ").concat(l,"\n L ").concat(s," 0 Z");return(0,a.jsx)(i.az,{as:"svg",pos:"absolute",inset:"0",overflow:"visible",contentEditable:!1,"data-testid":"trapezoid-svg",w:"".concat(t,"px"),h:"".concat(l,"px"),children:(0,a.jsx)(i.az,{as:"path",d:u,className:m.D6})})});to.displayName="TrapezoidSVG";let ti=(e,t,l)=>l+t/e*(100-l),tr={...er,checkEnabled:e=>e.options.outsideText},ts={key:"pyramid",name:()=>d.Ru._({id:"MYceoI"}),commandName:()=>d.Ru._({id:"CPkQNq"}),icon:s.IJv,options:[{key:"outsideText",defaultValue:()=>!0,Control:e=>{let{value:t,updateValue:l,option:n}=e;return(0,a.jsx)(V.I,{label:n.name(),onClick:()=>l(!t),isActive:t,icon:s.LEB})},name:()=>d.Ru._({id:"OtsbQu"})},tr,G],cellOptions:[G,q],Wrapper:tt,Cell:tl,addDirection:()=>"bottom",htmlTag:"pyramid"},td=(0,u.memo)(e=>(0,a.jsx)(tl,{...e,isFunnel:!0}));td.displayName="FunnelCell";let tu={...ts,key:"funnel",name:()=>d.Ru._({id:"MWYJBI"}),commandName:()=>d.Ru._({id:"HTZVrr"}),icon:s.AKc,htmlTag:"funnel",Cell:td},tc=(0,u.memo)(e=>{let{children:t,options:l,containerSize:n}=e,i=(0,g.yp)(l.horizontalAlign||"left"),{colorVars:r}=I(l);if(ep({containerSize:n,columnsNeeded:e.options.outsideText&&!e.scaleContentToFit?3:2}))return(0,a.jsx)(e7,{...e,Step:tm});let s={...i,...l.outsideText?r:{}};return(0,a.jsx)(o.s,{direction:"column","data-selection-ring":!0,gap:"0.5em",sx:s,children:t})});tc.displayName="StaircaseWrapper";let tm=(0,u.memo)(e=>{let{numCells:t,index:l,isOutside:n,isStacked:i,children:r,alignment:s,direction:d,selectCell:u,stepSx:c}=e,f=(0,g.yp)(s,d),p={...f,alignItems:n?f.alignItems:"stretch",...c},h=n&&!i?50:100,b=h/100*ti(t,l+1,n?0:45),y=i?void 0:n?{ms:"center"===s?"".concat((h-b)/2,"%"):void 0}:{maxW:"calc(".concat(e4," * ").concat(b/100,")")};return(0,a.jsx)(o.s,{py:n?"0.5em":x.x,px:x.x,sx:p,className:m.SA,w:"".concat(b,"%"),boxSizing:"border-box",...y,direction:"column",justify:"center",contentEditable:!n&&void 0,onClick:n?u:void 0,pos:"relative",children:r})});tm.displayName="StaircaseStep";let tf=(0,u.memo)(e=>{let t=e.layoutOptions.horizontalAlign;return(0,a.jsx)(tl,{...e,Step:tm,isFunnel:!1,isStepped:!0,alignment:t})});tf.displayName="StaircaseCell";let tp={...ts,key:"staircase",name:()=>d.Ru._({id:"CFVHFO"}),commandName:()=>d.Ru._({id:"DuZtoX"}),options:[...ts.options,{...K,defaultValue:(0,g.Ro)("left")}],icon:s.UER,Wrapper:tc,Cell:tf,htmlTag:"staircase"};var tg=l(1906);let th=(0,u.memo)(e=>{let{children:t,options:l,containerSize:o,numCells:i}=e,{columns:r,lastRowAligner:s}=W({containerSize:o,options:l,numCells:i,forceBalance:!1});return(0,a.jsxs)(n.r,{columns:6*r,rowGap:"3em",columnGap:"1.5em","data-selection-ring":"padded",pos:"relative",borderRadius:"var(--box-border-radius)",children:[t,s]})});th.displayName="CircleStatsWrapper";let tb={xs:.35,sm:.48,md:.61,lg:.74,xl:.87,full:1},ty=(0,u.memo)(e=>{let{theme:t,children:l,layoutOptions:n,cellOptions:s,label:d,updateAttributes:u,isContentEmpty:p,isLayoutFocused:h,dragHandle:b,index:y}=e,v=(0,C.M)(t),k=n.horizontalAlign,x=(0,g.yp)(k),S=(0,tg.dD)(e),A=(0,eS.JL)({innerRadius:41,outerRadius:50}),z=A({startAngle:0,endAngle:2*S*Math.PI}),j=A({startAngle:0,endAngle:2*Math.PI}),F=tb[n.shapeSize]||1,B="min(100%, ".concat(D().md.width*F,"em)"),R=(0,f.FX)(),{colorOverride:_,headingColorCss:M}=I(n,s,y,!0),{colorVars:E}=I(n,s,y),{colorVars:T}=I(n,s,y,!1),{useTransparentTrack:O,shouldRecolorTrack:P}=tk(v,_);return(0,a.jsxs)(o.s,{borderRadius:"var(--box-border-radius)",direction:"column",align:"center",justify:"start","data-selection-ring":"padded","data-content-reference":!0,pos:"relative",gap:p&&!h?0:"1em",sx:x,className:m.VN,gridColumn:"span ".concat(6),children:[(0,a.jsxs)(o.s,{direction:"column",align:"center",justify:"center",width:"".concat(100*F,"%"),maxW:B,pos:"relative",contentEditable:!1,py:"0.25em",css:{...M},children:[(0,a.jsx)(w,{value:d||"",updateAttributes:u,pos:"absolute",left:"".concat(9,"%"),className:(0,r.cx)(c.U6),fontSize:R?"".concat(2*F,"em"):"".concat(2.5*F,"em"),lineHeight:1,display:"flex",alignItems:"center",sx:(0,g.yp)("center"),style:{width:"".concat(82,"%")}}),(0,a.jsxs)("svg",{width:"100%",viewBox:"".concat(-50," ").concat(-50," ").concat(100," ").concat(100),overflow:"visible",children:[(0,a.jsx)(i.az,{as:"path",d:j||void 0,className:m.D6,style:{fill:O?"var(--card-color)":void 0},"data-testid":"stats-track",css:P?E:void 0}),(0,a.jsx)(i.az,{as:"path",d:z||void 0,className:m._B,"data-testid":"stats-fill",css:T})]})]}),(0,a.jsx)(i.az,{w:"100%","data-content-empty":p,children:l}),b]})});ty.displayName="CircleStatsCell";let tv={key:"circleStats",name:()=>d.Ru._({id:"mvpFPS"}),commandName:()=>d.Ru._({id:"4Rg7EO"}),icon:s.ItB,options:[L,{...eY,name:()=>d.Ru._({id:"1C+7U1"}),icon:s.GEE},G,{...K,defaultValue:(0,g.Ro)("center")}],cellOptions:[G,q],Wrapper:th,Cell:ty,defaultAttrs:{label:"50%"},addDirection:()=>"right",keywords:["stats","circle"],htmlTag:"circles"},tk=(e,t)=>{let l="default"!==e.shapeColorScheme;return{useTransparentTrack:"none"===e.shapeFill||"solid"===e.shapeFill&&"custom"===e.shapeColorScheme||t&&l,shouldRecolorTrack:l}},tw=(0,u.memo)(e=>{let{children:t,options:l,containerSize:o,numCells:i}=e,{columns:r,lastRowAligner:s}=W({containerSize:o,options:l,numCells:i,forceBalance:!1});return(0,a.jsxs)(n.r,{columns:6*r,rowGap:"3em",columnGap:"1.5em","data-selection-ring":"padded",pos:"relative",borderRadius:"var(--box-border-radius)",children:[t,s]})});tw.displayName="BarStatsWrapper";let tx=(0,u.memo)(e=>{let{theme:t,children:l,layoutOptions:n,cellOptions:s,label:d,updateAttributes:u,isContentEmpty:f,isLayoutFocused:p,dragHandle:h,index:b}=e,y=(0,C.M)(t),v=n.horizontalAlign,k=(0,g.yp)(v),x=(0,tg.dD)(e),{colorOverride:S,headingColorCss:A}=I(n,s,b,!0),{colorVars:z}=I(n,s,b),{colorVars:j}=I(n,s,b,!1),{useTransparentTrack:F,shouldRecolorTrack:B}=tk(y,S);return(0,a.jsxs)(o.s,{borderRadius:"var(--box-border-radius)",direction:"column",align:"center",justify:"start",sx:k,"data-selection-ring":"padded","data-content-reference":!0,pos:"relative",gap:f&&!p?0:"0.75em",gridColumn:"span ".concat(6),className:m.VN,children:[(0,a.jsxs)(o.s,{direction:"row",align:"center",justify:"stretch",width:"100%",pos:"relative",contentEditable:!1,gap:"0.75em",css:A,children:[(0,a.jsxs)(i.az,{flex:"1",my:"0.5em",pos:"relative",borderRadius:"var(--box-border-radius)",children:[(0,a.jsx)(i.az,{pos:"absolute",inset:"0",className:m.SA,style:F?{background:"var(--card-color)"}:void 0,css:B?z:void 0}),(0,a.jsx)(i.az,{w:"".concat(100*x,"%"),h:"1.25em",pos:"relative",className:m.P7,borderRadius:"inherit",css:j})]}),(0,a.jsx)(w,{value:d||"",updateAttributes:u,className:(0,r.cx)(c.U6),lineHeight:1,display:"flex",alignItems:"center",sx:k,fontSize:"1.25em",inputProps:{textAlign:"right",width:"4em",py:0},minW:"1em"})]}),(0,a.jsx)(i.az,{w:"100%","data-content-empty":f,children:l}),h]})});tx.displayName="BarStatsCell";let tS={key:"barStats",name:()=>d.Ru._({id:"LYRXtx"}),commandName:()=>d.Ru._({id:"MSp/ys"}),icon:s.dYn,options:[L,G,{...K,defaultValue:(0,g.Ro)("left")}],cellOptions:[G,q],Wrapper:tw,Cell:tx,defaultAttrs:{label:"50%"},addDirection:()=>"right",keywords:["stats","bar","progress","number","percentage"],htmlTag:"percentages"},tA=(0,u.memo)(e=>{let{children:t,options:l,containerSize:o,numCells:i}=e,{columns:r,lastRowAligner:s}=W({containerSize:o,options:l,numCells:i,mobileMaxColumns:1,forceBalance:!1});return(0,a.jsxs)(n.r,{columns:6*r,rowGap:"3em",columnGap:"1.5em","data-selection-ring":"padded",pos:"relative",borderRadius:"var(--box-border-radius)",children:[t,s]})});tA.displayName="PlainStatsWrapper";let tC={xs:2,sm:2.65,md:3.3,lg:3.95,xl:4.6,full:5.25},tz=(0,u.memo)(e=>{let{children:t,layoutOptions:l,cellOptions:n,label:s,isContentEmpty:d,isLayoutFocused:u,updateAttributes:p,index:h,dragHandle:b}=e,{headingColorCss:y,colorVars:v}=I(l,n,h,!0),k=l.horizontalAlign,x=(0,g.yp)(k),S=tC[l.shapeSize||"md"],A={...x,...v},C=(0,f.FX)();return(0,a.jsxs)(o.s,{borderRadius:"var(--box-border-radius)",direction:"column",align:"center",justify:"start","data-selection-ring":"padded","data-content-reference":!0,pos:"relative",gap:d&&!u?0:"0.75em",sx:A,className:m.VN,gridColumn:"span ".concat(6),children:[(0,a.jsx)(o.s,{direction:"column",align:"center",justify:"center",width:"100%",pos:"relative",contentEditable:!1,py:"0.5em",css:y,fontSize:C?"0.75em":"1em",children:(0,a.jsx)(w,{value:s||"",updateAttributes:p,className:(0,r.cx)(c.U6),fontSize:"".concat(S,"em"),lineHeight:1,display:"flex",alignItems:"center",sx:(0,g.yp)(k||"center"),style:{width:"100%"},placeholder:"—"})}),(0,a.jsx)(i.az,{w:"100%","data-content-empty":d,children:t}),b]})});tz.displayName="PlainStatsCell";let tI={key:"stats",name:()=>d.Ru._({id:"29Hx9U"}),commandName:()=>d.Ru._({id:"v2fVzA"}),icon:s.Bi7,options:[L,{...eY,name:()=>d.Ru._({id:"IfKwpr"}),icon:s.ACh},G,{...K,defaultValue:(0,g.Ro)("center")}],cellOptions:[G,q],Wrapper:tA,Cell:tz,defaultAttrs:{label:"50%"},addDirection:()=>"right",keywords:["stats"],htmlTag:"numbers"},tj="1.5em",tF=(e,t,l)=>{let a=(0,f.FX)(),{columns:n}=W({containerSize:l,numCells:t,options:e,forceBalance:!0});return"vertical"===e.orientation||a||t>1&&1===n?{columns:1,isHorizontal:!1}:{columns:n,isHorizontal:!0}},tB=(0,u.memo)(e=>{let{options:t,numCells:l,containerSize:o,children:i}=e,{isHorizontal:r,columns:s}=tF(t,l,o),d=r?{columns:s,rowGap:tj,columnGap:tj}:{columns:1};return(0,a.jsx)(n.r,{"data-selection-ring":!0,...d,pos:"relative",children:i})});tB.displayName="StepsWrapper";let tR=(0,u.memo)(e=>{let{layoutOptions:t,children:l,numCells:n,layoutContainerSize:r,dragHandle:s,cellOptions:d,index:u}=e,{columns:c,isHorizontal:f}=tF(t,n,r),p=t.horizontalAlign,h=(0,g.yp)(p||"left"),{colorVars:b}=I(t,d,e.index,!0),y=u%c+1,v=f?0:"".concat(function(e){let t=e%6;return t<=3?1.5*t:4.5-(t-3)*1.5}(u),"em");return(0,a.jsxs)(o.s,{direction:f?"column":"row","data-selection-ring":!0,"data-content-reference":!0,pos:"relative",gap:tj,pt:"".concat((c-y)*1.5,"em"),pb:f?0:x.x,paddingInlineStart:v,children:[(0,a.jsx)(t_,{...e,isHorizontal:f}),(0,a.jsx)(i.az,{flex:"1",sx:{...h,...b},className:m.VN,children:l}),s]})});tR.displayName="StepsCell";let t_=(0,u.memo)(e=>{let{layoutOptions:t,cellOptions:l,index:n,isHorizontal:i}=e,{colorVars:r}=I(t,l,n);return(0,a.jsx)(o.s,{contentEditable:!1,align:"center",justify:"center",position:"relative",sx:{...r,...(0,g.yp)("center")},...i?{width:"100%",height:"".concat(1,"em")}:{minWidth:"".concat(.75,"em"),width:"".concat(.75,"em"),height:"100%"},className:m.SA})}),tM={key:"steps",name:()=>d.Ru._({id:"A9onc2"}),commandName:()=>d.Ru._({id:"uAtxjM"}),icon:s.o97,options:[{...J,defaultValue:()=>"horizontal"},G,{...K,defaultValue:(0,g.Ro)("left")},{...L,checkEnabled:e=>"vertical"!==e.options.orientation}],cellOptions:[G,q],Wrapper:tB,Cell:tR,addDirection:()=>"right",htmlTag:"steps",keywords:["steps","sequence","ordered"],defaultOptions:{cellSize:D().sm.width}},tE=(0,u.memo)(e=>{let{children:t}=e;return(0,a.jsx)(o.s,{gap:"1em",wrap:"wrap","data-selection-ring":!0,pos:"relative",children:t})});tE.displayName="TextBoxesWrapper";let tT=(0,u.memo)(e=>{let{children:t,layoutOptions:l,cellOptions:n,numCells:o,layoutContainerSize:r,dragHandle:s,index:d}=e,{columns:u}=W({options:l,numCells:o,containerSize:r}),{colorVars:c}=I(l,n,d),f=l.horizontalAlign,p=(0,g.yp)(f),h={...c,...p};return(0,a.jsxs)(i.az,{flex:"1 1 auto",w:"calc(".concat(100/u,"% - ").concat("1em",")"),boxSizing:"border-box",p:x.x,"data-content-reference":!0,"data-selection-ring":!0,pos:"relative",sx:h,className:m.SA,children:[t,s]})});tT.displayName="TextBoxCell";let tO={key:"textBoxes",name:()=>d.Ru._({id:"b7qbjN"}),commandName:()=>d.Ru._({id:"xAk5nC"}),icon:s.n2$,options:[L,G,K],cellOptions:[G,q],Wrapper:tE,Cell:tT,addDirection:()=>"right",htmlTag:"boxes",keywords:["textbox","layout"]};var tP=l(7908),tN=l(78354);let tD={base:!1,md:!0},tL={base:!1,md:!0},tW=e=>{let t=(0,tN.h5)(tD)||!1,l=(0,tN.h5)(tL)||!1,a="horizontal"===e.orientation&&l,n=e.twoSided&&(a||t);return{isHorizontal:a,isTwoSided:n}},tU=e=>e?1.5:.5,tG=(0,u.memo)(e=>{let{children:t,options:l}=e,{isHorizontal:n,isTwoSided:o}=tW(l),r=tU(l.numbered),s=n?(0,a.jsx)(i.az,{gridRow:2,gridColumn:1,"data-spotlight-dim":!0,contentEditable:!1,children:(0,a.jsx)(i.az,{position:"absolute",height:"var(--line-thickness)",width:"100%",insetStart:"0",insetEnd:"0",className:m.eI})}):(0,a.jsx)(et.o,{gridColumn:2,gridRow:1,"data-spotlight-dim":!0,contentEditable:!1,children:(0,a.jsx)(i.az,{position:"absolute",width:"var(--line-thickness)",top:"0",bottom:"0",className:m.eI})});return(0,a.jsxs)(ec.x,{...n?{templateRows:"auto 0px auto",autoColumns:"1fr",justifyContent:"center",columnGap:"1em",mt:o?void 0:"".concat(r,"em")}:{templateColumns:o?"1fr 0px 1fr":"0px 0px 1fr",autoRows:"auto",justifyContent:"center",rowGap:"1em",ms:o?void 0:"".concat(r,"em")},"data-selection-ring":!0,pos:"relative",children:[s,t,o&&(0,a.jsx)(i.az,{...n?{gridColumn:"1 / span 1",gridRow:3,minW:"0.5fr"}:{gridColumn:3,gridRow:"1 / span 1",minH:"".concat(4,"em")},contentEditable:!1})]})});tG.displayName="TimelineWrapper";let tH=(0,u.memo)(e=>{let{children:t,layoutOptions:l,index:n,dragHandle:r,cellOptions:s,direction:d}=e,u=n+1,{isHorizontal:c,isTwoSided:p}=tW(l),h=p&&u%2==1,b=l.hasLine?"inside":"none",y=tU(l.numbered),{colorVars:v}=I(l,s,n,!0),k=(0,f.FX)(),w="".concat(("inside"===b?k?1.75:3.5:0)+(c?"none"===b?y+1:1:2),"em"),x={right:"rtl"===d?"left":"right",left:"rtl"===d?"right":"left"},S=c?{minW:"min(100%, ".concat(8,"em)"),...(0,g.yp)("center"),...v}:{minH:p?"".concat(8,"em"):void 0,...(0,g.yp)(h?x.right:x.left),...(0,g.AS)(h?x.right:x.left,d),py:"".concat(1,"em"),...v};return(0,a.jsxs)(o.s,{minW:"0",position:"relative",transitionProperty:"border, padding, right, margin","data-selection-ring":!0,"data-content-reference":!0,...c?{gridColumn:"span 2",gridRow:h?1:3,align:h?"flex-end":"flex-start",justify:"center",transformOrigin:h?"center bottom":"center top",pt:h?void 0:w,pb:h?w:void 0,px:"".concat(1,"em")}:{gridRow:"span 2",gridColumn:h?1:3,align:"flex-start",transformOrigin:h?"right center":"left center",ps:h?void 0:w,pe:h?w:void 0},"data-test-timeline-item":n,children:[(0,a.jsx)(tV,{...e}),(0,a.jsxs)(i.az,{sx:S,className:m.VN,flex:"1",maxW:"100%",children:[t,r]})]})});tH.displayName="TimelineCell";let tV=(0,u.memo)(e=>{let{direction:t,index:l,layoutOptions:n}=e,{isHorizontal:o,isTwoSided:r}=tW(n),s=r&&l%2==0,d=n.hasLine?"inside":"none",[u,c]=(0,tP.yz)(t),p=o?s?{bottom:0,transform:"translateY(50%)"}:{top:0,transform:"translateY(-50%)"}:s?{[c]:0,transform:"translateX(".concat("rtl"===t?"-50":"50","%)")}:{[u]:0,transform:"translateX(".concat("rtl"===t?"50":"-50","%)")},g=(0,f.FX)(),h="none"===d?0:"inside"===d?"".concat(g?1.75:3.5,"em"):"100%",b=o?{height:h,width:"var(--line-thickness)",[u]:"50%",top:s?void 0:"50%",bottom:s?"50%":void 0,transform:"translateX(".concat("rtl"===t?"50":"-50","%)")}:{width:h,height:"var(--line-thickness)",top:"50%",transform:"translateY(-50%)",[u]:s?void 0:"calc(100% - var(--line-thickness))",[c]:s?"calc(100% - var(--line-thickness))":void 0};return(0,a.jsx)(ei,{...e,alignText:!o,positionProps:{...p,position:"absolute"},children:"none"!==d&&(0,a.jsx)(i.az,{position:"absolute",zIndex:"-1","data-testid":"timeline-line",...b,className:m.eI})})});tV.displayName="TimelineCellMarker";let tq={key:"timeline",name:()=>d.Ru._({id:"cklVjM"}),commandName:()=>d.Ru._({id:"jJ1FpU"}),baseHorizontalAlign:(0,g.Ro)("center"),icon:s.o7M,options:[J,{key:"twoSided",defaultValue:()=>!0,Control:e=>{let{value:t,updateValue:l,option:n}=e;return(0,a.jsx)(V.I,{label:n.name(),onClick:()=>l(!t),isActive:t,icon:s.v6v,testId:"smart-layout-two-sided-option"})},name:()=>d.Ru._({id:"ovs7iP"})},er,{key:"hasLine",defaultValue:()=>!0,Control:e=>{let{value:t,updateValue:l,option:n}=e;return(0,a.jsx)(V.I,{label:n.name(),onClick:()=>l(!t),isActive:t,icon:s.CCK})},name:()=>d.Ru._({id:"aPb1AT"})},G],cellOptions:[G,q],Wrapper:tG,Cell:tH,addDirection:e=>"horizontal"===e.orientation?"right":"bottom",isFullWidth:e=>"horizontal"===e.orientation,htmlTag:"timeline",keywords:["timeline","layout","list","horizontal","vertical"]},tK=()=>[eu,tO,e2,e6,tq,ee,tI,tv,tS,ts,tu,tp,tM,eN,eD,eP,eL,eV],tJ=()=>tK().reduce((e,t)=>(e[t.key]=t,e),{}),t$=e=>e&&tJ()[e]||eu},1906:(e,t,l)=>{"use strict";l.d(t,{dD:()=>o,x9:()=>d});var a=l(17228),n=l.n(a);let o=e=>{let{label:t}=e,l=d(t);return l?n()(l/100,0,1):0},i=/[0-9,.]+/g,r=/[,.](?=\d{3})/g,s=/([0-9]+)\s?\/\s?([0-9]+)/g,d=e=>{if(e){if("number"==typeof e)return e;try{var t,l;let a=null===(t=e.match(s))||void 0===t?void 0:t[0];if(a){let[e,t]=a.split("/").map(e=>e.trim());return 100*parseFloat(e)/parseFloat(t)}let n=null===(l=e.match(i))||void 0===l?void 0:l[0],o=null==n?void 0:n.replaceAll(r,"");return o?parseFloat(o):void 0}catch(t){console.error("[SmartLayout] Failed to parse label number: ".concat(e),t);return}}}},85700:(e,t,l)=>{"use strict";l.d(t,{n:()=>a});let a=l(51151).Ay.extend({parseHTML:()=>[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration=line-through",consuming:!1},{style:"text-decoration-line=line-through",consuming:!1}],addKeyboardShortcuts(){return{"Mod-Shift-x":()=>this.editor.commands.toggleStrike()}}})},38234:(e,t,l)=>{"use strict";l.d(t,{e$:()=>g,Rj:()=>p});var a=l(81570),n=l(73686),o=l(13236);let i=new a.hs("suggestion"),r={from:0,to:0};var s=l(95986),d=l(17228),u=l.n(d),c=l(14041),m=l(29097),f=l(80915);let p=e=>{let{ref:t,selectItem:l,options:a}=e,[n,o]=(0,c.useState)(0),i=(0,c.useRef)(null),r=(0,c.useRef)({selectedIndex:n,options:a,selectItem:l});return r.current={selectedIndex:n,options:a,selectItem:l},(0,c.useImperativeHandle)(t,()=>{let e=e=>{let{key:t}=e,l=r.current;return"ArrowUp"===t?(e.preventDefault(),l.selectedIndex<=0?o(a.length-1):o(u()(l.selectedIndex-1,0,l.options.length-1))):"ArrowDown"===t?(e.preventDefault(),l.selectedIndex>=l.options.length-1?o(0):o(u()(l.selectedIndex+1,0,l.options.length-1))):("Enter"===t||"Tab"===t)&&(e.preventDefault(),l.options.length>0&&l.selectItem(n)),e.stopPropagation(),e.preventDefault(),!0};return{onKeyDown:t=>{let{event:l}=t;return!!["ArrowUp","ArrowDown","Enter","Tab"].includes(l.key)&&e(l)}}}),(0,c.useEffect)(()=>{if(i.current){var e;null==i||null===(e=i.current)||void 0===e||e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})}},[n]),{selectedIndex:n,selectedItemEl:i}},g=e=>{let{char:t,MenuComponent:l,pluginKey:d,command:u,allowSpaces:c=!1,...p}=e;return o.YY.create({...p,addOptions:()=>({HTMLAttributes:{},suggestion:{char:t,pluginKey:d,allowSpaces:c,startOfLine:!1,command:u,render:()=>{let e=null,t=null;return{onStart:a=>{if(t&&e){e.updateProps(a),t.setProps({getReferenceClientRect:a.clientRect}),t.show();return}e=new f.N(l,{props:a,editor:a.editor});let n=a.editor.view.dom.parentElement;t=(0,m.Ay)(n,{getReferenceClientRect:a.clientRect,appendTo:()=>document.body,content:e.element,showOnCreate:!0,interactive:!0,trigger:"manual",placement:"bottom-start",zIndex:s.t1.zIndices.dropdown,popperOptions:{modifiers:[{name:"preventOverflow",options:{padding:{bottom:8}}},{name:"flip",options:{fallbackPlacements:["auto-start"]}}]}})},onUpdate(l){null==e||e.updateProps(l),null==t||t.setProps({getReferenceClientRect:l.clientRect})},onKeyDown(l){var a;return"Escape"===l.event.key?(null==t||t.destroy(),null==e||e.destroy(),t=null,e=null,!0):null==e?void 0:null===(a=e.ref)||void 0===a?void 0:a.onKeyDown(l)},onExit(l){!0!==d.getState(l.editor.view.state).active&&(null==t||t.destroy(),null==e||e.destroy(),t=null,e=null)}}}}}),addProseMirrorPlugins(){return[function(e){let t,{pluginKey:l=i,editor:s,char:d="@",allowSpaces:u=!1,prefixSpace:c=!0,startOfLine:m=!1,decorationTag:f="span",decorationClass:p="suggestion",command:g=()=>null,items:h=()=>[],render:b=()=>({}),allow:y=()=>!0}=e,v=null==b?void 0:b(),k=e=>{e.dispatch(e.state.tr.setMeta(l,{active:!1,decorationId:"",key:null,range:r,query:null,text:null,composing:!1}))};return new a.k_({key:l,view(){return{update:async(e,l)=>{var a,n,o,i,r;let d=null===(a=this.key)||void 0===a?void 0:a.getState(l),u=null===(n=this.key)||void 0===n?void 0:n.getState(e.state),c=d.active&&u.active&&d.range.from!==u.range.from,m=!d.active&&u.active,f=d.active&&!u.active,p=!m&&!f&&d.query!==u.query,b=m||c,y=p&&!c,k=f||c;if(!b&&!y&&!k)return;let w=k&&!b?d:u,x=document.querySelector('[data-decoration-id="'.concat(w.decorationId,'"]'));t={editor:s,range:w.range,query:w.query,text:w.text,items:y||b?await h({editor:s,query:w.query}):[],command:e=>{g({editor:s,range:w.range,props:e})},decorationNode:x,clientRect:x?()=>{var e;let{decorationId:t}=null===(e=this.key)||void 0===e?void 0:e.getState(s.state);return document.querySelector('[data-decoration-id="'.concat(t,'"]')).getBoundingClientRect()}:null},k&&(null==v||null===(o=v.onExit)||void 0===o||o.call(v,t)),y&&(null==v||null===(i=v.onUpdate)||void 0===i||i.call(v,t)),b&&(null==v||null===(r=v.onStart)||void 0===r||r.call(v,t))},destroy:()=>{var e;t&&(null==v||null===(e=v.onExit)||void 0===e||e.call(v,t))}}},state:{init:()=>({active:!1,decorationId:"",range:r,key:null,query:null,text:null,composing:!1}),apply(e,t,a,n){let i;i=e.getMeta(l)?{...e.getMeta(l)}:{...t};let{isEditable:f}=s,{composing:p}=s.view,{selection:g}=e,{empty:h,from:b}=g;if(i.composing=p,!i.active&&i.key!==d)return i;if(i.active&&i.key===d)return i.key=null,i;if(f&&(h||s.view.composing)){t.range&&(bt.range.to)&&!p&&!t.composing&&(i.active=!1);let e=function(e){var t;let{char:l,allowSpaces:a,prefixSpace:n,startOfLine:i,$position:r}=e,s=(0,o.GG)(l),d=new RegExp("\\s".concat(s,"$")),u=i?"^":"",c=a?RegExp("".concat(u).concat(s,".*?(?=\\s").concat(s,"|$)"),"gm"):RegExp("".concat(u,"(?:^)?").concat(s,"[^\\s").concat(s,"]*"),"gm"),m=null===(t=r.nodeBefore)||void 0===t?void 0:t.text;if(!m)return null;let f=r.pos-m.length,p=Array.from(m.matchAll(c)).pop();if(!p||void 0===p.input||void 0===p.index)return null;let g=p.input.slice(Math.max(0,p.index-1),p.index),h=/^[\s\0]?$/.test(g);if(n&&!h)return null;let b=f+p.index,y=b+p[0].length;return(a&&d.test(m.slice(y-1,y+1))&&(p[0]+=" ",y+=1),b=r.pos)?{range:{from:b,to:y},query:p[0].slice(l.length),text:p[0]}:null}({char:d,allowSpaces:u,prefixSpace:c,startOfLine:m,$position:g.$from}),l="id_".concat(Math.floor(0xffffffff*Math.random()));e&&y({editor:s,state:n,range:e.range})?(i.active=!0,i.decorationId=t.decorationId?t.decorationId:l,i.range=e.range,i.query=e.query,i.text=e.text):i.active=!1}else i.active=!1;return i.active||(i.decorationId=null,i.range=r,i.query=null,i.text=null),i}},props:{handleKeyDown(e,t){var a;let n=e.state.tr,o=this.getState(e.state);if(!o)return!1;let{active:i,range:r}=o;if(!r)return!1;if(i||t.key!==d||t.metaKey){if(!i)return!1;"Escape"===t.key&&k(e)}else{let a={...o};a.active=!0,a.key=t.key,a.query="",e.dispatch(n.setMeta(l,a))}return(null==v?void 0:null===(a=v.onKeyDown)||void 0===a?void 0:a.call(v,{view:e,event:t,range:r}))||!1},decorations(e){let t=this.getState(e);if(!t)return null;let{active:l,range:a,decorationId:o}=t;return l&&a?n.zF.create(e.doc,[n.NZ.inline(a.from,a.to,{nodeName:f,class:p,"data-decoration-id":o||""})]):null}}})}({editor:this.editor,...this.options.suggestion})]}})}},63955:(e,t,l)=>{"use strict";l.d(t,{hY:()=>i,hr:()=>a,wd:()=>o});let a={light:{gray:{hex:"#D6D6D6",name:"Gray"},red:{hex:"#FFBDBD",name:"Red"},orange:{hex:"#F8CB96",name:"Orange"},yellow:{hex:"#FBEB8F",name:"Yellow"},green:{hex:"#C9FDCB",name:"Green"},blue:{hex:"#D1E5FD",name:"Blue"},purple:{hex:"#D5CCFB",name:"Purple"},primary:{hex:"#FFD300"},secondary:{hex:"#FF7979"},tertiary:{hex:"#A9FF8B"}},dark:{gray:{hex:"#999999",name:"Gray"},red:{hex:"#EB5252",name:"Red"},orange:{hex:"#DD8404",name:"Orange"},yellow:{hex:"#CAAD07",name:"Yellow"},green:{hex:"#50BD3D",name:"Green"},blue:{hex:"#85BAFA",name:"Blue"},purple:{hex:"#B1A0F8",name:"Purple"},primary:{hex:"#856E01"},secondary:{hex:"#952222"},tertiary:{hex:"#257D04"}}},n=e=>Object.entries(a[e]).reduce((e,t)=>{let[l,a]=t,n={backgroundColor:a.hex};return e['&[variant="'.concat(l,'"]')]=n,e},{backgroundColor:"var(--highlight-color)"}),o={borderRadius:"0.125em",px:".05em",mx:"-.05em",boxDecorationBreak:"clone"},i={default:{"mark.highlight":{color:"black","--link-color":"black",...n("light"),...o}},dark:{"mark.highlight":{color:"black",...n("dark")}}}},32565:(e,t,l)=>{"use strict";l.d(t,{f:()=>s,r:()=>u});var a=l(18613),n=l(13236),o=l(42391),i=l(43873),r=l(75185);let s=a.Ay.extend({name:"highlight",priority:i.y.Highlight,excludes:"textColor highlight",addAttributes:()=>({variant:{},hex:{}}),addCommands(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),setHighlightColor:e=>t=>{let{commands:l}=t;return l.setMark(this.name,{hex:e,variant:null})},setHighlightVariant:e=>t=>{let{commands:l}=t;return l.setMark(this.name,{variant:e,hex:null})}}},parseHTML:()=>[{tag:"mark[class=highlight]"},{tag:"*[highlight]",getAttrs(e){let t=e.getAttribute("highlight");return!!t&&(r.M.includes(t)?{variant:t}:{hex:t})},consuming:!1,priority:60}],renderHTML(e){let{HTMLAttributes:t,mark:l}=e,a=l.attrs.hex&&(0,o.$p)(l.attrs.hex),i="var(".concat(a?"--highlight-color-dark":"--highlight-color-light",")"),r=["--highlight-color: ".concat(l.attrs.hex),"color: ".concat(i),"--link-color: ".concat(i),"--link-color-hover:".concat("var(".concat(a?"--highlight-link-color-hover-dark":"--highlight-link-color-hover-light",")"))].join("; ");return["mark",(0,n.KV)(this.options.HTMLAttributes,t,{class:"highlight",style:r})]},renderHTMLforAI(e){var t;let{mark:l}=e;return["span",{color:null!==(t=l.attrs.hex)&&void 0!==t?t:l.attrs.variant}]}}).configure({multicolor:!0});var d=l(48292);let u=n.CU.create({name:"textColor",excludes:"highlight textColor",priority:i.y.TextColor,addAttributes:()=>({variant:{},hex:{}}),addCommands(){return{setTextColorVariant:e=>t=>{let{commands:l}=t;return l.setMark(this.name,{hex:null,variant:e})},setTextColor:e=>t=>{let{commands:l}=t;return l.setMark(this.name,{hex:e,variant:null})}}},parseHTML:()=>[{tag:"span[class=textColor]"},{tag:"*[color]",getAttrs(e){if(["ASIDE","DIV",...Object.values((0,d.a)()).map(e=>{var t;return null===(t=e.htmlTag)||void 0===t?void 0:t.toUpperCase()}).filter(Boolean)].includes(e.tagName))return!1;let t=e.getAttribute("color");return!!t&&(r.M.includes(t)?{variant:t}:{hex:t})},consuming:!1,priority:60}],renderHTML(e){let{HTMLAttributes:t,mark:l}=e;return["span",(0,n.KV)(t,{class:"textColor",style:l.attrs.hex?"--text-color: ".concat(l.attrs.hex):void 0})]},renderHTMLforAI(e){var t;let{mark:l}=e;return["span",{color:null!==(t=l.attrs.hex)&&void 0!==t?t:l.attrs.variant}]}})},75185:(e,t,l)=>{"use strict";l.d(t,{Hm:()=>s,M:()=>n,qd:()=>a});let a={light:{gray:{hex:"#7A7A7A",name:"Gray"},red:{hex:"#EB0000",name:"Red"},orange:{hex:"#BD6F00",name:"Orange"},yellow:{hex:"#B29500",name:"Yellow"},green:{hex:"#008545",name:"Green"},blue:{hex:"#006ED6",name:"Blue"},purple:{hex:"#7B57FF",name:"Purple"}},dark:{gray:{hex:"#AFAFAF",name:"Gray"},red:{hex:"#EF8784",name:"Red"},orange:{hex:"#F5C274",name:"Orange"},yellow:{hex:"#F5F380",name:"Yellow"},green:{hex:"#8CE29F",name:"Green"},blue:{hex:"#8DD4FB",name:"Blue"},purple:{hex:"#A08CF8",name:"Purple"}}},n=Object.keys(a.light),o=(e,t,l)=>Object.entries(a[e]).reduce((e,a)=>{let[n,o]=a,i={[l||"--text-color"]:o.hex};return e[t?t(n):'&[variant="'.concat(n,'"]')]=i,e},{}),i="var(--text-color, var(--body-color))",r="var(--list-marker-text-color, var(--body-color))",s={default:{"span.textColor":{...o("light"),color:i},".block-numbered":{...o("light",e=>'&[data-text-color="'.concat(e,'"] li::before'),"--list-marker-text-color"),"li::before":{color:r}},".block-bullet":{...o("light",e=>'&[data-text-color="'.concat(e,'"] li::marker'),"--list-marker-text-color"),"li::marker":{color:r}}},dark:{"span.textColor":{...o("dark"),color:i},".block-numbered":{...o("dark",e=>'&[data-text-color="'.concat(e,'"] li::before'),"--list-marker-text-color"),"li::before":{color:r}},".block-bullet":{...o("dark",e=>'&[data-text-color="'.concat(e,'"] li::marker'),"--list-marker-text-color"),"li::marker":{color:r}}}}},44275:(e,t,l)=>{"use strict";l.d(t,{D:()=>s,n:()=>r});var a=l(99742),n=l(81570),o=l(387),i=l(86671);let r=()=>(0,a.Ak)(5),s=i.S.extend({name:"UniqueToggleId"}).configure({attributeName:"id",types:["toggle"],initialValue:r,filterTransaction:o.kz,pluginKey:new n.hs("UniqueToggleId")})},46896:(e,t,l)=>{"use strict";l.d(t,{Rv:()=>s,bG:()=>i,p8:()=>r,vb:()=>o});var a=l(88957),n=l(61690);let o=e=>{let t=(0,a.KA)();return(0,n.q)(e)(t.getState())||!1},i=(e,t)=>{(0,a.KA)().dispatch((0,n.z1)({toggleIds:[e],isExpanded:t}))},r=e=>"toggle"===e.type.name,s=e=>"toggleSummary"===e.type.name},39002:(e,t,l)=>{"use strict";l.d(t,{n:()=>i});var a=l(13236),n=l(48360),o=l.n(n);let i=a.YY.create({name:"updateAttributesAtPos",addCommands:()=>({updateAttributesAtPos:(e,t)=>l=>{let{tr:a}=l;return Object.entries(t).forEach(t=>{let[l,n]=t;a.setNodeAttribute(e,l,n)}),!0},updateNestedAttributesAtPos:(e,t)=>l=>{let{tr:a}=l,n=a.doc.nodeAt(e);return!!n&&(Object.entries(t).forEach(t=>{let[l,i]=t,r=o()(i)?{...n.attrs[l],...i}:i;a.setNodeAttribute(e,l,r)}),!0)}})})},4468:(e,t,l)=>{"use strict";l.d(t,{lF:()=>n,L3:()=>a,pl:()=>o,JL:()=>i}),l(64130),l(95580),l(44507),l(17119),l(82354),l(77646),l(7259),l(77583),new(l(81570)).hs("BlockHoverKey");let a=e=>{var t;return(null===(t=e.find(e=>e.spec.isTableHover))||void 0===t?void 0:t.spec)||{}},n=e=>{var t;return(null===(t=e.find(e=>e.spec.isTableFocus))||void 0===t?void 0:t.spec)||{}},o=e=>e.some(e=>e.spec.isAnnotatableHover),i=e=>e.some(e=>e.spec.isBlockHover)},25472:(e,t,l)=>{"use strict";l.d(t,{D:()=>a}),l(77646);let a=e=>{var t;return(null===(t=e.find(e=>e.spec.isBlockWidthDecoration))||void 0===t?void 0:t.spec)||{}}},75451:(e,t,l)=>{"use strict";l.d(t,{k:()=>p});var a=l(31085),n=l(25420),o=l(9021),i=l(20501),r=l(24221),s=l(95986),d=l(52177),u=l(12327),c=l(14041),m=l(88957),f=l(61690);let p=e=>{let{editor:t,getPos:l,node:p,direction:g,maxButtons:h,tooltip:b}=e,y=(0,m.GV)(f.Cl),v=!h||p.childCount{t.commands.addButtonToGroup(l())},[t,l]);return v&&y?(0,a.jsx)(n.s,{position:"relative",align:"center",children:(0,a.jsx)(s.Tz,{label:b||(0,a.jsx)(d.x6,{id:"xe7fzh"}),placement:"top",children:(0,a.jsx)(o.K,{icon:(0,a.jsx)(r.g,{icon:i.QLR}),"aria-label":u.Ru._({id:"6oU9VZ"}),size:"xs",variant:"plain",isRound:!0,onClick:k,opacity:0,className:"add-button",transitionProperty:"opacity",transitionDuration:"normal",position:"absolute",left:"column"===g?"50%":0,top:"50%",transform:"column"===g?"translateX(-50%)":"translateY(-50%)",zIndex:"sticky"})})}):null}},20169:(e,t,l)=>{"use strict";l.d(t,{$:()=>I});var a=l(13236),n=l(68566),o=l(45709),i=l(58599),r=l(95580),s=l(29362),d=l(31085),u=l(80853),c=l(80532),m=l(3706),f=l(61778),p=l(81313),g=l(14041),h=l(4876),b=l(88957),y=l(747),v=l(41900),k=l(67442),w=l(61690),x=l(74336),S=l(12408),A=l(25893);let C=e=>{let{editor:t,node:l,decorations:a}=e,{href:n,variant:o,color:r}=l.attrs,s=(0,b.GV)(w.Cl),C=(0,S.Ms)(a),z=s&&C,I=(0,x.v)(a),{linkUrl:j,handleClick:F,isCurrentPage:B}=(0,y.c)({url:n}),{interceptLinkClick:R,linkUrlSafe:_,isUntrusted:M,linkInterceptEnabled:E}=(0,h.i)(j),T=E&&!0!==t.isSiteNavbarEditor,{textColor:O}=(0,k.S0)(r),P="solid"===o?{backgroundColor:r||"var(--button-color)",backgroundImage:r?void 0:"var(--button-gradient)",borderRadius:"var(--button-border-radius, var(--box-border-radius))"}:"outline"===o?{border:"0px",boxShadow:"inset 0 0 0 max(1px, var(--shape-border-width)) ".concat(r||"var(--button-color)"),backgroundColor:"var(--shape-bg-color-override, var(--card-color))",borderRadius:"var(--button-border-radius, var(--box-border-radius))"}:void 0,N=(0,g.useMemo)(()=>({...(0,A.s)({variant:o})}),[o]);return(0,d.jsx)(i.VR,{children:(0,d.jsx)(u.$,{as:z?c.az:m.N,isDisabled:!!T&&M,cursor:s?"text":"pointer",userSelect:s?"auto":"none",href:T?_||void 0:j,onClick:T?R:F,...N,style:P,className:(0,p.cx)("button","solid"===o&&v.Dv),"data-export-as-image":!0,"data-export-link":n,sx:{"@media print":{width:"auto"},outline:C?"2px solid var(--chakra-ring-color) !important":void 0,lineHeight:"var(--line-height-body)"},"data-is-current-page":B,children:(0,d.jsxs)(f.E,{as:"div",noOfLines:z||I?void 0:1,wordBreak:"break-all",style:{color:"solid"===o?O||"var(--button-color-inverted)":"outline"===o?r||"var(--button-color)":void 0},textAlign:"center",children:[I&&(0,d.jsx)(f.E,{opacity:"0.3",pointerEvents:"none",contentEditable:!1,pos:"absolute",w:"100%",left:"0",textAlign:"center",children:"…"}),(0,d.jsx)(i.$p,{})]})})})};var z=l(23231);let I=a.bP.create({name:"button",content:"(text | emoji)*",marks:"",defining:!0,isolating:!0,selectable:!1,addNodeView:()=>(0,i.gu)(C,{update:s.z0}),addAttributes:()=>({href:{default:""},variant:{default:"solid"},color:{default:null}}),addCommands:()=>({addButtonToGroup:e=>t=>{let{state:l,chain:a}=t,n=l.doc.nodeAt(e);if(!n)return!1;let i=e+n.nodeSize-1;return a().insertContentAt(i,{...(0,o.G)().button,attrs:{variant:z.Dn[n.type.name].defaultVariant,href:""}}).selectInsertedNode().run(),!0},handleButtonDelete:e=>t=>{let{dispatch:l,state:o,chain:i}=t;if(!l)return!0;let s=(0,a.KP)(e=>"button"===e.type.name)(o.selection);if(!s||e&&!(0,r.Op)(s.node))return!1;let d=(0,a.KP)(e=>"buttonGroup"===e.type.name)(o.selection),u=(0,a.KP)(e=>"navbarButtons"===e.type.name)(o.selection),c=(0,a.KP)(e=>"navbarLinks"===e.type.name)(o.selection);return u||c||!d||1!==d.node.childCount?u&&1===u.node.childCount||c&&1===c.node.childCount?i().deleteNode("button").blur().run():i().deleteNode("button").command(e=>{let{tr:t}=e,l=(0,n.n)(t.doc.resolve(s.pos-1),-1);return l&&t.setSelection(l),!0}).focus().run():i().deleteNode("buttonGroup").command(e=>{let{tr:t}=e,l=(0,n.n)(t.doc.resolve(d.pos));return l&&t.setSelection(l),!0}).focus().run(),!0}}),parseHTML:()=>[{tag:"button"}],renderHTML(e){let{HTMLAttributes:t}=e;return["button",(0,a.KV)(t),0]}})},31060:(e,t,l)=>{"use strict";l.d(t,{J:()=>m,r:()=>c});var a=l(31085),n=l(25420),o=l(2696),i=l(58599),r=l(57284),s=l(95905),d=l(75451),u=l(23231);let c=e=>{let{decorations:t,node:l}=e,{horizontalAlign:c}=l.attrs,f=(0,o.FX)(),p=f?"column":"row";return(0,a.jsx)(r.u,{...e,children:(0,a.jsxs)(n.s,{dir:(0,s.fZ)(t,c),w:"100%","data-selection-ring":"padded",borderRadius:"var(--box-border-radius)",direction:p,justify:(0,s.lI)(c)||"var(--flex-align)",sx:m(f),gap:"0.5em",alignItems:"center",children:[(0,a.jsx)(i.$p,{}),(0,a.jsx)(d.k,{...e,direction:p,maxButtons:u.r4})]})})},m=e=>({"> [data-node-view-content]":{display:"contents","> [data-node-view-content-inner]":{display:"contents"}},"--button-width":e?"100%":"auto",".node-button":{width:"var(--button-width)",".button":{width:"100%"}},_hover:{".add-button":{opacity:1}}})},23231:(e,t,l)=>{"use strict";l.d(t,{Dn:()=>s,r4:()=>i,vf:()=>r});var a=l(20501),n=l(3040),o=l(12327);let i=3,r=()=>[{name:o.Ru._({id:"bjuYAW"}),key:"solid",icon:n.Cpz},{name:o.Ru._({id:"bCuf07"}),key:"outline",icon:a.Cpz},{name:o.Ru._({id:"1lWK8g"}),key:"link",icon:a.CQO}],s={buttonGroup:{alignEnabled:!0,colorEnabled:!0,linkDropdownEnabled:!0,variants:["solid","outline"],defaultVariant:"solid"},navbarButtons:{alignEnabled:!1,colorEnabled:!0,linkDropdownEnabled:!1,variants:["solid","outline"],defaultVariant:"solid"},navbarLinks:{alignEnabled:!0,colorEnabled:!1,linkDropdownEnabled:!1,variants:["link"],defaultVariant:"link"}}},25893:(e,t,l)=>{"use strict";l.d(t,{s:()=>a});let a=e=>{let{variant:t}=e;return{variant:"unstyled",display:"inline-flex",position:"relative",_hover:{textDecoration:"none"},minW:"min(100%, 12em)",maxW:"100%",fontSize:"1em",py:"0.5em",minH:"2.75em",w:"var(--button-width)",h:"auto",px:"link"===t?"0.5em":"1em",transitionProperty:"none","data-variant":t}}},44386:(e,t,l)=>{"use strict";l.d(t,{N:()=>d});var a=l(31085),n=l(9350),o=l(58599),i=l(57284),r=l(29362);let s=e=>(0,a.jsx)(i.u,{...e,children:(0,a.jsx)("pre",{children:(0,a.jsx)(o.$p,{as:"code"})})}),d=n.Ay.extend({selectable:!1,isolating:!0,addNodeView:()=>(0,o.gu)(s,{update:r.z0})})},43873:(e,t,l)=>{"use strict";l.d(t,{y:()=>a});let a={UniqueAttribute:1e4,CardMention:1001,DocMention:1001,UserMention:1001,UndoInputRuleKeymap:1001,HorizontalAlign:1001,Collaboration:1e3,Highlight:150,FootnoteLabel:150,TextColor:150,Code:150,Link:140,SlashMenu:104,EmojiShortcuts:104,MentionSuggestionMenu:104,List:103,CardAccentLayoutItem:103,Table:102,Image:102,Gallery:102,CardLayoutItem:101,MediaPlaceholder:101,Layout:101,Footnote:101,Card:101,Toggle:101,SmartLayout:101,KeyMapOverride:100,GlobalDragHandle:99,CardIds:1,KeyBoardCatchall:1,UndoHistory:-100}},33795:(e,t,l)=>{"use strict";l.d(t,{B8:()=>y,uw:()=>b,Lf:()=>v,aW:()=>k});var a=l(13236),n=l(98380),o=l(77646),i=l(43873),r=l(73758),s=l.n(r),d=l(81570),u=l(73686),c=l(60443);let m=s()(10),f=["blockquote","card","sectionBreak","calloutBox"],p=(e,t)=>"numbered"===e.type.name||(0,c.x)(e)&&e.attrs.indent>t||e.isAtom||f.includes(e.type.name),g=e=>new d.k_({key:new d.hs("ListPlugin"),props:{decorations:e=>{let{doc:t}=e,l=[],a=new Map,n=(e,t)=>{var l;return(null===(l=a.get(e))||void 0===l?void 0:l[t])||1},o=(e,t,l)=>{let n=a.get(e);try{n[t]=l}catch(e){console.error("(caught) [ListPlugin] setCounter error",e)}},i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,l=a.get(e)||{};m.filter(e=>e>=t).forEach(e=>{l[e]=1}),a.set(e,l)},r=0;return t.descendants((e,t,s)=>{if((0,c.x)(e)&&e.firstChild){let a=e.firstChild.marks.find(e=>"textColor"===e.type.name);(null==a?void 0:a.attrs.variant)&&l.push(u.NZ.node(t,t+e.nodeSize,{"data-text-color":a.attrs.variant})),(null==a?void 0:a.attrs.hex)&&l.push(u.NZ.node(t,t+e.nodeSize,{style:"--list-marker-text-color: ".concat(a.attrs.hex)}))}if(!s||(p(e,r)||i(s),"numbered"!==e.type.name))return;a.get(s)||i(s);let d=e.attrs.indent;r=d;let m=n(s,d);o(s,d,m+1),i(s,d+1),l.push(u.NZ.node(t,t+e.nodeSize,{},{listNumber:m}))}),0==l.length?u.zF.empty:u.zF.create(t,l)}}});var h=l(16723);let b=8,y=a.YY.create({name:"list",priority:i.y.List,addProseMirrorPlugins(){return[g(this.editor)]},addCommands:()=>({listToCards:()=>e=>{let{chain:t,state:l}=e,{selection:n,doc:i}=l,{from:r,to:s}=n,d=(0,a.Nx)(i,{from:r,to:s},c.x),u=(0,a.KP)(o.jg)(n);if(!d.length||!u)return!1;let m=u.pos+u.node.nodeSize,f=(0,h.SQ)(d),p=(0,h.pT)(f);return t().insertContentAt(m,p).scrollIntoView().run(),!0},listToSmartLayout:e=>t=>{let{chain:l,state:n}=t,{selection:o,doc:i}=n,{from:r,to:s,$from:d,$to:u}=o,m=d.blockRange(u),f=(0,a.Nx)(i,{from:r,to:s},c.x);if(!f.length||!m)return!1;let p=(0,h.SQ)(f),g=(0,h.tb)(p,e);return l().insertContentAt({from:m.start,to:m.end},g).selectInsertedNode().scrollIntoView().run(),!0},indent:e=>t=>{let{tr:l,dispatch:a,state:n}=t;if(!a)return!0;let o=!1;return l.selection.ranges.forEach(t=>{let a=t.$from.pos,i=t.$to.pos;n.doc.nodesBetween(a,i,(t,a)=>{let{indent:n}=t.attrs;Object.values(c.e).includes(t.type.name)&&n+e>=0&&n+e<=b&&(l.setNodeMarkup(a,void 0,{...t.attrs,indent:n+e}),o=!0)})}),o},setListItems:e=>{let{variant:t}=e;return e=>{let{tr:l,dispatch:a,state:n}=e;return!a||(l.selection.ranges.forEach(e=>{let a=e.$from.pos,o=e.$to.pos;n.doc.nodesBetween(a,o,(e,a)=>{Object.values(c.e).includes(e.type.name)?l.setNodeMarkup(a,n.schema.nodes[t],e.attrs):e.isTextblock&&l.setNodeMarkup(a,n.schema.nodes[t],{...e.attrs,indent:0})})}),!0)}},toggleListItems:e=>{let{variant:t}=e;return e=>{let{commands:l,editor:a}=e;return v(a,t)?l.setNode("paragraph"):l.setListItems({variant:t})}}}),addKeyboardShortcuts:()=>({Enter:e=>{let t,l,{editor:a}=e;for(let e of Object.values(c.e))if(a.isActive(e)){l=a.getAttributes(e),t=e;break}if(void 0===t)return!1;let{from:n,$from:o,empty:i}=a.state.selection;return!!i&&(0==o.parent.content.size?l.indent>0?a.commands.indent(-1):a.commands.setNode("paragraph",l):0===o.parentOffset?(l.checked&&(l.checked=!1),a.chain().insertContentAt(n-1,{type:t,attrs:l}).selectInsertedNode().run()):o.parentOffset===o.parent.content.size&&(l.checked&&(l.checked=!1),a.chain().insertContentAt(n+1,{type:t,attrs:l}).selectInsertedNode().run()))},Backspace:e=>{let t,l,{editor:a}=e;for(let e of Object.values(c.e))if(a.isActive(e)){l=a.getAttributes(e),t=e;break}if(void 0===t)return!1;let{$from:n,empty:o}=a.state.selection;return!!o&&0==n.parentOffset&&a.commands.setNode("paragraph",l)},Tab:e=>{let{editor:t}=e;return t.commands.indent(1)},"Shift-Tab":e=>{let{editor:t}=e;return t.commands.indent(-1)},"Mod-]":e=>{let{editor:t}=e;return t.commands.indent(1)},"Mod-[":e=>{let{editor:t}=e;return t.commands.indent(-1)}})}),v=(e,t)=>{let l=Object.values(c.e).filter(e=>e!==t);return e.isActive(t)&&!l.some(t=>e.isActive(t))},k=(e,t)=>(0,n.tC)(e,[t.nodes.heading,t.nodes.title])},60443:(e,t,l)=>{"use strict";l.d(t,{e:()=>a,x:()=>n});var a=function(e){return e.Todo="todo",e.Bullet="bullet",e.Numbered="numbered",e}({});let n=e=>["todo","bullet","numbered"].includes(e.type.name)},16723:(e,t,l)=>{"use strict";l.d(t,{Jx:()=>m,SQ:()=>s,pT:()=>u,tb:()=>c});var a=l(72846),n=l.n(a),o=l(60443),i=l(95580),r=l(34444);let s=e=>{let t=[];for(let l=0;le.node.attrs.indent>n),i=s(o);t.push({node:a.node,pos:a.pos,children:i}),l+=o.length}return t},d=(e,t,l)=>{let a=[];for(let n=t+1;ne.map(e=>{let t=u(e.children);return{type:"card",content:[{type:"heading",attrs:{level:Math.min(e.node.attrs.indent+1,r.Bq)},content:[{type:"text",text:e.node.textContent}]},...t]}}),c=(e,t)=>({type:"smartLayout",attrs:{variantKey:t},content:e.map(e=>{let t=[{type:"heading",attrs:{level:4},content:n()(e.node.content.toJSON())}];return t.push(...e.children.map(e=>{let t=n()(e.node.toJSON());return t.attrs.indent-=1,t})),{type:"smartLayoutCell",content:t}})}),m=e=>(0,i.Ng)(e,o.x)},12443:(e,t,l)=>{"use strict";l.d(t,{Cn:()=>u,I4:()=>r,Sm:()=>i,eq:()=>d});var a=l(98371),n=l(79194),o=l(95905);let i=e=>{var t;let{horizontalAlign:l,eventTarget:a,node:o,newContent:i,editor:r}=e,d=a.closest("[data-media-node-wrapper]"),u=Math.round(((null==d?void 0:null===(t=d.querySelector("img"))||void 0===t?void 0:t.clientWidth)||100)/((null==d?void 0:d.clientWidth)||100)*100),c=[n.w.paragraph()],m=s(a,r.view);return{type:"gridLayout",attrs:{colWidths:(()=>{switch(l){case"center":return[(100-u)/2,u,(100-u)/2];case"right":return[100-u,u];default:return[u,100-u]}})()},content:(()=>{switch(l){case"center":return[{type:"gridCell",content:"left"===m&&i?i:c},{type:"gridCell",content:[o.toJSON()]},{type:"gridCell",content:"right"===m&&i?i:c}];case"right":return[{type:"gridCell",content:i||c},{type:"gridCell",content:[o.toJSON()]}];default:return[{type:"gridCell",content:[o.toJSON()]},{type:"gridCell",content:i||c}]}})()}},r=e=>{let{horizontalAlign:t,prevPos:l}=e;switch(t){case"center":case"right":return l+4;default:return l+2}},s=(e,t)=>{let l=(0,a.xX)(e,t.dom,e=>e.hasAttribute("data-media-add-side"));return null==l?void 0:l.getAttribute("data-media-add-side")},d=e=>{let{view:t,from:l,to:a,node:n}=e,i=(0,o.er)(t.state,l,a);return n.attrs.horizontalAlign||("rtl"===i?"right":"left")},u=e=>{let{eventTarget:t,horizontalAlign:l,nodeSize:a,editor:n}=e,o=s(t,n.view);switch(l){case"right":return 2;case"center":return"left"===o?2:a+7;default:return a+4}}},57750:(e,t,l)=>{"use strict";l.d(t,{Ch:()=>T,x6:()=>O,a6:()=>P});var a=l(31085),n=l(25420),o=l(3706),i=l(62313),r=l(61778),s=l(73893),d=l(22544),u=l(17539),c=l(77214),m=l(2600),f=l(9021),p=l(18651),g=l(20501),h=l(24221),b=l(95986),y=l(52177),v=l(12327),k=l(66792),w=l(70605),x=l(59707),S=l(90406),A=l(12116);let C=e=>{var t;let{node:l,disableOpenButton:n=!1}=e,{meta:o,source:s}=l.attrs,d=(0,S.lQ)(l.attrs),u=(0,A.B)(s),{handleOpenLinkWithInterstitial:p}=(0,k.E)(d),C="embed.custom"===s||"video.custom"===s,I=(null==o?void 0:o.icon)||(null===(t=u.image)||void 0===t?void 0:t.src),j=(null==o?void 0:o.site)||(C?(0,c.t$)(d):u.label());return(0,a.jsxs)(m.T,{spacing:"0.25em",align:"flex-start",color:"black",w:"100%",fontSize:"0.9em",children:[(0,a.jsxs)(i.z,{align:"center",spacing:"0.25em",w:"100%",color:"var(--body-color-muted)",children:[(0,a.jsx)(z,{icon:I}),(0,a.jsx)(r.E,{noOfLines:1,flex:1,"data-testid":"site-name",fontSize:"0.9em",children:j}),u.downloadable&&d&&(0,a.jsx)(b.Tz,{label:(0,a.jsx)(y.x6,{id:"mzI/c+"}),placement:"top",children:(0,a.jsx)(f.K,{"aria-label":v.Ru._({id:"mzI/c+"}),icon:(0,a.jsx)(h.g,{icon:g.cbP}),onClick:()=>{let e=document.createElement("a");e.href=d,e.target="_blank",e.download=(null==o?void 0:o.title)||"file.pdf",e.dispatchEvent(new MouseEvent("click"))},variant:"unstyled",sx:w.Up,fontSize:"0.7em",zIndex:2,onMouseDown:x.Fw})}),!n&&d&&(0,a.jsx)(b.Tz,{label:(0,a.jsx)(y.x6,{id:"Alx2/L"}),placement:"top",children:(0,a.jsx)(f.K,{"aria-label":v.Ru._({id:"Alx2/L"}),icon:(0,a.jsx)(h.g,{icon:g.vMs}),onClick:p,variant:"unstyled",zIndex:2,fontSize:"0.7em",onMouseDown:x.Fw,sx:w.Up})})]}),(0,a.jsx)(r.E,{fontWeight:"bold",noOfLines:1,maxW:"90%","data-testid":"title",color:"var(--body-color)",wordBreak:"break-all",children:null==o?void 0:o.title}),(null==o?void 0:o.description)&&(0,a.jsx)(r.E,{noOfLines:[2,3],whiteSpace:"normal",maxW:"100%",color:"var(--body-color-muted)",children:o.description})]})},z=e=>{let{icon:t,...l}=e;return t?(0,a.jsx)(p._,{src:t,h:"1.5em",borderRadius:"sm",...l}):(0,a.jsx)(r.E,{as:"span",...l,children:(0,a.jsx)(h.g,{icon:g.c9S})})};var I=l(80532),j=l(3040),F=l(99420),B=l.n(F),R=l(4977),_=l(94007);let M=e=>{let{node:t}=e,{thumbnail:l,meta:o,source:s}=t.attrs,d=(null==l?void 0:l.src)||(null==l?void 0:l.tempUrl);return(null==l?void 0:l.showPlaceholder)?(0,a.jsx)(_.Pf,{hasUploadError:l.uploadStatus===R.A.Error,isUploading:l.uploadStatus===R.A.Uploading,width:"100%",borderRadius:"none",icon:"embed.pdf"===s?g.O_q:g.c9S}):d?(0,a.jsxs)(n.s,{flex:1,color:"white",position:"relative",children:[(0,a.jsx)(I.az,{flex:1,overflow:"hidden",bgColor:"white",children:(0,a.jsx)(p._,{src:d,position:"absolute",objectFit:"cover",width:"100%",height:"100%"})}),(null==l?void 0:l.uploadStatus)===R.A.Uploading&&(0,a.jsx)(_.Td,{}),(null==o?void 0:o.duration)&&(0,a.jsxs)(i.z,{fontSize:"0.75em",backgroundColor:"blackAlpha.700",color:"white",position:"absolute",right:0,bottom:0,py:1,px:2,"data-thumbnail-hidden":!0,children:[(0,a.jsx)(h.g,{icon:j.ijD}),(0,a.jsx)(r.E,{children:function(e){let t=B().duration(e,"seconds"),l=t.hours().toString().padStart(2,"0"),a=t.minutes().toString().padStart(2,"0"),n=t.seconds().toString().padStart(2,"0");return t>=B().duration(1,"hour")?l+":"+a+":"+n:a+":"+n}(o.duration)})]})]}):null},E=e=>e&&(!e.height||e.height>=50)&&(!e.width||e.width>=50),T=e=>{let{node:t}=e,{thumbnail:l,sourceUrl:i}=t.attrs;return(0,a.jsxs)(n.s,{overflow:"hidden",direction:"row",align:"stretch",wrap:"wrap",contentEditable:!1,transitionProperty:"common",transitionDuration:"normal",position:"relative",borderRadius:"inherit","data-content-reference":!0,"data-selection-ring":"inside","data-selection-background":!0,fontFamily:"Inter, sans-serif","data-drag-handle":!0,h:"100%",maxW:"var(--media-maxW)",maxH:"var(--media-maxH)",children:[l&&E(l)&&(0,a.jsx)(n.s,{flex:1,minH:"10em",minW:"min(10em, 100%)",maxW:"100%",maxH:"var(--media-maxH)",children:(0,a.jsx)(M,{node:t})}),(0,a.jsx)(n.s,{flex:1.618,minW:"min(16em, 100%)",maxW:"100%",p:"1em",position:"relative",children:(0,a.jsx)(C,{node:t})}),d.D1&&i&&(0,a.jsx)(o.N,{href:i,h:"100%",w:"100%",position:"absolute",zIndex:"-10","data-pdf-link":!0})]})},O=e=>{var t;let{node:l}=e,{thumbnail:d,meta:u,sourceUrl:m,source:f}=l.attrs,p=(0,A.B)(f);return(0,a.jsxs)(n.s,{minW:"var(--media-maxH)",w:"100%",css:{aspectRatio:"16 / 9"},maxW:"100%",maxH:"var(--media-maxH)",h:"100%",align:"stretch",boxSizing:"content-box",overflow:"hidden","data-content-reference":!0,"data-selection-ring":"inside",position:"relative",bg:"gray.100",children:[d&&E(d)?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(M,{node:l}),(0,a.jsxs)(i.z,{backgroundColor:"whiteAlpha.700",backdropFilter:"blur(8px)",py:1,px:2,position:"absolute",bottom:"0",fontSize:"0.75em","data-thumbnail-hidden":!0,children:[(0,a.jsx)(z,{icon:(null==u?void 0:u.icon)||(null===(t=p.image)||void 0===t?void 0:t.src)}),m&&(0,a.jsx)(r.E,{color:"black",noOfLines:1,children:(null==u?void 0:u.title)||(null==u?void 0:u.site)||(0,c.t$)(m)})]})]}):(0,a.jsx)(n.s,{align:"flex-start",flex:"1",p:4,children:(0,a.jsx)(C,{node:l,disableOpenButton:!0})}),s.$.GAMMA_PUPPETEER_SERVICE&&m&&(0,a.jsx)(o.N,{href:m,h:"100%",w:"100%",position:"absolute",zIndex:"-10","data-pdf-link":!0})]})},P=e=>{var t;let{node:l}=e,{meta:o,source:i,thumbnail:r}=l.attrs,s=(0,A.B)(i),d=(null==r?void 0:r.src)||(null==r?void 0:r.tempUrl),c=d&&(0,u.Ub)(d,u.p7);return(0,a.jsx)(n.s,{minW:"var(--media-maxH)",w:"100%",css:{aspectRatio:"16 / 9"},bg:"var(--body-color-muted)",align:"center",justify:"center",bgImage:(0,u.QV)(c),backgroundSize:"cover",children:(0,a.jsx)(z,{icon:(null==o?void 0:o.icon)||(null===(t=s.image)||void 0===t?void 0:t.src),fontSize:"7.5em"})})}},12116:(e,t,l)=>{"use strict";l.d(t,{B:()=>o,l:()=>i});var a=l(73893),n=l(74327);let o=e=>e&&n.Dc[e]?n.Dc[e]:n.Jp,i=e=>"".concat(a.$.EMBED_PROXY_URL,"?alt_url=").concat(e)},69951:(e,t,l)=>{"use strict";l.d(t,{Aj:()=>n,BA:()=>u,I0:()=>a,Vj:()=>i,XJ:()=>o,ZX:()=>d,mj:()=>s,pg:()=>r});let a=.8,n=12,o=8,i=15,r=5,s=1,d=2,u=.1},17835:(e,t,l)=>{"use strict";l.d(t,{HI:()=>C,IG:()=>y,Im:()=>k,NZ:()=>h,Pb:()=>f,jG:()=>z,ni:()=>b,qK:()=>g,tz:()=>S,w5:()=>j,wG:()=>x,yL:()=>v,yg:()=>w});var a=l(13236),n=l(69e3);l(14041);var o=l(9335),i=l(40201),r=l(95580),s=l(17119),d=l(77646),u=l(1712),c=l(93090),m=l(90406);let f=e=>"gallery"===e.type.name,p=e=>(0,a.eL)(e,f),g=e=>!!p(e),h=e=>{let{decorations:t}=e;return t.some(e=>e.spec.inGallery)},b=e=>{let{decorations:t}=e;return t.some(e=>"grid"===e.spec.layout)},y=e=>{var t;let{decorations:l}=e;return null===(t=l.find(e=>e.spec.thumbHeight))||void 0===t?void 0:t.spec.thumbHeight},v=e=>{var t;let{decorations:l}=e;return null===(t=l.find(e=>e.spec.thumbSpacing))||void 0===t?void 0:t.spec.thumbSpacing},k=e=>{let{decorations:t}=e;return t.some(e=>"logo"===e.spec.layout)},w=e=>{var t;let{decorations:l}=e,a=null===(t=l.find(e=>e.spec.children))||void 0===t?void 0:t.spec.children;return a?(0,r.F2)(a):[]},x=e=>{let t=(0,s.rV)(e.$from);t&&!(0,d.jg)(t.node)?o.LF.emit(o.DN.CREATE_COMMENT_FROM_SELECTION,{selectionPos:e.from,parentPos:t.pos,text:(0,i.Lo)(e.node)}):o.LF.emit(o.DN.CREATE_COMMENT_FROM_SELECTION,{selectionPos:e.from,parentPos:e.from,text:(0,i.Lo)(e.node)})},S=(e,t,l,a)=>{let n,o;if(l&&!A(l,e.state.schema))return null;let i=e.posAtCoords({left:t.clientX,top:t.clientY});if(!i)return null;let{doc:s}=e.state,{pos:d}=i,u=s.resolve(d),c=p(u);if(c&&c.node.childCount>0)d=i.pos,(n=(0,r.q0)(d,e))||d!=c.pos+c.node.nodeSize-1||(d-=1,n=(0,r.q0)(d,e)),o=c.node;else{d=i.inside;try{o=s.resolve(d).nodeAfter}catch(e){return null}if(!o||!(0,m.Bv)(o)||o==(null==l?void 0:l.content.firstChild)||a)return null;let t=u.parent;if(t&&!I(e.state.schema,t))return null;if("image"===o.type.name){var f;let t=e.nodeDOM(d);n=null==t?void 0:null===(f=t.querySelector("[data-node-image-testid]"))||void 0===f?void 0:f.getBoundingClientRect()}else n=(0,r.q0)(d,e)}if(!n)return null;let g=t.clientX-n.left,h=n.right-t.clientX,b=g>h?"right":"left";return("left"==b?g<0:h<0)&&!c?null:{pos:d,side:b,rect:n,node:o}},A=(e,t)=>e.content.size>0&&t.nodes.gallery.validContent(e.content),C=(e,t)=>{var l;let a=null===(l=e.dragging)||void 0===l?void 0:l.slice;if(!a){let e=[...t.dataTransfer.items];return e.length>0&&e.every(e=>e.type.startsWith("image/"))}return A(a,e.state.schema)},z=(e,t,l)=>{let a=(0,c.dM)(l,t);return(0,u.kf)(t)||A(t,e)||a&&a.length>0},I=(e,t)=>{let l=e.nodes[t.type.name];return!!l&&l.validContent(n.FK.fromJSON(e,[{type:"gallery",content:[]}]))},j=(e,t)=>"calc(".concat(.25*e,"em + ").concat(t,"em)")},81594:(e,t,l)=>{"use strict";l.d(t,{Y:()=>S});var a=l(31085),n=l(80532),o=l(25420),i=l(35789),r=l(12917),s=l(89897),d=l.n(s),u=l(71022),c=l(4977),m=l(88957),f=l(61690),p=l(17539),g=l(38684),h=l(4381),b=l(54979),y=l(62216),v=l(27930),k=l(94007),w=l(21696),x=l(90406);let S=e=>{var t,l,i;let{image:s,editor:d,getPos:u,imageShape:b,imageSx:S,node:C,decorations:z,handleEditableClick:I,handleEditableDoubleClick:j,hasQuickActions:F=!1,isInlineColorableSvg:B=!1,editWithoutSelection:R=!1}=e,_=(0,w.j)(d,u),M=d.state.selection.from===u(),E=(0,x.XJ)((null==s?void 0:s.src)||(null==s?void 0:s.tempUrl)),{isDark:T,bodyColor:O}=(0,h.a)(z),P=!s||s.showPlaceholder||!s.src&&!s.tempUrl,N=null!==(i=s&&(null===(t=s.loadImageParams)||void 0===t?void 0:t.provider))&&void 0!==i?i:void 0,D=s&&"queued"===s.loadImageStatus&&!d.isThumbnail,{tempUrl:L,uploadStatus:W,meta:U}=s||{},G=(null==s?void 0:s.src)?(0,p.pO)(s.src,O):void 0,H=(0,m.GV)(f.nD),V=C.attrs.source,q=G&&(0,p.Ub)(G,d.isThumbnail?p.p7:d.isSiteNavbarEditor?p.oc:{width:1e3,height:1e3},U),K=(0,p.QV)(q,q?void 0:L),J={backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundImage:B||P?void 0:K,backgroundPosition:(0,g.w3)(s),width:"100%",height:"100%",borderRadius:"circle"!==b||B?"var(--box-border-radius)":"full",transitionProperty:"border-radius",transitionDuration:"normal",...S};return(0,a.jsxs)(n.az,{position:"relative",cursor:M||R&&H?"pointer":"default",contentEditable:!1,h:"100%",onClick:H?I:void 0,onDoubleClick:H?j:void 0,transitionProperty:"filter background",transitionDuration:"normal",_hover:H&&M?{filter:T?"brightness(1.15)":"brightness(0.85)",bg:E?T?"whiteAlpha.100":"blackAlpha.100":void 0}:void 0,children:[P?(0,a.jsx)(k.Pf,{...J,isLoading:!!D,loadingProvider:N,icon:(null===(l=y.Fn["image.custom"])||void 0===l?void 0:l.icon)||r.Cyq,h:"100%",hasQuickActions:F,onSelectAndFocus:()=>{H&&_()},defaultSource:V,cursor:M||R?"pointer":"default"}):B?(0,a.jsx)(A,{image:s,src:G||L||"",imageShape:b,imageStyles:J}):(0,a.jsx)(o.s,{"data-content-reference":!0,"data-change-focus-point-el":!0,className:"card-layout-cell-bg",position:"relative",sx:J}),W==c.A.Uploading&&H&&(0,a.jsx)(v.Td,{}),W==c.A.Error&&(0,a.jsx)(v.Hy,{})]})},A=e=>{var t;let{image:l,src:n,imageShape:o,imageStyles:r}=e,s=null!==(t=b.z[o||"square"])&&void 0!==t?t:b.z.square,{meta:c}=l||{},m=(0,x.Kk)(n,"accessory-img-inline-svg");return(0,a.jsx)(i.o,{...r,objectFit:"contain",sx:{svg:{width:"100%",aspectRatio:null==s?void 0:s.aspectRatio}},children:(0,a.jsx)(u.A,{src:m,viewBox:(null==c?void 0:c.width)&&(null==c?void 0:c.height)?"0 0 ".concat(c.width," ").concat(c.height):void 0,className:"colorable-icon",preProcessor:e=>d().sanitize(e,{USE_PROFILES:{svg:!0,svgFilters:!0}})})})}},69069:(e,t,l)=>{"use strict";l.d(t,{BT:()=>A,CF:()=>x,Ft:()=>C});var a=l(31085),n=l(78141),o=l(12567),i=l(14041),r=l(89864),s=l(38452),d=l(88957),u=l(95994),c=l(8007),m=l(12253);let f=["0%","0%","0%","0%"],p="clippable-control-wrapper",g=(e,t,l)=>e/Math.sqrt((t*t+l*l)/2)*100,h=(e,t,l)=>e/100*Math.sqrt((t*t+l*l)/2),b=(e,t,l)=>{if("circle"===e){let e=Math.min(t,l)/2;return["".concat(g(e,t,l),"%"),"at","50%","50%"]}return f},y=(e,t,l)=>"circle"===e?1:"inset"===e?t/l:null,v=(e,t)=>{if("inset"===t){let[t,l]=e[0],[a,n]=e[4];return(a-t)/(n-l)}return 1},k=(e,t,l,a)=>{let[n,o,i,r]=e;if("inset"===t){let t=parseFloat(n),s=parseFloat(o),d=parseFloat(i),c=parseFloat(r),m=u.MK/l*100,f=u.MK/a*100;if(100-c-s=0?e[1]="".concat(t,"%"):(e[1]="0%",e[3]="".concat(100-m,"%"))}if(100-t-d=0?e[2]="".concat(l,"%"):(e[2]="0%",e[0]="".concat(100-f,"%"))}}else if("circle"===t){let t=Math.max(h(parseFloat(n),l,a),u.MK);e[0]="".concat(g(t,l,a),"%")}},w=e=>{let{clipType:t,clipStyles:l,w:a,h:n}=e,[o,i,r,s]=l;if("inset"===t){let e=parseFloat(o),t=parseFloat(i),l=parseFloat(r),a=parseFloat(s),n=a/(t+a)*100,d=e/(e+l)*100,u=isNaN(n)?50:n,c=isNaN(d)?50:d,m=100-a-t,f=100-e-l;return{mask:"\n linear-gradient(#000 0 0) ".concat(u,"% ").concat(c,"% / ").concat(m,"% ").concat(f,"%,\n linear-gradient(rgba(0,0,0,0.4) 0 0)"),width:m,height:f,top:e,right:t,bottom:l,left:a}}if("circle"===t){let e=parseFloat(o),t=parseFloat(r),l=parseFloat(s),i=h(e,a,n),d=l/100*n-i,u=t/100*a-i,c=2*i/a*100,m=2*i/n*100,f=d/n*100,p=u/a*100;return{mask:"radial-gradient(".concat(c,"% ").concat(m,"% at ").concat(t,"% ").concat(l,"%, black 50%, rgba(0, 0, 0, 0.4) 50%) no-repeat"),width:c,height:m,top:Math.max(f,0),left:Math.max(p,0),bottom:0,right:0}}return{mask:"",width:0,height:0,top:0,left:0,bottom:0,right:0}},x=(e,t,l,a)=>{if(!e||!e.clipType||!a)return{clipType:"inset",scaleCrop:1,scaleX:1,scaleY:1,aspectRatio:a||void 0,referenceXOffset:1,referenceYOffset:1,clipPathCSSString:"",translateX:0,translateY:0};let n=e.clipPath||b(e.clipType,t,l),{clipType:o}=e,{width:i,height:r,top:s,left:d,right:u,bottom:c}=w({w:t,h:l,clipType:o,clipStyles:n}),m=100/i,f=100/r,p=(null==e?void 0:e.clipAspectRatio)||1,g=(null==e?void 0:e.clipAspectRatio)||a;return{scaleCrop:a/p<1?Math.min(f,m):Math.max(f,m),aspectRatio:g,scaleX:m,scaleY:f,translateX:d,translateY:s,referenceXOffset:t*(100/(100-d+u)-1),referenceYOffset:l*(100/(100-s+c)-1),clipPathCSSString:"".concat(o,"(").concat(n.join(" "),")"),clipType:o}},S=(0,r.yX)([r.ZW]),A={[".".concat(p)]:{zIndex:2,".moveable-control":{zIndex:2,_hover:{opacity:1},transitionProperty:"opacity",transitionDuration:"normal"},"&.data-clip-type-inset":{".moveable-control":{zIndex:2,bg:"0 none !important",borderRadius:"0px",width:"".concat(16,"px"),height:"".concat(16,"px"),border:"6px solid var(--chakra-colors-trueblue-300)",'&[data-clip-index="0"]':{borderRight:"0",borderBottom:"0",marginTop:"-".concat(2,"px"),marginLeft:"-".concat(2,"px"),cursor:"nw-resize"},'&[data-clip-index="1"]':{borderRight:"0",borderBottom:"0",borderLeft:"0",marginTop:"-".concat(2,"px"),cursor:"n-resize"},'&[data-clip-index="2"]':{borderLeft:"0",borderBottom:"0",marginTop:"-".concat(2,"px"),marginLeft:"-".concat(14,"px"),cursor:"ne-resize"},'&[data-clip-index="3"]':{borderBottom:"0",borderTop:"0",borderLeft:"0",marginLeft:"-".concat(14,"px"),cursor:"e-resize"},'&[data-clip-index="4"]':{borderTop:"0",borderLeft:"0",marginLeft:"-".concat(14,"px"),marginTop:"-".concat(14,"px"),cursor:"se-resize"},'&[data-clip-index="5"]':{borderTop:"0",borderLeft:"0",borderRight:"0",marginTop:"-".concat(14,"px"),cursor:"s-resize"},'&[data-clip-index="6"]':{borderTop:"0",borderRight:"0",marginTop:"-".concat(14,"px"),marginLeft:"-".concat(2,"px"),cursor:"sw-resize"},'&[data-clip-index="7"]':{borderTop:"0",borderBottom:"0",borderRight:"0",marginLeft:"-".concat(2,"px"),cursor:"w-resize"}}},"&.data-clip-type-circle":{".moveable-control":{bg:"trueblue.300"}},".moveable-clip-ellipse":{borderWidth:"2px",borderColor:"var(--chakra-colors-trueblue-300) !important"},".moveable-line":{display:"none"}}},C=e=>{let{clipPath:t,clipAspectRatio:l,updateResizeAttrs:r,imageWrapperRef:u,refreshDeps:f,currentWidth:g,currentHeight:h,onFinishCrop:x}=e,A=(0,d.jL)(),C=(0,d.GV)(m.$k),z=(0,i.useRef)(null),[I,j]=(0,i.useState)({clipPath:t||b(C,g,h),clipAspectRatio:l||y(C,g,h)}),F=(0,i.useCallback)(e=>{if(!g||!h||!u.current)return;let{mask:t}=w({w:g,h:h,clipType:C,clipStyles:e});u.current.style["-webkit-mask"]=t,u.current.style["-webkit-mask-repeat"]="no-repeat"},[u,C,g,h]),B=JSON.stringify(I.clipPath);(0,i.useEffect)(()=>{F(I.clipPath)},[F,B,I.clipPath]),(0,n.w)(()=>{j(e=>({...e,clipPath:b(C,g,h),clipAspectRatio:y(C,g,h)}))},[C]),(0,i.useEffect)(()=>{var e;null===(e=z.current)||void 0===e||e.updateTarget()},[f]);let R=(0,i.useCallback)(()=>{let e={clipType:C,...I};e.clipAspectRatio&&e.clipPath&&r(e)},[r,I,C]),_=(0,i.useRef)({fn:R,confirmOnUnmount:!0});_.current.fn=R,(0,i.useEffect)(()=>c.R.on("endClip",e=>{let{confirm:t}=e;_.current.confirmOnUnmount=t,A((0,m.uy)()),x&&x()}),[A,x]),(0,i.useEffect)(()=>{let e=_.current;return()=>{e.confirmOnUnmount&&setTimeout(e.fn,0)}},[]),(0,i.useEffect)(()=>s.WC.on("keydown","CLIPPABLE",e=>!!(0,o.Ay)("mod+x")(e)&&(e.preventDefault(),!0)),[]);let M="".concat(C,"(").concat((I.clipPath||b(C,g,h)).join(" "),")");return(0,a.jsx)(S,{ref:e=>{z.current=e},className:"".concat(p," data-clip-type-").concat(C),target:u.current,renderDirections:["ne","nw","se","sw"],origin:!1,draggable:!1,clippable:!0,clipTargetBounds:!0,clipRelative:!0,clipArea:!0,defaultClipPath:C,customClipPath:M,dragWithClip:!0,keepRatio:!0,onClip:e=>{let{clipStyles:t,clipType:l}=e;k(t,l,g,h),F(t)},onClipEnd:e=>{let{lastEvent:t}=e;if(!(null==t?void 0:t.clipStyles))return;let{clipStyles:l,clipType:a}=t;k(l,a,g,h),j({clipPath:l,clipAspectRatio:v(t.poses,C)})}})}},56436:(e,t,l)=>{"use strict";l.d(t,{F:()=>w});var a=l(31085),n=l(80532),o=l(18651),i=l(14041),r=l(82257),s=l(17539),d=l(94007),u=l(3706),c=l(4876),m=l(88957),f=l(747),p=l(61690);let g=e=>{let{link:t,children:l,...n}=e,o=(0,m.GV)(p.nD),{linkUrl:r,handleClick:s}=(0,f.c)({url:t||""}),{interceptLinkClick:d,linkUrlSafe:g,isUntrusted:h,linkInterceptEnabled:b}=(0,c.i)(r),y=(0,i.useCallback)(e=>{if(null==s||s(e),!o)return b?d(e):void 0;e.preventDefault()},[o,s,d,b]);return t&&!h?(0,a.jsx)(u.N,{href:b?g||"":r,isExternal:!0,onClick:y,rel:"noopener nofollow",...n,children:l}):(0,a.jsx)(a.Fragment,{children:l})};var h=l(90406),b=l(69069);let y=(e,t,l)=>e/100*(Math.sqrt(t*t+l*l)/Math.sqrt(2))*2,v=e=>{let t,l,a,n,o,{w:i,h:r,clipPath:d,clipType:u,src:c}=e;if(!d||!u||!c)return null;if("inset"===u){let e=.01*parseFloat(d[0]),o=.01*parseFloat(d[1]),i=.01*parseFloat(d[2]),r=.01*parseFloat(d[3]);t=r+o===0?0:1-(r+o),l=e+i===0?0:1-(e+i),a=r,n=e}else{l=t=y(parseFloat(d[0]),i,r);let e=t/2;a=(.01*parseFloat(d[2])-e/i)*i,n=(.01*parseFloat(d[3])-e/r)*r,o=!0}return{url:(0,s.bI)(c,k({crop:{cropWidth:t,cropHeight:l},gravity:{xOffset:a,yOffset:n}})),isCircle:o}},k=e=>{let{crop:{cropWidth:t,cropHeight:l},gravity:{xOffset:a,yOffset:n}}=e;return{crop:"".concat(t,":").concat(l,":nowe:").concat(a,":").concat(n),resizing_type:"auto"}},w=(0,i.forwardRef)((e,t)=>{let{imageAttrs:{src:l,tempUrl:i,resize:u,meta:c},isCroppingThisImage:m=!1,isZoomed:f=!1,objectFit:p="contain",containerWidth:y,intrinsicAspectRatio:k,isThumbnail:w,linkHref:x,containerProps:S,shouldUseImgProxyCrop:A,bodyColor:C,...z}=e;C&&l&&(l=(0,s.pO)(l,C));let I=(0,r.oR)(),j=(null==c?void 0:c.frame_count)&&c.frame_count>1,F=f||!l||j?l:(0,s.Ub)(l,w?{height:400}:{width:2e3},c),B=y||(null==c?void 0:c.width)||1,R=y&&k?y/k:(null==c?void 0:c.height)||1,{scaleCrop:_,scaleY:M,clipPathCSSString:E,translateX:T,translateY:O,aspectRatio:P,referenceXOffset:N,referenceYOffset:D}=(0,b.CF)(u,B,R,k||(c?c.width/c.height:1))||{},L=!m&&!!(null==u?void 0:u.clipPath),W=m?"":"scale(".concat(_,") translate(-").concat(T,"%, -").concat(O,"%)"),U=(0,h.XJ)(l||i),G=v({w:B,h:R,clipPath:null==u?void 0:u.clipPath,clipType:null==u?void 0:u.clipType,src:l});return(0,a.jsx)(g,{link:x,w:f?void 0:"100%",children:(0,a.jsx)(n.az,{css:{aspectRatio:"".concat(L?P:"")},className:"image","data-content-reference":"".concat(N,",").concat(D),"data-export-link":x,"data-drag-preview":!0,"data-scale-preview":!0,maxH:"var(--media-maxH)",maxW:"var(--media-maxW)",overflow:"hidden",w:f?void 0:"100%",h:"cover"==p?"100%":void 0,sx:{"@media print":{height:"unset"}},...S,children:A&&(null==G?void 0:G.url)?(0,a.jsx)(o._,{alt:"",objectFit:p,maxH:"calc(var(--media-maxH) * ".concat(M||1,")"),minH:"cover"==p?"calc(var(--media-maxH) / ".concat(_||1,")"):void 0,ref:t,...l||i?{}:d.v9,src:(null==G?void 0:G.url)||F||i||"",...z}):(0,a.jsx)(o._,{alt:"",objectFit:p,maxH:"calc(var(--media-maxH) * ".concat(M||1,")"),minH:"cover"==p?"calc(var(--media-maxH) / ".concat(_||1,")"):void 0,transformOrigin:"left top",clipPath:m?"":E,ignoreFallback:f||I,transform:W,src:F||i||"",fallbackSrc:i||"",ref:t,w:U?"100%":void 0,...l||i?{}:d.v9,...z})})})});w.displayName="CroppedImage"},77854:(e,t,l)=>{"use strict";l.d(t,{c:()=>d});var a=l(13236),n=l(44498),o=l(58599),i=l(43873),r=l(29362),s=l(217);let d=n.Ay.extend({selectable:!0,draggable:!0,group:"block media",priority:i.y.Image,addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),placeholders:{}}},addNodeView:()=>(0,o.gu)(s.v,{update:r.z0}),parseHTML:()=>[{tag:"img[src], img[tempUrl]"}],renderHTML(e){let{HTMLAttributes:t}=e;return["img",(0,a.KV)(t,{class:"gamma-simple-image"})]},addAttributes:()=>({src:{},tempUrl:{},uploadStatus:{},source:{},showPlaceholder:{}})})},217:(e,t,l)=>{"use strict";l.d(t,{v:()=>u});var a=l(31085),n=l(80532),o=l(3706),i=l(18651),r=l(4977),s=l(58599),d=l(27930);let u=e=>{let{node:t}=e,{src:l,tempUrl:u,uploadStatus:c,showPlaceholder:m,id:f}=t.attrs;return(0,a.jsxs)(s.VR,{as:"div",children:[m&&(0,a.jsx)(d.VM,{...e}),!m&&(l||u)&&(0,a.jsxs)(n.az,{position:"relative",w:"100%",children:[(0,a.jsx)(o.N,{className:"image-link",href:l||u||"",target:"_blank",children:(0,a.jsx)(i._,{src:l||u||""})}),c==r.A.Uploading&&(0,a.jsx)(d.Td,{}),c==r.A.Error&&(0,a.jsx)(d.Hy,{})]})]})};u.displayName="simple-image-view"},47572:(e,t,l)=>{"use strict";l.d(t,{P:()=>n,T:()=>a});let a="non-clickable",n={clipType:null,clipPath:null,clipAspectRatio:null,width:null}},78807:(e,t,l)=>{"use strict";l.d(t,{E:()=>i});var a=l(14041),n=l(88957),o=l(45776);let i=e=>{let t=(0,n.jL)(),l=(0,a.useCallback)(e=>{let{clipType:l}=e;l&&t((0,o.F8)({clipType:l}))},[t]),i=(0,a.useCallback)(l=>{let{id:a}=l;o.RR.emit("endClip",{id:a,confirm:!1}),t((0,o.uy)()),e.commands.resetImageClip()},[t,e]),r=(0,a.useCallback)(e=>{let{id:l}=e;o.RR.emit("endClip",{id:l,confirm:!1}),t((0,o.uy)())},[t]),s=(0,a.useCallback)(e=>{let{id:l}=e;o.RR.emit("endClip",{id:l,confirm:!0}),t((0,o.uy)())},[t]);return{cancelCrop:r,startCrop:(0,a.useCallback)(e=>{let{id:l,clipType:a}=e;t((0,o.Zu)({id:l,clipType:a})),o.RR.emit("startCrop",{id:l})},[t]),confirmCrop:s,resetCrop:i,setCropClipType:l}}},8007:(e,t,l)=>{"use strict";l.d(t,{R:()=>a});let a=new(l(36832)).b},2861:(e,t,l)=>{"use strict";l.d(t,{M:()=>o,j:()=>n});var a=l(14041);let n=()=>{let e=(0,a.useRef)(null),t=(0,a.useRef)(null),[l,n]=(0,a.useState)(0),[o,i]=(0,a.useState)(0),[r,s]=(0,a.useState)(null);return{width:l,height:o,aspectRatio:r,setSize:(0,a.useCallback)(()=>{var l,a;let o=null===(l=e.current)||void 0===l?void 0:l.getBoundingClientRect(),r=null===(a=t.current)||void 0===a?void 0:a.getBoundingClientRect();if(o&&r){let e=r.width/r.height,t=o.width,l=o.width/e;if(0===t||isNaN(t)||0===l||isNaN(l))return;n(t),i(l),s(e)}},[]),containerWrapperRef:e,imageRef:t}},o=e=>(0,a.useCallback)(t=>{if(!e)return;let l=null==e?void 0:e.view.domAtPos(t);if(!l){console.warn("scrollOnImageLoad could not domAtPos",{pos:t});return}let a=l.node.childNodes[l.offset];if(!a){console.warn("scrollOnImageLoad could not find node",{parentNode:l.node,offset:l.offset});return}let n=a.querySelector("[data-image-node-element] img");if(!n){console.warn("scrollOnImageLoad could not find element");return}let o=()=>{e.chain().selectNodeAtPos(t,!1).focus().scrollIntoView().run(),setTimeout(()=>{e.chain().selectNodeAtPos(t,!1).focus().scrollIntoView().run()},1e3),n.removeEventListener("load",o)};n.addEventListener("load",o)},[e])},45776:(e,t,l)=>{"use strict";l.d(t,{_V:()=>eC,zs:()=>ex.zs,uy:()=>ex.uy,N2:()=>ex.N2,RR:()=>x.R,$k:()=>ex.$k,CU:()=>ex.CU,iZ:()=>ex.iZ,No:()=>ex.No,F8:()=>ex.F8,GP:()=>ex.GP,BS:()=>ex.BS,sI:()=>ex.sI,Zu:()=>ex.Zu,WE:()=>ex.WE});var a=l(13236),n=l(44498),o=l(81570),i=l(60953),r=l(33587),s=l(952),d=l(88957),u=l(39933),c=l(58599),m=l(95580),f=l(26884),p=l(43873),g=l(29362),h=l(73686);let b=new o.hs("convertToGridLayout"),y=()=>new o.k_({key:b,props:{decorations:e=>{let{doc:t}=e,l=[];return t.descendants((e,t,a)=>{"image"===e.type.name&&"cardLayoutItem"===a.type.name&&l.push(h.NZ.node(t,t+e.nodeSize,{},{isTopLevel:!0}))}),h.zF.create(t,l)}}});var v=l(12127),k=l(90406),w=l(47572),x=l(8007),S=l(31085),A=l(80532),C=l(27670),z=l(61778),I=l(82451),j=l.n(I),F=l(14041),B=l(65998),R=l(4977),_=l(93681),M=l(83380),E=l(2696),T=l(61690),O=l(62849),P=l(17539),N=l(57284),D=l(25472),L=l(4381),W=l(49572),U=l(95905),G=l(87643),H=l(95994),V=l(17835),q=l(27930),K=l(57569),J=l(76304),$=l(69069),Q=l(56436),Y=l(78807),X=l(2861),Z=l(63552),ee=l(25420),et=l(52177),el=l(12327),ea=l(71096),en=l(64130),eo=l(63822),ei=l(19534),er=l(87071),es=l(89565),ed=l(12443),eu=l(20501),ec=l(15355),em=l(802),ef=l(31948);let ep=e=>{let{editor:t,node:l,getPos:a}=e,{resize:n,fullWidthBlock:o,id:i,clickBehavior:r}=l.attrs,{startRemoveBg:s,isRemovingBg:d}=(0,em.D9)({editor:t,id:i}),u=(0,k.gk)(r),{startCrop:c}=(0,Y.E)(t),m=(0,F.useCallback)(()=>{t.commands.selectNodeAtPos(a()),d&&x.R.emit("cancelRemoveBg",{id:i}),t.chain().deleteSelectionAndSelectNear().run()},[t,i,d,a]),f=(0,M.f)(),p=(0,F.useCallback)(e=>{t.commands.updateAttributes(eC.name,{clickBehavior:e})},[t]);return{contextMenuItems:[{key:"cut",label:(0,S.jsx)(et.x6,{id:"cCd8Bs"}),icon:eu.XGd,onClick:()=>{let e=a();t.commands.basicCut({from:e,to:e+l.nodeSize})}},{key:"copy",label:(0,S.jsx)(et.x6,{id:"he3ygx"}),icon:eu.jPR,onClick:()=>{let e=a();t.commands.copy({from:e,to:e+l.nodeSize})}},{key:"download-image",label:(0,S.jsx)(et.x6,{id:"mzI/c+"}),icon:eu.cbP,onClick:()=>{(0,ef.lE)(l.attrs.src)}},{key:"divider",divider:!0},{key:"crop",label:(0,S.jsx)(et.x6,{id:"qKx+US"}),icon:eu.K1P,onClick:()=>{t.commands.selectNodeAtPos(a()),c({id:i,clipType:null==n?void 0:n.clipType})}},{key:"remove-background",label:d?(0,S.jsx)(et.x6,{id:"RdqLb7"}):(0,S.jsx)(et.x6,{id:"ylbfBl"}),icon:d?eu.z1G:eu.sAw,rightIcon:d?void 0:(0,S.jsx)(ec.G,{type:"removeBackground",ms:2,color:"gray.400"}),disabled:d,onClick:s},{key:"edit-image",label:(0,S.jsx)(et.x6,{id:"9IrgTy"}),icon:eu.MT7,onClick:()=>{t.view.focus(),f({isOpen:!0})}},...(0,ef.bT)(l)?[{key:"reset-formatting",label:(0,S.jsx)(et.x6,{id:"5eaf8Z"}),icon:eu.U23,onClick:()=>(0,ef.LQ)(t)}]:[],{key:"divider",divider:!0},{key:"add-comment",label:(0,S.jsx)(et.x6,{id:"oFsfkI"}),icon:eu.DN2,onClick:()=>{t.commands.selectNodeAtPos(a()),(0,V.wG)(t.state.selection)}},{key:"divider",divider:!0},{key:"align",label:(0,S.jsx)(et.x6,{id:"9ms+e0"}),icon:eu.ecg,disabled:o,items:U.gj.map(e=>{let{name:l,key:a,icon:i,checkActive:r,apply:s}=e;return{key:a,icon:r&&r(t)?eu.e68:i,label:l(),onClick:()=>{s&&s(t),o&&t.commands.updateAttributes(eC.name,{fullWidthBlock:!1,resize:{...n,width:null}})}}})},{key:"click-action",label:(0,S.jsx)(et.x6,{id:"PWv7TI"}),icon:eu.ii0,items:[{key:"do-nothing",icon:"none"===u?eu.e68:void 0,label:(0,S.jsx)(et.x6,{id:"gIjBW2"}),onClick:()=>p("none")},{key:"expand",icon:"expand"===u?eu.e68:void 0,label:(0,S.jsx)(et.x6,{id:"1A3EXy"}),onClick:()=>p("expand")},{key:"new-tab",icon:"newTab"===u?eu.e68:void 0,label:(0,S.jsx)(et.x6,{id:"Alx2/L"}),onClick:()=>p("newTab")}]},{key:"divider",divider:!0},{key:"delete",label:(0,S.jsx)(et.x6,{id:"cnGeoo"}),icon:eu.yLS,onClick:m,color:"red.500"}]}},eg=e=>e.some(e=>e.spec.isTopLevel),eh=(e,t)=>eg((0,ei.j5)(e,t)),eb=e=>{let{node:t}=e;return(0,a.BQ)(e)&&(null==t?void 0:t.type.name)==="image"},ey=e=>{let{editor:t,event:l}=e,a=t.view,{selection:n}=a.state;if(!(n instanceof o.nh)||!t.isEditable)return!1;let{node:i}=n,r=n.from,s=n.to;if(!eb(n))return!1;let d=l.target,u=d.getAttribute("data-media-add-text"),c=eh(t,r);if(!u||!c)return!1;let m=(0,ed.eq)({view:a,from:r,to:s,node:i}),f=(0,ed.Sm)({horizontalAlign:m,eventTarget:d,node:i,editor:t}),p=(0,ed.Cn)({eventTarget:d,horizontalAlign:m,nodeSize:i.nodeSize,editor:t}),g=(0,ed.I4)({horizontalAlign:m,prevPos:r});return t.chain().insertContentAt({from:r,to:s},f,{updateSelection:!1}).setMeta("annotationEvent",{type:"move",insertPos:g,insertPosRaw:g,pos:r,end:s}).focusMapped(r,p).run(),!1},ev=(0,Z.R)((e,t)=>{let{children:l,resizeableSx:a,alignStyles:n,horizontalAlign:o,decorations:i,editor:r,node:s,isDark:u,isResizing:c,getPos:m}=e,f=eg(i),{onOpenContextMenu:p,onCloseContextMenu:g,menuProps:h}=(0,eo.$)({editor:r,getPos:m}),{contextMenuItems:b}=ep({editor:r,node:s,getPos:m}),y=(0,d.GV)(T.Cl),v=y&&f&&("right"===o||"center"===o),k=y&&f&&(!o||"left"===o||"center"===o),[w,x]=(0,F.useState)({side:null,id:null});return(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(ee.s,{dir:(0,U.fZ)(i,o),"data-media-node-wrapper":!0,"data-testid":"image-node-wrapper",onContextMenu:p,ref:t,h:"100%",w:"100%",direction:v||k?"row":"column",className:er.S,sx:{...a},onClick:e=>{ey({editor:r,event:e})},css:{...n,...v||k?{alignItems:"stretch"}:{}},onDragOver:e=>{if(e.preventDefault(),!w){var t;let l=(0,es.Vk)(r.view,e,null===(t=r.view.dragging)||void 0===t?void 0:t.slice),a=(0,es.rj)(e.target,r.view),n=null==l?void 0:l.node.attrs.id;l&&a&&n&&(x({side:a,id:n}),setTimeout(()=>{x(null)},5e3))}},onDragEnd:e=>{e.preventDefault(),w&&x(null)},onDragLeave:e=>{e.preventDefault(),x(null)},children:[v&&(0,S.jsx)(A.az,{"data-media-add-side":"left",flex:"1",pos:"relative",css:{containerType:"size"},children:(null==w?void 0:w.side)==="left"&&(null==w?void 0:w.id)===s.attrs.id?(0,S.jsx)(ew,{me:4}):(0,S.jsx)(ek,{side:"left",me:4,isDark:u,isResizing:c})}),l,k&&(0,S.jsx)(A.az,{"data-media-add-side":"right",flex:"1",pos:"relative",css:{containerType:"size"},children:(null==w?void 0:w.side)==="right"&&(null==w?void 0:w.id)===s.attrs.id?(0,S.jsx)(ew,{ms:4}):(0,S.jsx)(ek,{side:"right",ms:4,isDark:u,isResizing:c})})]}),(0,S.jsx)(ea.t,{menuItems:b,isOpen:h.isOpen,position:h.position,onClose:g,size:"small"})]})}),ek=e=>{let{side:t,isDark:l,isResizing:a,...n}=e,o=(0,en.fW)();return(0,S.jsx)(A.az,{p:2,flex:"1",borderRadius:"lg","data-media-add-text":!0,opacity:0,height:"100%",transitionProperty:"common",transitionDuration:"normal",...n,cursor:"text",css:{"@container (width < 150px)":{display:"none"},"&:after":{position:"absolute",top:0,..."left"===t?{right:"var(--chakra-space-4)"}:{left:"var(--chakra-space-4)"},backgroundColor:l?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.1)",color:l?"var(--chakra-colors-whiteAlpha-700)":"var(--chakra-colors-gray-600)",zIndex:1,borderRadius:"var(--chakra-radii-lg)",content:'"'.concat(el.Ru._({id:"HpUrSQ"}),'"'),textAlign:o?"right":"left",fontSize:"var(--chakra-fontSizes-sm)",padding:"var(--chakra-space-2)",width:"calc(100% - var(--chakra-space-4) - var(--chakra-space-2) - var(--chakra-space-2))",height:"calc(100% - var(--chakra-space-2) - var(--chakra-space-2))"},"&:hover":{opacity:a?0:1}}})},ew=e=>(0,S.jsx)(A.az,{p:2,flex:"1",height:"100%",borderRadius:"lg",transitionProperty:"common",transitionDuration:"normal",background:"var(--chakra-ring-color)",color:"var(--chakra-colors-whiteAlpha-900)",display:"flex",alignItems:"center",justifyContent:"center",...e,children:(0,S.jsx)(z.E,{fontSize:"sm",fontWeight:"medium",children:(0,S.jsx)(et.x6,{id:"Wv5uRs"})})});var ex=l(12253);let eS=e=>{let{...t}=e,l=(0,d.jL)(),{node:a,editor:n,updateAttributes:o,selected:i,decorations:r,getPos:s}=t,{src:u,tempUrl:c,uploadStatus:m,meta:f,showPlaceholder:p,horizontalAlign:g,resize:h,id:b,href:y,clickBehavior:v,source:C}=a.attrs,z=(null==h?void 0:h.width)||(null==f?void 0:f.width),I=(0,k.XJ)(u||c),Z=(0,P.y9)(u||c)||(null==f?void 0:f.frame_count)&&f.frame_count>1,{isFullWidth:ee}=(0,D.D)(r),et=(0,U.yp)(ee?"center":g);(0,E.FX)();let el=(0,V.NZ)(t),ea=(0,V.ni)(t),en=(0,V.Im)(t),eo=(0,G.DM)(r),ei=(0,d.GV)(T.nD),er=(0,W.Q)(n),{cardColor:es,bodyColor:ed,isDark:eu}=(0,L.a)(t.decorations),ec=m===R.A.Uploading,ef=ei?"expand":(0,k.gk)(v),ep="newTab"===ef&&!!y,eg=(0,d.GV)(B.Gm),{isZoomed:eh,enterZoom:eb,exitZoom:ey}=(0,J.RL)(b),{width:ek,height:ew,aspectRatio:eS,containerWrapperRef:eC,imageRef:ez,setSize:eI}=(0,X.j)();(0,F.useEffect)(()=>x.R.on("startCrop",e=>{let{id:t}=e;b===t&&(eI(),requestAnimationFrame(()=>{var e,t;null===(e=(t=n.commands).refreshBubbleMenu)||void 0===e||e.call(t)}))}),[b,eI,n]);let ej=(0,F.useCallback)(e=>{o(j()({},a.attrs,e,{meta:{has_transparency:!0}}))},[o,a.attrs]),{bgRemovalInProgress:eF,removeBgUrl:eB}=(0,em._A)({editor:n,id:a.attrs.id,src:a.attrs.src,updateAttributes:ej}),{ref:eR,isResizing:e_,setIsResizing:eM,resizeableSx:eE}=(0,K.Y3)(n),eT=eR.current&&eo&&!el&&!er,eO=eR.current&&!el&&!er,eP=(0,F.useCallback)((e,t)=>{o({...a.attrs,fullWidthBlock:void 0===t?a.attrs.fullWidthBlock:t,resize:{...a.attrs.resize,...e}})},[a.attrs,o]),eN=(0,O.jm)(),eD=(0,d.GV)((0,ex.iZ)(b)),{confirmCrop:eL}=(0,Y.E)(n);(0,O.Vg)(()=>{if(eD&&!i&&eL({id:b}),!i){var e,t;eM(!1),null===(e=(t=n.commands).forceHideBubbleMenu)||void 0===e||e.call(t,!1)}},[n,l,i,eD,b,eL,eM],[i]);let eW=!eD&&!e_&&!el&&!n.isThumbnail,eU=!n.isThumbnail&&"expand"===ef,eG=(0,F.useCallback)(()=>{eD||e_||eb()},[eb,eD,e_]),eH=(0,M.f)(),eV=(0,F.useMemo)(()=>{if(!el&&ei)return()=>{eH({isOpen:!0})}},[el,ei,eH]),eq=(0,F.useCallback)(()=>{if(i){var e,t;null===(e=(t=n.commands).refreshBubbleMenu)||void 0===e||e.call(t)}},[i,n]),eK=eB?{...a.attrs,src:eB,tempUrl:a.attrs.src}:a.attrs,eJ=en?{height:(0,V.w5)((0,V.IG)(t),(0,V.yL)(t)),padding:"".concat((0,V.yL)(t)/2,"em ").concat((0,V.yL)(t),"em")}:{};return(0,S.jsxs)(N.u,{...t,as:"div",className:ei||"none"!==ef?void 0:w.T,style:{height:el?"100%":void 0},children:[(p||!u&&!c)&&(0,S.jsx)(q.VM,{...t}),!p&&(u||c)&&(0,S.jsxs)(ev,{ref:eC,resizeableSx:eE,alignStyles:et,horizontalAlign:g,editor:n,decorations:r,node:a,isDark:eu,isResizing:e_,getPos:s,children:[eO&&eD&&(0,S.jsx)($.Ft,{imageWrapperRef:eR,updateResizeAttrs:eP,refreshDeps:[eN],currentWidth:ek,currentHeight:ew,clipPath:null==h?void 0:h.clipPath,clipAspectRatio:null==h?void 0:h.clipAspectRatio,onFinishCrop:()=>{requestAnimationFrame(()=>{var e,t;null===(e=(t=n.commands).refreshBubbleMenu)||void 0===e||e.call(t)})}}),eT&&!eD&&i&&!ee&&(0,S.jsx)(K.u4,{imageWrapperRef:eR,setIsResizing:eM,updateResizeAttrs:eP,refreshDeps:[a.attrs,eN]}),(0,S.jsxs)(A.az,{ref:eR,css:{mask:eD?"":"none !important","--media-maxH":!ec||e_||(null==h?void 0:h.width)||el?void 0:"".concat(100*H.Mg,"vh")},sx:_.z,"data-drag-handle":!0,"data-image-node-element":!0,"data-selection-ring":"inside","data-selection-background":!0,"data-node-image-testid":b,w:el?"100%":ee?"calc(100% * var(--media-scale))":z?"calc(".concat(z," * var(--font-size) / 16)"):"fit-content",maxW:el?"100%":"calc(100% * var(--media-scale))",position:"relative",overflow:"hidden",...el?{h:ea?"100%":void 0,display:"flex",justifyContent:"center",alignContent:"center"}:{},children:[eU&&(0,S.jsx)(J.Kc,{enterZoom:eG,doubleClickNonZoomHandler:eV}),eg&&(0,S.jsx)(eA,{imageAttrs:eK}),(0,S.jsx)(Q.F,{containerWidth:ek,intrinsicAspectRatio:eS||void 0,isCroppingThisImage:eD,imageAttrs:eK,onLoad:eq,linkHref:ep?y||"":void 0,filter:"image.icon"===C?"url(#theme-body-color-fill)":void 0,ref:ez,width:el?"auto":z||e_||ee||I?"100%":null==f?void 0:f.width,minW:el?"100%":void 0,objectFit:el?"cover":"contain",isThumbnail:el||n.isThumbnail,flex:ea?1:void 0,containerProps:{display:ea?"flex":"block"},shouldUseImgProxyCrop:ea&&!Z&&!I,bodyColor:ed,...eJ}),eW&&(0,S.jsx)(J.Gx,{isZoomed:eh,exitZoom:ey,editor:n,children:(0,S.jsx)(Q.F,{imageAttrs:a.attrs,backgroundColor:es,bodyColor:ed,w:I?"80vw":void 0,isZoomed:!0})}),(ec||eF)&&ei&&(0,S.jsx)(q.Td,{removeBackground:eF}),m==R.A.Error&&(0,S.jsx)(q.Hy,{})]})]})]})},eA=e=>{let{imageAttrs:t}=e;return(0,S.jsxs)(A.az,{position:"absolute",as:"span",maxW:"95%",zIndex:1,bottom:0,m:1,children:[(0,S.jsx)(C.E,{maxW:"100%",colorScheme:"green",m:0,children:(0,S.jsxs)(z.E,{isTruncated:!0,whiteSpace:"nowrap",textOverflow:"ellipsis",fontSize:"10px",maxW:"100%",children:["url: ",t.src]})}),(0,S.jsx)(C.E,{maxW:"100%",colorScheme:"yellow",children:(0,S.jsxs)(z.E,{isTruncated:!0,whiteSpace:"nowrap",textOverflow:"ellipsis",fontSize:"10px",maxW:"100%",children:["tempUrl: ",t.tempUrl]})})]})},eC=n.Ay.extend({selectable:!0,draggable:!0,group:"block media",priority:p.y.Image,expandable:!0,addOptions(){var e;return{...null===(e=this.parent)||void 0===e?void 0:e.call(this),placeholders:{}}},addStorage:f.xu,addNodeView:()=>(0,c.gu)(eS,{update:g.z0}),extendNodeSchema(e){var t;return{accessoryImageKey:(0,a.gk)((0,a.iI)(e,"accessoryImageKey",e)),imageKeyPath:null!==(t=(0,a.gk)((0,a.iI)(e,"imageKeyPath",e)))&&void 0!==t?t:""}},parseHTML(){return[{tag:"img[src], img[tempUrl]"},{tag:"img[bookmark]",getAttrs:(0,f.Ll)(this.storage)},{tag:"img[".concat(i.A,"]"),getAttrs:r.D},{tag:"div[class=card-accent-layout-item]",context:"cardLayoutItem//",getAttrs:e=>{try{let t=JSON.parse(e.getAttribute("data-background")||"{}");if("image"!==t.type||!t.image)return!1;let l={...t.image,source:t.source};return(0,k.Ez)(l)}catch(t){return console.error("[Image] Error parsing accent image background",e,t),!1}}}]},renderHTML(e){let{HTMLAttributes:t}=e;return["img",(0,a.KV)(this.options.HTMLAttributes,t,{loading:"lazy"})]},renderHTMLforAI(e){let{node:t}=e;return["img",{bookmark:(0,f.vL)(this.storage,t),alt:(0,s.ve)(t.attrs)}]},addAttributes:()=>({id:(0,u.e)(v.z),savedMediaId:{},src:{},tempUrl:{},uploadStatus:{},meta:{...(0,m.tb)("meta")},providerMeta:{...(0,m.tb)("providerMeta")},aiParams:{...(0,m.tb)("aiParams")},loadImageParams:{...(0,m.tb)("loadImageParams")},loadImageStatus:{},loadImageId:{},name:{},query:{},source:{},showPlaceholder:{},fullWidthBlock:{default:!1},resize:{...(0,m.tb)("resize"),default:w.P},clickBehavior:{default:null},href:{default:null}}),addKeyboardShortcuts:()=>({Enter:e=>{let{editor:t}=e,l=t.state.selection;if(l instanceof o.nh&&l.node.type.name===n.Ay.name){let e=(0,ex.Hu)((0,d.KA)().getState()),{id:t}=l.node.attrs;if(e)return x.R.emit("endClip",{id:t,confirm:!0}),!0}return!1}}),addProseMirrorPlugins:()=>[new o.k_({key:new o.hs("imageDrag"),props:{handleDOMEvents:{dragstart:(e,t)=>{var l;let{selection:n}=e.state,o=(0,a.BQ)(n)&&(null===(l=n.node)||void 0===l?void 0:l.type.name)==="image"?n.node.attrs.id:null;if(o){let e=(0,d.KA)().getState();if((0,ex.iZ)(o)(e))return t.preventDefault(),!0}return!1}}}}),y()],addCommands(){let e=this.name,t=t=>{let{selection:l}=t;return l instanceof o.nh&&l.node.type.name===e?l.node:void 0};return{resetImageClip:()=>l=>{let{chain:a,state:n}=l,o=t(n);if(!o)return console.warn("[resetImageClip] Selected node is not an image: ",n.selection),!0;let{clipPath:i,clipType:r,clipAspectRatio:s}=w.P;return a().updateAttributes(e,{resize:{...o.attrs.resize,clipPath:i,clipType:r,clipAspectRatio:s}}).run()},resetImageScale:()=>l=>{let{chain:a,state:n}=l,o=t(n);return o?a().updateAttributes(e,{resize:{...o.attrs.resize,width:null,isAuto:null}}).run():(console.warn("[resetImageClip] Selected node is not an image: ",n.selection),!0)}}}});l(77854),l(217)},12253:(e,t,l)=>{"use strict";l.d(t,{$k:()=>g,AL:()=>w,BS:()=>f,CU:()=>y,F8:()=>i,Ff:()=>x,GP:()=>m,Hu:()=>h,N2:()=>p,No:()=>v,Vr:()=>k,WE:()=>c,Zu:()=>s,iZ:()=>b,sI:()=>d,uy:()=>r,zs:()=>u});var a=l(8796);let n={clipType:"inset",isCropping:!1,croppingImageId:null,changeFocalPointImageId:null,removeBg:{}},o=(0,a.Z0)({name:"ImageEditor",initialState:n,reducers:{reset:()=>n,setClipType(e,t){let{clipType:l}=t.payload;e.clipType=l},startCropping(e,t){let{id:l,clipType:a}=t.payload;e.croppingImageId=l,e.clipType=a||"inset"},endCropping(e){e.croppingImageId=null},startChangeFocalPoint(e,t){let{id:l}=t.payload;e.changeFocalPointImageId=l},endChangeFocalPoint(e){e.changeFocalPointImageId=null},startRemoveBg(e,t){let{id:l}=t.payload;e.removeBg[l]={status:"loading",url:null}},setRemoveBgStatus(e,t){let{id:l,status:a}=t.payload;e.removeBg[l]&&(e.removeBg[l].status=a)},setRemoveBgUrl(e,t){let{id:l,url:a}=t.payload;e.removeBg[l]&&(e.removeBg[l].url=a)},endRemoveBg(e,t){let{id:l}=t.payload;delete e.removeBg[l]}}}),{setClipType:i,endCropping:r,startCropping:s,startChangeFocalPoint:d,endChangeFocalPoint:u,startRemoveBg:c,setRemoveBgStatus:m,setRemoveBgUrl:f,endRemoveBg:p}=o.actions,g=e=>e.ImageEditor.clipType,h=e=>!!e.ImageEditor.croppingImageId,b=e=>t=>t.ImageEditor.croppingImageId===e,y=e=>t=>t.ImageEditor.changeFocalPointImageId===e,v=e=>t=>!!t.ImageEditor.removeBg[e],k=e=>t=>{var l;return null===(l=t.ImageEditor.removeBg[e])||void 0===l?void 0:l.url},w=e=>t=>{var l;return null===(l=t.ImageEditor.removeBg[e])||void 0===l?void 0:l.status},x=o.reducer},802:(e,t,l)=>{"use strict";l.d(t,{D9:()=>h,_A:()=>b,wd:()=>y});var a=l(32202),n=l(12327),o=l(14041),i=l(73893),r=l(71197),s=l(19717),d=l(88957),u=l(10458),c=l(45776),m=l(61690),f=l(60490),p=l(17539),g=l(12253);let h=e=>{let{editor:t,id:l}=e,a=(0,d.jL)(),n=(0,d.GV)((0,g.No)(l)),i=(0,d.GV)((0,g.AL)(l)),s=(0,o.useCallback)(()=>{a((0,c.WE)({id:l})),c.RR.emit("startRemoveBg",{id:l}),requestAnimationFrame(()=>{var e,l;null===(e=(l=t.commands).refreshBubbleMenu)||void 0===e||e.call(l)})},[a,t,l]);return{startRemoveBg:(0,r.tO)(s,"removeBackground",u.VV.GAMMA_PRO_UPSELL_REMOVE_BACKGROUND),isRemovingBg:n,isRemoveBgLoading:"loading"===i}},b=e=>{let{editor:t,id:l,src:i,updateAttributes:r}=e,u=(0,d.jL)(),h=(0,d.CU)(),b=(0,a.d)(),v=(0,d.GV)(m.sK),k=t.isEditable,w=(0,d.GV)((0,g.AL)(l)),x=(0,d.GV)((0,g.Vr)(l));return(0,o.useEffect)(()=>{if(!k||!i)return;let e=new AbortController,a="User aborted",o=async o=>{var r,d,m;let{id:g}=o,h=null===(r=(0,f.bs)(null==v?void 0:v.id))||void 0===r?void 0:r.id;if(l===g&&i&&h)try{u((0,c.GP)({id:l,status:"loading"}));let t=await y({imageUrl:i,workspaceId:h,abortController:e});u((0,c.BS)({id:l,url:t})),(0,s.R)("removeBackground",v),await (0,p.GV)(t),setTimeout(()=>{requestAnimationFrame(()=>{c.RR.emit("endRemoveBg",{id:l,url:t})})},500)}catch(i){if(i===a)return;let e="AbortError"===i.name,o=(null===(d=i.cause)||void 0===d?void 0:d.statusCode)&&(null===(m=i.cause)||void 0===m?void 0:m.statusCode)<500;b({title:n.Ru._({id:"xwVKp4"}),position:"top",description:e?n.Ru._({id:"sSkbaZ"}):o?i.message:n.Ru._({id:"2ePs/6"}),status:"error",duration:5e3,isClosable:!0}),u((0,c.N2)({id:l})),requestAnimationFrame(()=>{var e,l;null===(e=(l=t.commands).refreshBubbleMenu)||void 0===e||e.call(l)})}},r=t=>{let{id:l}=t;u((0,c.N2)({id:l})),e.abort(a)};return c.RR.on("startRemoveBg",o),c.RR.on("cancelRemoveBg",r),()=>{c.RR.off("startRemoveBg",o),c.RR.off("cancelRemoveBg",r)}},[l,t,i,r,u,h,k,v,b]),(0,o.useEffect)(()=>{if(k&&i)return c.RR.on("endRemoveBg",async e=>{let{id:a,url:n}=e;l===a&&(r({src:n||(0,g.Vr)(l)(h.getState()),source:"image.custom"}),requestAnimationFrame(()=>{u((0,c.N2)({id:l})),requestAnimationFrame(()=>{var e,l;null===(e=(l=t.commands).refreshBubbleMenu)||void 0===e||e.call(l)})}))})},[l,r,t,u,h,k,i]),{bgRemovalInProgress:"loading"===w,removeBgUrl:x}},y=async e=>{let{imageUrl:t,workspaceId:l,abortController:a}=e,n="".concat(i.$.API_HOST,"/media/images/edit"),o=a||new AbortController,r=setTimeout(()=>o.abort(),3e4),s=await fetch(n,{method:"POST",signal:o.signal,headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({url:t,operation:"remove-background",workspaceId:l})});if(clearTimeout(r),!s.ok){let e=await s.json();throw e.statusCode=s.status,Error(e.message,{cause:e})}return(await s.json()).url}},31948:(e,t,l)=>{"use strict";l.d(t,{LQ:()=>s,bT:()=>r,lE:()=>d});var a=l(46343),n=l.n(a),o=l(73893),i=l(47572);let r=e=>{let{resize:t}=e.attrs,{height:l,width:a}=t;return!n()({resize:t},{resize:i.P})||null!==l&&null!==a},s=e=>{e.chain().resetImageClip().resetImageScale().command(e=>{var t;let{commands:l}=e;return!!(null===(t=l.refreshBubbleMenu)||void 0===t?void 0:t.call(l))}).run()},d=async e=>{try{let t=e.split("/").pop();if(!t)throw Error("No filename found");let l=await fetch("".concat(o.$.API_HOST||"","/media/images/download"),{method:"POST",credentials:"include",headers:{"Content-Type":"application/json","share-token":o.$.SHARE_TOKEN||""},body:JSON.stringify({url:e,filename:t})});if(!l.ok)throw Error("Download failed");let a=await l.blob(),n=window.URL.createObjectURL(a),i=document.createElement("a");i.href=n,i.download=t,document.body.appendChild(i),i.click(),document.body.removeChild(i),window.URL.revokeObjectURL(n)}catch(e){console.error("Error downloading image:",e)}}},62216:(e,t,l)=>{"use strict";l.d(t,{ez:()=>nw,jU:()=>nv,Fn:()=>nk,dO:()=>nb,K4:()=>nx});var a=l(31085),n=l(12917),o=l(12327),i=l(74327),r=l(95372),s=l(2600),d=l(90290),u=l(69648),c=l(39761),m=l(62313),f=l(61778),p=l(80532),g=l(60353),h=l(14892),b=l(84755),y=l(2219),v=l(37586),k=l(58821),w=l(80853),x=l(20501),S=l(24221),A=l(52177),C=l(14041),z=l(55576),I=l(87064),j=l(77914),F=l(79574),B=l(15355),R=l(71197),_=l(65998),M=l(49547),E=l(63341),T=l(18528),O=l(25420),P=l(72821),N=l(48310),D=l(33473),L=l(20221);let W={square:x.Nfw,portrait:x.b0A,landscape:x.Cpz},U={square:()=>o.Ru._({id:"1DA6ap"}),portrait:()=>o.Ru._({id:"3bV9gD"}),landscape:()=>o.Ru._({id:"XxIeKn"})},G=(0,C.memo)(e=>{let{value:t,setValue:l,isDisabled:n,model:o}=e,i=(0,L.pH)(o);return(0,a.jsx)(M.MJ,{children:(0,a.jsxs)(E.W,{isLazy:!0,children:[(0,a.jsx)(T.I,{as:w.$,variant:"plain",isDisabled:n,w:"100%",textAlign:"start",justifyContent:"space-between",rightIcon:(0,a.jsx)(S.g,{icon:x.Jt$}),boxShadow:"none",size:"sm",children:(0,a.jsxs)(m.z,{spacing:2,children:[(0,a.jsx)(O.s,{width:"24px",height:"24px",align:"center",justify:"center",children:(0,a.jsx)(S.g,{icon:W[t],fixedWidth:!0})}),(0,a.jsx)(f.E,{as:"span",flex:1,children:U[t]()})]})}),(0,a.jsx)(P.c,{minWidth:"240px",maxH:"290px",overflowY:"auto",overflowX:"hidden",children:(0,a.jsx)(N.i,{value:t,type:"radio",onChange:e=>{l(e)},children:Object.values(i).map(e=>(0,a.jsx)(D.k,{value:e,children:(0,a.jsxs)(m.z,{spacing:2,children:[(0,a.jsx)(O.s,{width:"24px",height:"24px",align:"center",justify:"center",children:(0,a.jsx)(S.g,{icon:W[e],fixedWidth:!0})}),(0,a.jsx)(f.E,{as:"span",flex:1,children:U[e]()})]})},e))})})]})})});G.displayName="AspectRatioSelect";var H=l(81570),V=l(63587),q=l(87116),K=l(81768),J=l(55640);new K.F({systemPromptOperation:J.mc.GenerateImagePromptSystem,userPromptOperation:J.mc.GenerateImagePromptUser,variables:["input","html"],params:{temperature:.7,maxTokens:50}});var $=l(68572),Q=l(88957),Y=l(32262),X=l(61690),Z=l(95580),ee=l(19534),et=l(60490),el=l(86724),ea=l(27042);let en=e=>{var t,l;let a=(0,et.gx)(),n=(0,Q.GV)(X.Jo),o=null==n?void 0:null===(t=n.organization)||void 0===t?void 0:t.id,i=null===(l=(0,et.bs)(o))||void 0===l?void 0:l.id,r=(0,Q.GV)((0,ea.A1)(null!=o?o:""));return e!==j.rWX.Dashboard&&r?i:a},eo=e=>{var t;let{docId:l,themeId:a,interactionId:n,scope:o="legacy",count:i=18,savedMediaContext:r}=e,{data:s,loading:d,fetchMore:u}=ei({scope:o,docId:l,themeId:a,interactionId:n,count:i,savedMediaContext:r}),c=(0,C.useMemo)(()=>{switch(o){case"user":return"userSavedMedia";case"doc":return"workspaceSavedMedia";default:return"savedMedia"}},[o]),m=(0,C.useMemo)(()=>{var e;return((null==s?void 0:null===(e=s[c])||void 0===e?void 0:e.edges)||[]).map(e=>e.node)},[s,c]),f=null==s?void 0:null===(t=s[c])||void 0===t?void 0:t.pageInfo,[p,g]=(0,C.useState)(!1),h=(0,C.useCallback)(async()=>{if((null==f?void 0:f.hasNextPage)&&(null==f?void 0:f.endCursor)){g(!0);try{await u({variables:{after:f.endCursor},updateQuery:(e,t)=>{var l,a;let{fetchMoreResult:n}=t;if(!n)return e;let o=(null===(l=n[c])||void 0===l?void 0:l.edges)||[],i=[...(null===(a=e[c])||void 0===a?void 0:a.edges)||[],...o];return{...e,[c]:{...n[c],edges:i}}}})}catch(e){console.error("Error loading more images:",e)}finally{g(!1)}}},[u,f,c]),[b,y]=(0,C.useState)(null),[v,k]=(0,C.useState)(!1),[w]=(0,j.GQw)(),x=(0,C.useCallback)(async e=>{y(e),k(!0);try{await w({variables:{id:e},update:t=>{t.evict({id:t.identify({id:e,__typename:"SavedMedia"})}),t.gc()},refetchQueries:["GetSavedMedia","GetUserSavedMedia","GetWorkspaceSavedMedia"]})}catch(e){console.error("Error deleting image:",e)}finally{y(null),k(!1)}},[w]);return{history:m,loadMore:h,isLoadingMore:p,canLoadMore:!!(null==f?void 0:f.hasNextPage),isLoading:d,deleteImage:x,deletingId:b,isDeleting:v}},ei=e=>{let{scope:t,interactionId:l,docId:a,themeId:n,count:o=18,savedMediaContext:i}=e,r={workspaceId:en(i),types:[j.zut.Image],source:"image.ai-generated",first:o,...l?{interactionId:l}:{}},s={type:j.zut.Image,source:"image.ai-generated",first:o},d={...a?{docId:a}:{},...n?{themeId:n}:{}},u=(0,j.abJ)({variables:{...r},fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",skip:"user"!==t}),c=(0,j.Gc5)({variables:{...r,...d},fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",skip:"doc"!==t}),m=(0,j.N3Q)({variables:{...s,...d},fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",skip:"legacy"!==t});return"user"===t?u:"doc"===t?c:m},er=e=>{var t,l;if(!(e instanceof H.nh))return null;if("smartLayoutCell"===e.node.type.name&&(null===(t=e.node.textContent)||void 0===t?void 0:t.length)>=5)return e.node.content;let a=e.$from;for(;a.depth>0;){let e=a.node(a.depth);if("smartLayoutCell"===e.type.name&&(null===(l=e.textContent)||void 0===l?void 0:l.length)>=5)return e.content;a=a.doc.resolve(a.before(a.depth))}return null},es=e=>(0,C.useCallback)(()=>{if(!e)return null;let{selection:t}=e.state,l=(0,Z.IV)(t.$from,ee.jg)[0],a=l&&(0,Y.Ub)(l.node,l.pos),{content:n}=e.state.doc.slice(a.pos+1,a.pos+a.node.nodeSize-1),o=er(t);return o?(0,V.K)(e,o):(0,V.K)(e,n)},[e]),ed=e=>{let{editor:t,prompt:l,stylePrompt:a,addPrompt:n}=e,o=(0,Q.GV)(X.sK),[i,r]=(0,C.useState)(!1),s=es(t),d=(0,C.useCallback)(()=>{r(!0),n("","push")},[n]),u=(0,C.useCallback)(e=>{n(e,"update")},[n]),c=(0,C.useCallback)(()=>{r(!1)},[]),m=(0,C.useCallback)(e=>{console.error("Error enhancing image",e),r(!1)},[]),{generate:f}=(0,q.pt)("EnhanceAIImage",{onStart:d,onContent:u,onComplete:c,onError:m,timeout:3e4}),p=(0,C.useCallback)(()=>{var e,n;if(i||!(null==o?void 0:o.id))return;let r=null===(e=(0,et.bs)(null==o?void 0:o.id))||void 0===e?void 0:e.id;return f({variables:{currentPrompt:l,stylePrompt:a,cardHtml:(null==t?void 0:t.isSiteNavbarEditor)?void 0:null!==(n=s())&&void 0!==n?n:void 0},workspaceId:r}).promise},[i,null==o?void 0:o.id,f,l,a,null==t?void 0:t.isSiteNavbarEditor,s]);return{isEnhancing:i,setIsEnhancing:r,runEnhanceImagePrompt:p}},eu=e=>e.ind===e.history.length-1,ec=e=>e.history[e.history.length-1],em={load:(e,t)=>({history:[t],ind:0}),push(e,t){return""===ec(e).trim()?this.replace(e,t):{history:[...e.history,t],ind:e.history.length}},replace(e,t){let l=e.history.slice(0,-1);return{history:[...l,t],ind:l.length}},select(e,t){return eu(e)&&ec(e)===t?e:this.push(e,t)}},ef=()=>{let e=(0,C.useRef)(!1),[t,l]=(0,C.useState)({history:[""],ind:0}),a=(0,C.useCallback)((t,a)=>{"load"===a&&l(e=>em.load(e,t)),"push"===a&&l(e=>em.push(e,t)),"update"===a&&(e.current?l(e=>em.push(e,t)):l(e=>em.replace(e,t))),"select"===a&&l(e=>em.select(e,t)),e.current="update"!==a},[]),n=(0,C.useCallback)(()=>{let{ind:e}=t;e<=0||l(e=>({...e,ind:e.ind-1}))},[t]),o=(0,C.useCallback)(()=>{let{history:e,ind:a}=t;a>=e.length-1||l(e=>({...e,ind:e.ind+1}))},[t]),{ind:i,history:r}=t;return{prompt:r[i]||"",addPrompt:a,promptPageInfo:{curr:i+1,total:r.length,canGoNext:i0},nextPrompt:o,prevPrompt:n}},ep=()=>{let[e,t]=(0,el.M)("aiImageRatings",{});return{saveImageRating:(0,C.useCallback)((l,a)=>{l.savedMediaId&&(e[l.savedMediaId]=a,t(e))},[]),hasRatedImage:(0,C.useCallback)(t=>!t.savedMediaId||!!e[t.savedMediaId],[])}},eg=(e,t)=>{let l=(0,Q.GV)(X.sX),a=l&&!e?"doc":"user",n="doc"===a?"workspaceSavedMedia":"userSavedMedia",{data:o,loading:i}=ei({docId:l,interactionId:e,scope:a,count:3});return{savedMedia:(0,C.useMemo)(()=>{var e;return((null==o?void 0:null===(e=o[n])||void 0===e?void 0:e.edges)||[]).map(e=>e.node).filter(e=>{if(t){var l;return(null==e?void 0:null===(l=e.attrs)||void 0===l?void 0:l.query)===t}return!0})},[o,n,t]),isLoading:i}},eh=()=>{let e=(0,Q.GV)(X.Jo),t=(0,$.ez)("ai_models_plus",null==e?void 0:e.organization),l=(0,$.ez)("ai_premium_models",null==e?void 0:e.organization),a=t&&l?"pro":t?"plus":"free";return(0,C.useCallback)(e=>{let t=(0,L.kO)(e);if(!(0,L.CX)(e))return!1;let l=["free","plus","pro"];return l.indexOf(a)>=l.indexOf(t)},[a])},eb=(e,t)=>{let l=(0,C.useRef)(null);return(0,C.useEffect)(()=>{if(!t)return;let a=l.current;if(!a)return;let n=a.querySelector('[data-popover-scroll-id="'.concat(e,'"]'));if(!(n instanceof HTMLElement))return;let o=n.offsetHeight/2,i=a.offsetHeight/2,r=n.offsetTop-i+o;a.scrollTo({top:r,behavior:"instant"})},[t,e]),{scrollContainerRef:l}};var ey=l(17228),ev=l.n(ey),ek=l(57673);let ew=()=>{let e=(0,et.gx)(),t=(0,Q.jL)(),{data:l,loading:a}=(0,j.Snx)({variables:{workspaceId:e,archived:!1},skip:!e,fetchPolicy:"cache-first",nextFetchPolicy:"cache-only"}),{data:n,loading:o}=(0,j.Snx)({variables:{workspaceId:null,archived:!1},fetchPolicy:"cache-first",nextFetchPolicy:"cache-only"}),i=(0,C.useMemo)(()=>(null==n?void 0:n.themes)||[],[null==n?void 0:n.themes]),r=(0,C.useMemo)(()=>(null==l?void 0:l.themes)||[],[null==l?void 0:l.themes]);return(0,C.useEffect)(()=>{i.length>0&&t((0,ek.cA)({globalThemes:i}))},[t,i]),(0,C.useEffect)(()=>{r.length>0&&t((0,ek._N)({workspaceThemes:r}))},[t,r]),{isLoadingThemes:a||o,globalThemes:i}},ex={Default:()=>o.Ru._({id:"46F406"}),Realistic:()=>o.Ru._({id:"uFPBcL"}),Artistic:()=>o.Ru._({id:"tqhB0N"})},eS={None:"None",Anime:"Anime",Digital_Art_Concept_Art:"Digital_Art_Concept_Art",Ethereal_Fantasy_Art:"Ethereal_Fantasy_Art",Photography:"Photography",Analog_film:"Analog_film",Vaporwave:"Vaporwave",Isometric:"Isometric",Low_Poly:"Low_Poly",Claymation:"Claymation",Origami:"Origami",Line_Art:"Line_Art",Pixel_Art:"Pixel_Art",Texture:"Texture",Theme:"Theme",Custom:"Custom"},eA=[{stylePreset:eS.None,name:()=>o.Ru._({id:"iXzipJ"}),imageUrl:"https://cdn.gamma.app/ai-image-assets/default.jpg",icon:x.Dfk,category:ex.Default,stylePrompt:""},{stylePreset:eS.Anime,name:()=>o.Ru._({id:"RulMCV"}),imageUrl:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/anime.c842eccd.jpg",category:ex.Artistic,stylePrompt:"anime artwork. anime style, key visual, vibrant, studio anime, highly detailed"},{stylePreset:eS.Digital_Art_Concept_Art,name:()=>o.Ru._({id:"PADW9l"}),imageUrl:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/digital-art.728c3ff0.jpg",category:ex.Artistic,stylePrompt:"concept art. digital artwork, illustrative, painterly, matte painting, highly detailed"},{stylePreset:eS.Ethereal_Fantasy_Art,name:()=>o.Ru._({id:"C1chBY"}),imageUrl:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/fantasy.86ede605.jpg",category:ex.Artistic,stylePrompt:"ethereal fantasy concept art of. magnificent, celestial, ethereal, painterly, epic, majestic, magical, fantasy art, cover art, dreamy"},{stylePreset:eS.Photography,name:()=>o.Ru._({id:"j1ao1Y"}),imageUrl:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/photography.bce47d9c.jpg",category:ex.Realistic,stylePrompt:"cinematic photo. 35mm photograph, film, bokeh, professional, 4k, highly detailed"},{stylePreset:eS.Analog_film,name:()=>o.Ru._({id:"bK8OnA"}),imageUrl:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/analog-film.105509c1.jpg",category:ex.Realistic,stylePrompt:"analog film photo. faded film, desaturated, 35mm photo, grainy, vignette, vintage, Kodachrome, Lomography, stained, highly detailed, found footage"},{stylePreset:eS.Vaporwave,name:()=>o.Ru._({id:"rPpJGr"}),imageUrl:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/vaporwave.f8a9afd0.jpg",category:ex.Artistic,stylePrompt:"vaporwave synthwave style. cyberpunk, neon, vibes, stunningly beautiful, crisp, detailed, sleek, ultramodern, high contrast, cinematic composition"},{stylePreset:eS.Isometric,name:()=>o.Ru._({id:"rHgk/g"}),imageUrl:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/isometric.86adffe4.jpg",category:ex.Artistic,stylePrompt:"isometric style. vibrant, beautiful, crisp, detailed, ultra detailed, intricate"},{stylePreset:eS.Low_Poly,name:()=>o.Ru._({id:"X3ZAzR"}),imageUrl:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/low-poly.e2805ce4.jpg",category:ex.Artistic,stylePrompt:"low-poly style. ambient occlusion, low-poly game art, polygon mesh, jagged, blocky, wireframe edges, centered composition"},{stylePreset:eS.Claymation,name:()=>o.Ru._({id:"Q61KDs"}),imageUrl:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/claymation.92bfacf1.jpg",category:ex.Artistic,stylePrompt:"claymation style. sculpture, clay art, centered composition, play-doh"},{stylePreset:eS.Origami,name:()=>o.Ru._({id:"MHkaLx"}),imageUrl:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/origami.2586b331.jpg",category:ex.Artistic,stylePrompt:"origami style. paper art, pleated paper, folded, origami art, pleats, cut and fold, centered composition"},{stylePreset:eS.Line_Art,name:()=>o.Ru._({id:"i6SPYf"}),imageUrl:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/line-art.bd2852c5.jpg",category:ex.Artistic,stylePrompt:"line art drawing. professional, sleek, modern, minimalist, graphic, line art, vector graphics"},{stylePreset:eS.Pixel_Art,name:()=>o.Ru._({id:"3a27VZ"}),imageUrl:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/pixel-art.ca70c7b3.jpg",category:ex.Artistic,stylePrompt:"pixel-art. low-res, blocky, pixel art style, 16-bit graphics"},{stylePreset:eS.Texture,name:()=>o.Ru._({id:"MCId55"}),imageUrl:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/texture.6214fde9.jpg",category:ex.Artistic,stylePrompt:"texture. top down close-up, video game"},{stylePreset:eS.Theme,name:()=>o.Ru._({id:"c8dzFk"}),imageUrl:"",icon:x.fyG,category:ex.Default,stylePrompt:""},{stylePreset:eS.Custom,name:()=>o.Ru._({id:"zkWoIW"}),imageUrl:"",icon:x.zLW,category:ex.Default,stylePrompt:""}],eC={square:1,landscape:4/3,portrait:3/4},ez=e=>{var t;let{contextualTheme:l}=e;ew();let a=(0,Q.GV)(ek.ST),n=(0,Q.GV)(X.SJ),o=l||n,i=!!(0,Q.GV)(X.Jo),r=(0,C.useMemo)(()=>Object.values(ex).map(e=>({title:e,presets:eA.filter(t=>t.category===e&&!t.hidden&&(i||t.stylePreset!==eS.Custom))})),[i]),s=(0,C.useCallback)(e=>Object.values(eS).includes(e),[]),d=(0,C.useCallback)(e=>{if(!s(e))return"";if(s(e)){var t;return(null===(t=eA.find(t=>t.stylePreset===e))||void 0===t?void 0:t.stylePrompt)||""}return""},[s]),u=(0,C.useCallback)((e,t)=>{if(!s(e))return"";if(e===eS.Theme){var l;return(null==o?void 0:null===(l=o.config)||void 0===l?void 0:l.stylePrompt)||""}return e===eS.Custom?t:d(e)},[s,d,null==o?void 0:null===(t=o.config)||void 0===t?void 0:t.stylePrompt]),c=(0,C.useCallback)(e=>eA.find(t=>t.stylePreset===e),[]);return{stylePresetOptions:r,getStylePromptFromPreset:u,getThemeNameFromStylePrompt:(0,C.useCallback)(e=>{var t;return(null===(t=a.find(t=>t.config.stylePrompt===e))||void 0===t?void 0:t.name)||""},[a]),getPresetDisplayMetadata:c,getPredefinedStylePrompt:d}};var eI=l(18784),ej=l(952),eF=l(30358);let eB=()=>{var e;let t=(0,_.u)("aiGeneratedImagesDefaultModel"),l=eh(),{user:a,setSettings:n}=(0,eF.ur)(),o=null==a?void 0:null===(e=a.settings)||void 0===e?void 0:e.preferredAiImageModel;return[o&&(0,L.CX)(o)&&l(o)?o:t,(0,C.useCallback)(e=>{null==n||n({set:{preferredAiImageModel:e}})},[n])]},eR=void 0,e_=void 0,eM=e=>{var t,l,a,n,o,i,r,s,d,u,c,m,f;let{contextualTheme:p,lastUsedImageGenerationSettingsInDoc:g,aiParams:h,savedMediaContext:b}=e,[y,v]=eB(),{stylePresetOptions:k,getStylePromptFromPreset:w,getThemeNameFromStylePrompt:x,getPresetDisplayMetadata:S}=ez({contextualTheme:p}),{prompt:A,addPrompt:z,promptPageInfo:I,nextPrompt:j,prevPrompt:F}=ef(),[B,R]=(0,C.useState)(null!==(l=null!==(t=null==h?void 0:h.model)&&void 0!==t?t:null==g?void 0:g.model)&&void 0!==l?l:y),_=(0,C.useCallback)(e=>{R(e),v(e)},[R,v]),[M,E]=(0,C.useState)(null!==(n=null!==(a=null==h?void 0:h.stylePreset)&&void 0!==a?a:null==g?void 0:g.stylePreset)&&void 0!==n?n:eS.None),[T,O]=(0,C.useState)(w(M,null==g?void 0:g.stylePrompt)),[P,N]=(0,C.useState)(null!==(o=null==h?void 0:h.negative_prompt)&&void 0!==o?o:""),[D,L]=(0,C.useState)(null!==(i=null==h?void 0:h.count)&&void 0!==i?i:3),[W,U]=(0,C.useState)(null!==(s=null!==(r=null==h?void 0:h.steps)&&void 0!==r?r:eR)&&void 0!==s?s:0),[G,H]=(0,C.useState)(null!==(u=null!==(d=null==h?void 0:h.cfg_scale)&&void 0!==d?d:e_)&&void 0!==u?u:0),[V,q]=(0,C.useState)(null!==(f=null!==(m=null!==(c=null==h?void 0:h.aspectRatio)&&void 0!==c?c:(null==h?void 0:h.height)&&(null==h?void 0:h.width)?(0,ej.KD)({height:h.height,width:h.width}):void 0)&&void 0!==m?m:null==g?void 0:g.aspectRatio)&&void 0!==f?f:eI.X),K=(0,C.useMemo)(()=>({prompt:A,model:B,stylePreset:M,stylePrompt:T,aspectRatio:V,steps:W?ev()(W,1,100):void 0,count:ev()(D,8),negative_prompt:P,cfg_scale:G?ev()(G,1,200):void 0,context:b}),[A,B,M,T,V,P,D,W,G,b]),J=eh();(0,C.useEffect)(()=>{J(B)||R(y)},[B,y,J]);let $=(0,C.useCallback)((e,t)=>{if(q((0,ej.P6)(e)),!e.aiParams)return;let{prompt:l,stylePreset:a,stylePrompt:n,model:o,negative_prompt:i,count:r,steps:s,cfg_scale:d}=e.aiParams;l&&z(l,t),n&&O(n),a&&E(a),o&&J(o)&&R(o),i&&N(i),r&&L(r),s&&U(s),d&&H(d)},[z,J]),Q=(0,C.useCallback)(e=>{var t;let{aiParams:l}=e,{model:a,stylePrompt:n,stylePreset:o,prompt:i}=null!=l?l:{};q((0,ej.P6)(e)),R(null!==(t=null!=a?a:null==g?void 0:g.model)&&void 0!==t?t:y),O(null!=n?n:""),E(null!=o?o:eS.None),z(null!=i?i:"","load")},[z,R,null==g?void 0:g.model,y]),Y=(0,C.useMemo)(()=>e=>!!e&&!!e.aiParams&&(A!==e.aiParams.prompt||B!==e.aiParams.model||V!==(0,ej.P6)(e)||M!==e.aiParams.stylePreset),[V,B,M,A]);return{model:B,setModel:_,prompt:A,addPrompt:z,promptPageInfo:I,nextPrompt:j,prevPrompt:F,stylePrompt:T,setStylePrompt:O,stylePreset:M,setStylePreset:E,stylePresetOptions:k,getPresetDisplayMetadata:S,getThemeNameFromStylePrompt:x,getStylePromptFromPreset:w,aspectRatio:V,setAspectRatio:q,imageGenerateConfig:K,loadImageAiParams:$,resetImageAiParams:Q,isPromptDirty:Y,negativePrompt:P,setNegativePrompt:N,count:D,setCount:L,steps:W,setSteps:U,cfgScale:G,setCfgScale:H}};var eE=l(9021);let eT=e=>{let{promptPageInfo:t,nextPrompt:l,prevPrompt:n,isDisabled:o,...i}=e;return(0,a.jsxs)(m.z,{spacing:1,...i,children:[(0,a.jsx)(eE.K,{variant:"ghost",icon:(0,a.jsx)(S.g,{icon:x.Wzs}),isDisabled:o||!t.canGoPrev,onClick:()=>n(),"aria-label":"left",color:"gray.800",size:"xs"}),(0,a.jsxs)(p.az,{as:"span",color:"gray.800",fontSize:"sm",children:[t.curr," / ",t.total]}),(0,a.jsx)(eE.K,{variant:"ghost",icon:(0,a.jsx)(S.g,{icon:x.XkK}),color:"gray.800",isDisabled:o||!t.canGoNext,onClick:()=>l(),"aria-label":"left",size:"xs"})]})};var eO=l(33023),eP=l(19098),eN=l(64444),eD=l(18651),eL=l(93185),eW=l(97864),eU=l(15672),eG=l(63633);let eH=(0,C.memo)(e=>{var t;let{stylePreset:l,setStylePreset:n,stylePrompt:o,setStylePrompt:i,presetOptions:r,isDisabled:d,contextualTheme:u,getStylePromptFromPreset:c,getThemeNameFromStylePrompt:f,getPresetDisplayMetadata:g,onKeyDown:h}=e,{isOpen:b,onToggle:v,onClose:k}=(0,eO.j)(),A=(0,C.useMemo)(()=>eA.find(e=>e.stylePreset===l),[l]),[z,I]=(0,C.useState)(A);(0,C.useEffect)(()=>{I(A)},[A]);let j=(0,Q.GV)(X.SJ),F=u||j,B=null==F?void 0:null===(t=F.config)||void 0===t?void 0:t.stylePrompt,R=(0,C.useCallback)(e=>{i(e.target.value),l!==eS.Custom&&(n(eS.Custom),I(eA.find(e=>e.stylePreset===eS.Custom)))},[i,n,l]),_=(0,C.useCallback)(e=>{let t=g(e);t&&(i(c(e)),n(e),I(t),k())},[g,c,k,n,i]),E=(0,C.useMemo)(()=>{if(l===eS.Theme)return f(o)},[f,l,o]),{scrollContainerRef:T}=eb(l||"",b);return(0,a.jsx)(M.MJ,{children:(0,a.jsxs)(O.s,{direction:"column",gap:2,children:[(0,a.jsxs)(eP.A,{placement:"bottom-start",matchWidth:!0,isOpen:b,onClose:k,closeOnBlur:!0,isLazy:!0,children:[(0,a.jsx)(eN.W,{children:(0,a.jsx)(w.$,{width:"100%",type:"button",boxShadow:"none",onClick:v,rightIcon:(0,a.jsx)(S.g,{icon:x.Jt$}),isDisabled:d,justifyContent:"space-between",size:"sm",children:(0,a.jsxs)(m.z,{spacing:2,children:[(null==z?void 0:z.icon)?(0,a.jsx)(S.g,{icon:z.icon}):(0,a.jsx)(eD._,{width:"24px",height:"24px",src:null==z?void 0:z.imageUrl,borderRadius:"md"}),(0,a.jsx)(p.az,{flex:1,children:"".concat(null==z?void 0:z.name()).concat(E?" (".concat(E,")"):"")})]})})}),(0,a.jsx)(eL.h,{width:"auto",maxHeight:"max(350px, 40vh)",overflowY:"auto",ref:T,children:(0,a.jsx)(eW.e,{children:(0,a.jsx)(s.T,{spacing:4,children:r.map(e=>(0,a.jsxs)(s.T,{alignItems:"start",width:"100%",spacing:0,children:[(0,a.jsx)(y.D,{size:"sm",mb:2,children:e.title()}),(0,a.jsx)(eU.r,{columns:{base:3,"2xl":4},spacing:2,children:e.presets.filter(e=>!("Theme"===e.stylePreset&&!B)).map(e=>(0,a.jsx)(p.az,{"data-popover-scroll-id":e.stylePreset,children:(0,a.jsx)(eV,{preset:e,onClick:()=>_(e.stylePreset),isSelected:e.stylePreset===l},e.stylePreset)},e.stylePreset))})]},e.title()))})})})]}),l!==eS.None&&(0,a.jsx)(eG.T,{onKeyDown:h,isDisabled:d,height:"80px",value:o,onChange:R,resize:"none"})]})})});eH.displayName="StylePresetMenu";let eV=e=>{let{preset:t,onClick:l,isSelected:n}=e;return(0,a.jsxs)(s.T,{_hover:{cursor:n?"default":"pointer",borderColor:n?"trueblue.200":"gray.200",backgroundColor:n?"trueblue.50":"gray.50"},onClick:l,borderRadius:"md",spacing:1,p:2,border:"1px",width:"100%",color:n?"trueblue.500":"gray.900",bgColor:n?"trueblue.50":"transparent",borderColor:n?"trueblue.200":"transparent",children:[t.icon?(0,a.jsx)(p.az,{width:{base:"120px","2xl":"123.5px"},height:"35px",display:"flex",justifyContent:"center",alignItems:"center",children:(0,a.jsx)(p.az,{width:"100%",height:"100%",bgColor:"transparent",rounded:"md",display:"flex",alignItems:"center",justifyContent:"center",children:(0,a.jsx)(S.g,{icon:t.icon})})}):(0,a.jsx)(eD._,{src:t.imageUrl,width:"100%",height:"auto",borderRadius:"md"}),(0,a.jsx)(f.E,{color:n?"trueblue.500":"gray.900",fontSize:"sm",children:t.name()})]})};var eq=l(55090),eK=l(35147),eJ=l(2861),e$=l(62849),eQ=l(17539),eY=l(92515),eX=l(57812),eZ=l(19727),e0=l(35687),e1=l(41881),e2=l(30046),e6=l(18201),e4=l(43342),e5=l(46499);let e3=e=>{let{onClick:t,icon:l,label:n}=e;return t?(0,a.jsx)(e2.m,{label:n,children:(0,a.jsx)(eE.K,{size:"sm",variant:"plain",icon:l,opacity:0,transitionProperty:"common",transitionDuration:"normal","aria-label":n,_groupHover:{opacity:1},onClick:t})}):null},e8=e=>{let{imageAttrsResult:t,onDelete:l,onDownload:n,onZoom:o,onThumbsUp:i,onThumbsDown:r,footer:s}=e;if(e5.t.isFailure(t))throw Error("Error loading image",{cause:t.error});let d=e5.t.isLoading(t);return(0,a.jsxs)(O.s,{h:"sm",justifyContent:"center",backgroundImage:"linear-gradient(45deg, #FAFAFA 25%, transparent 25%), linear-gradient(-45deg, #FAFAFA 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #FAFAFA 75%), linear-gradient(-45deg, transparent 75%, #FAFAFA 75%)",backgroundSize:"10px 10px",backgroundPosition:"0 0, 0 5px, 5px -5px, -5px 0px",backgroundColor:"#FFF",border:"1px solid",borderColor:"gray.200",borderRadius:"md",position:"relative",role:"group",children:[d?"TODO Loading Placeholder":t.value.src&&(0,a.jsx)(eD._,{objectFit:"contain",src:t.value.src,opacity:d?.5:1,transitionProperty:"common",transitionDuration:"normal"}),(0,a.jsxs)(e0.B,{position:"absolute",bottom:"0",insetEnd:"0",insetStart:"0",children:[(0,a.jsxs)(m.z,{p:2,children:[(0,a.jsx)(e3,{onClick:n,icon:(0,a.jsx)(S.g,{icon:x.a_I}),label:"Download"}),(0,a.jsx)(e3,{onClick:o,icon:(0,a.jsx)(S.g,{icon:x.bMI}),label:"Zoom"}),(0,a.jsx)(e3,{onClick:l,icon:(0,a.jsx)(S.g,{icon:x.yLS}),label:"Delete"}),(0,a.jsx)(e6.h,{}),(0,a.jsx)(e3,{onClick:i,icon:(0,a.jsx)(S.g,{icon:x.Wcv}),label:"Thumbs up"}),(0,a.jsx)(e3,{onClick:r,icon:(0,a.jsx)(S.g,{icon:x.lS9}),label:"Thumbs down"})]}),s]}),d&&(0,a.jsx)(O.s,{position:"absolute",inset:0,align:"center",justify:"center",bg:"blackAlpha.50",children:(0,a.jsx)(e4.y,{})})]})};var e7=l(3040);let e9=(0,C.memo)(function(e){let{id:t,src:l,iconDefinition:n,isSelected:o,onSelect:i,selectedItemRef:r}=e;return(0,a.jsxs)(O.s,{ref:o?r:null,position:"relative",cursor:"pointer",onClick:()=>i(t),minH:"60px",minW:"60px",maxH:"60px",maxW:"60px",border:"2px solid",borderColor:o?"blue.500":"gray.100",borderRadius:"md",transitionProperty:"common",transitionDuration:"normal",_hover:{borderColor:"blue.500",bg:"trueblue.50"},children:[(0,a.jsx)(eD._,{src:l,alt:"History Image",borderRadius:"md",objectFit:"contain"}),n&&(0,a.jsx)(O.s,{position:"absolute",bottom:"0.5",insetStart:"0.5",bg:"white",boxSize:"16px",borderRadius:"sm",align:"center",justify:"center",boxShadow:"sm",color:"gray.600",children:(0,a.jsx)(S.g,{icon:n,size:"xs"})})]},t)}),te=e=>{let{images:t,selectedId:l,onSelect:n}=e,o=(0,C.useRef)(null),i=(0,C.useRef)(null),r=t.findIndex(e=>e.id===l);(0,C.useEffect)(()=>{i.current&&i.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"})},[l]);let s=e=>{let l=r+e;l>=0&&ls(-1),isDisabled:r<=0,"aria-label":"Previous image"}),(0,a.jsx)(O.s,{ref:o,overflowX:"scroll",flex:1,gap:2,align:"center",children:t.map((e,t)=>(0,a.jsx)(e9,{id:e.id,src:e.src,iconDefinition:e.iconDefinition,isSelected:r===t,onSelect:n,selectedItemRef:i},t))}),(0,a.jsx)(eE.K,{icon:(0,a.jsx)(S.g,{icon:e7.XkK}),variant:"ghost",size:"sm",onClick:()=>s(1),isDisabled:r>=t.length-1,"aria-label":"Next image"})]})};var tt=l(62230);let tl=e=>{let{variations:t,selectedOptionIndex:l,onSelectOption:n}=e;return(0,a.jsx)(p.az,{mt:4,children:(0,a.jsx)(eU.r,{columns:2,spacing:4,children:t.map((e,t)=>{var o,i;return(0,a.jsxs)(p.az,{position:"relative",cursor:"pointer",onClick:()=>n(t),bg:"black",border:"2px solid",borderColor:l===t?"blue.500":"transparent",boxShadow:"lg",borderRadius:"md",overflow:"hidden",transition:"transform 0.2s",_hover:{transform:"scale(1.02)"},children:[(0,a.jsx)(eD._,{src:e.src,alt:null!==(o=e.name)&&void 0!==o?o:"Variation ".concat(t+1),title:null!==(i=e.name)&&void 0!==i?i:"Variation ".concat(t+1),width:"100%",height:"auto",objectFit:"contain",fallback:(0,a.jsx)(tt.E,{w:"100%",h:"170px"})}),(0,a.jsx)(m.z,{px:2,py:1,bg:"gray.50",borderRadius:"md",fontSize:"xs",children:(0,a.jsx)(f.E,{color:"gray.600",flex:1,children:e.name})})]},"variation-".concat(t))})})})},ta=(0,C.memo)(function(e){let{onSelectResult:t}=e,l=(0,Q.GV)(e1.RM);if(e5.t.isFailure(l))return(0,a.jsx)("div",{children:"Error"});if(e5.t.isLoading(l))return(0,a.jsx)("div",{children:"Loading"});let n=l.value;if("PromptedAIImageEdit"===n.type){let e=n.output.options.findIndex(e=>e.src===n.result.src),l=n.output.options;return(0,a.jsx)(tl,{variations:n.output.options,selectedOptionIndex:-1===e?0:e,onSelectOption:e=>t(l[e])})}return(0,a.jsx)(e8,{imageAttrsResult:{status:"success",value:n.result},onDelete:null,onDownload:null,onZoom:null,onThumbsUp:null,onThumbsDown:null,footer:null})}),tn=e=>{switch(e){case"PromptedAIImageEdit":return x.LFz;case"RemoveBackgroundAIImageEdit":return x.IlC;default:return}},to=(0,C.memo)(function(e){let t=(0,Q.jL)(),l=e.updateAttributes,n=(0,Q.GV)(e1.wf),o=(0,Q.GV)(e1.a),i=(0,Q.GV)(e1.Re),r=(0,C.useCallback)(e=>{let a=(0,Q.KA)(),n=(0,e1.Qo)(a.getState(),e);n&&(t(e1.mF.selectOperation(e)),l(n.result))},[t,l]),s=(0,C.useCallback)(e=>{t(e1.mF.setCurrentOperationResult(e)),l(e)},[t,l]),d=(0,C.useCallback)(e=>{e.preventDefault();let l=new FormData(e.currentTarget).get("prompt");if(!l)return;let a=(0,Q.KA)(),n=(0,e1.rf)(a.getState());e5.t.isSuccess(n)&&(t(e1.mF.startEdit({type:"PromptedAIImageEdit",inputs:{inputImage:n.value.result,prompt:l}})),e.currentTarget.reset())},[t]);return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ta,{onSelectResult:s}),(0,a.jsx)(te,{images:i.map(e=>({id:e.id,src:e.result.src,iconDefinition:tn(e.type)})),selectedId:o,onSelect:r}),(0,a.jsx)("form",{onSubmit:d,children:(0,a.jsx)(e0.B,{mt:4,spacing:4,children:(0,a.jsxs)(p.az,{position:"relative",children:[(0,a.jsx)(z._,{name:"prompt",isRequired:!0,initialHeight:"6rem",placeholder:"What do you want to change?",py:"3",pe:24,isDisabled:n,onKeyDown:e=>{if("Enter"===e.key&&!e.shiftKey){var t;e.preventDefault(),null===(t=e.currentTarget.form)||void 0===t||t.requestSubmit()}}},o),(0,a.jsx)(w.$,{type:"submit",position:"absolute",bottom:"2",insetEnd:"2",size:"sm",colorScheme:"blue",leftIcon:(0,a.jsx)("i",{className:"fa-sharp-duotone fa-solid fa-sparkles"}),isLoading:n,isDisabled:n,zIndex:10,children:"Edit"})]})})})]})}),ti=e=>{(0,(0,Q.KA)().dispatch)(e1.mF.openMediaRecordForImage(e))},tr=e=>{let[t,l]=(0,C.useState)({currentTab:"generate"}),n="string"==typeof e.currentAttributes.src?e.currentAttributes:null;return(0,a.jsxs)(eY.t,{variant:"soft-rounded",isFitted:!0,size:"sm",onChange:e=>{0===e?l({currentTab:"generate"}):1===e&&n&&(l({currentTab:"edit",editorArgs:{imageAttrs:n}}),ti(n))},index:"edit"===t.currentTab?1:0,children:[(0,a.jsxs)(eX.w,{mb:4,children:[(0,a.jsx)(eZ.o,{children:(0,a.jsxs)(m.z,{children:[(0,a.jsx)(S.g,{icon:x.Cyq}),(0,a.jsx)(f.E,{children:"Pick"})]})}),(0,a.jsx)(eZ.o,{isDisabled:!n,children:(0,a.jsxs)(m.z,{children:[(0,a.jsx)(S.g,{icon:x.LFz}),(0,a.jsx)(f.E,{children:"Edit"})]})})]}),"generate"===t.currentTab&&e.generateTab,"edit"===t.currentTab&&(0,a.jsx)(to,{imageAttrs:t.editorArgs.imageAttrs,updateAttributes:e.updateAttributes})]})};var ts=l(81853),td=l(95986);let tu=e=>{let{enabled:t,isGenerating:l,negativePrompt:n,setNegativePrompt:o,count:i,setCount:r,steps:d,setSteps:u,cfgScale:c,setCfgScale:f,model:p}=e,{usesNegativePrompt:g,usesSteps:h,usesCFG:b}={usesNegativePrompt:"stable-diffusion-xl-v1-0"===p||p.startsWith("imagen"),usesSteps:"stable-diffusion-xl-v1-0"===p||p.startsWith("flux"),usesCFG:"stable-diffusion-xl-v1-0"===p||p.startsWith("imagen")||p.startsWith("flux")};return(0,a.jsxs)(s.T,{align:"stretch",spacing:3,children:[g&&(0,a.jsxs)(s.T,{align:"stretch",spacing:2,children:[(0,a.jsx)(y.D,{size:"sm",children:(0,a.jsx)(A.x6,{id:"cwxGog"})}),(0,a.jsx)(eG.T,{isDisabled:!t||l,value:n,onChange:e=>{o(e.target.value)},rows:3})]}),(0,a.jsxs)(eU.r,{columns:2,gap:2,children:[(0,a.jsxs)(m.z,{children:[(0,a.jsx)(td.Tz,{placement:"top",label:(0,a.jsx)(A.x6,{id:"pKdwsO",values:{MAX_COUNT:8,DEFAULT_COUNT:3}}),children:(0,a.jsx)(y.D,{size:"sm",children:(0,a.jsx)(A.x6,{id:"wBMjJ2"})})}),(0,a.jsx)(ts.Q7,{defaultValue:i,value:i||"",min:1,max:8,isDisabled:!t||l,onChange:(e,t)=>{r(t)},children:(0,a.jsx)(ts.OO,{paddingInline:2})})]}),h&&(0,a.jsxs)(m.z,{children:[(0,a.jsx)(td.Tz,{placement:"top",label:(0,a.jsx)(A.x6,{id:"5H4Pmz",values:{MAX_STEPS:100,DEFAULT_STEPS:eR}}),children:(0,a.jsx)(y.D,{size:"sm",children:(0,a.jsx)(A.x6,{id:"A9onc2"})})}),(0,a.jsx)(ts.Q7,{defaultValue:d,value:d||"",min:1,max:100,isDisabled:!t||l,onChange:(e,t)=>{""===e?u(void 0):u(t)},children:(0,a.jsx)(ts.OO,{paddingInline:2})})]}),b&&(0,a.jsxs)(m.z,{children:[(0,a.jsx)(td.Tz,{placement:"top",label:(0,a.jsx)(A.x6,{id:"Hcpaw+",values:{MAX_CFG_SCALE:200,DEFAULT_CFG_SCALE:e_}}),children:(0,a.jsx)(y.D,{size:"sm",children:(0,a.jsx)(A.x6,{id:"hsYa9i"})})}),(0,a.jsx)(ts.Q7,{defaultValue:c,value:c||"",min:1,max:200,isDisabled:!t||l,onChange:(e,t)=>{""===e?f(void 0):f(t)},children:(0,a.jsx)(ts.OO,{paddingInline:2})})]})]})]})},tc=()=>{let e=document.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",e.style.msOverflowStyle="scrollbar",document.body.appendChild(e);let t=document.createElement("div");e.appendChild(t);let l=e.offsetWidth-t.offsetWidth;return e.parentNode.removeChild(e),l};var tm=l(1935),tf=l(23970),tp=l(32202),tg=l(74727),th=l(18588),tb=l(59742),ty=l(57238),tv=l(59707);let tk=e=>{var t;let{currentAttributes:l,deleteImage:n,showDelete:i=!0,...r}=e,s=(0,tp.d)(),d=o.Ru._({id:"cnGeoo"}),u=(0,C.useCallback)(async e=>{try{let t=document.createElement("a");t.href=e,t.target="_blank",t.download="image.jpg",document.body.appendChild(t),t.click(),document.body.removeChild(t),s({title:(0,a.jsx)(A.x6,{id:"BZBUfX"}),status:"success",duration:3e3,isClosable:!0,position:"top"})}catch(e){console.error(e),s({title:(0,a.jsx)(A.x6,{id:"4+qb0c"}),description:(0,a.jsx)(A.x6,{id:"XLO6fp"}),status:"error",duration:5e3,isClosable:!0,position:"top"})}},[s]),{isOpen:c,onOpen:m,onClose:f}=(0,eO.j)();return(0,a.jsxs)(tg.e,{size:"sm",...r,children:[(0,a.jsx)(td.Tz,{label:(0,a.jsx)(A.x6,{id:"niRN2H"}),placement:"top",children:(0,a.jsx)(eE.K,{"aria-label":"download image",borderWidth:"1px",icon:(0,a.jsx)(S.g,{icon:x.a_I}),onClick:()=>{var e;return u(null!==(e=l.src)&&void 0!==e?e:"")}})}),(0,a.jsx)(td.Tz,{label:(0,a.jsx)(A.x6,{id:"GpbSs9"}),placement:"top",children:(0,a.jsx)(eE.K,{"aria-label":"zoom in",borderWidth:"1px",icon:(0,a.jsx)(S.g,{icon:x.bMI}),onClick:e=>{e.stopPropagation(),m()}})}),c&&(0,a.jsxs)(th.aF,{isOpen:c,size:"6xl",onClose:f,isCentered:!0,children:[(0,a.jsx)(tb.m,{bg:"blackAlpha.900"}),(0,a.jsxs)(ty.$,{width:"fit-content",children:[(0,a.jsx)(p.az,{position:"absolute",right:2,top:2,zIndex:"toast",contentEditable:!1,suppressContentEditableWarning:!0,children:(0,a.jsx)(eE.K,{"aria-label":o.Ru._({id:"8qZ5De"}),colorScheme:"gray",size:"md",onClick:f,onMouseDown:tv.Fw,icon:(0,a.jsx)(tf.U,{})})}),(0,a.jsx)(eD._,{src:null!==(t=l.src)&&void 0!==t?t:"",objectFit:"contain",rounded:"lg",maxH:"90vh",maxW:"90vw"})]})]}),i&&n&&(0,a.jsx)(td.Tz,{label:d,placement:"top",children:(0,a.jsx)(eE.K,{"aria-label":d,color:"red.500",borderWidth:"1px",icon:(0,a.jsx)(S.g,{icon:x.yLS}),onClick:async e=>{var t;e.stopPropagation(),await n(null!==(t=l.savedMediaId)&&void 0!==t?t:"")}})})]})};var tw=l(76003),tx=l(70405),tS=l(35789),tA=l(48574);let tC=(0,C.memo)(e=>{let{image:t,currentAttributes:l,onImageClick:n,resizeThumbnail:o,h:i,deleteImage:r,isDeleting:s,showQuickActions:d=!0,showAvatar:u=!0}=e,[c,m]=(0,C.useState)(!0),{user:f}=(0,et.ur)(),g=(0,Q.GV)(X.zB),h=null==g?void 0:g.find(e=>e.user.id===t.userId),b=(0,C.useMemo)(()=>(null==f?void 0:f.id)===t.userId,[null==f?void 0:f.id,t.userId]),y=(0,C.useMemo)(()=>(null==l?void 0:l.savedMediaId)===t.id,[null==l?void 0:l.savedMediaId,t.id]),v=o?(0,eQ.Ub)(t.attrs.src,eQ.p7,t.attrs.meta):t.attrs.src,{ref:k,width:z}=(0,tm.Lh)(),I=h&&g&&g.length>1&&u;return(0,a.jsx)(tw.E,{children:(0,a.jsxs)(w.$,{borderRadius:"base",display:"block",variant:"ghost",opacity:1,width:"100%",ref:k,height:"100%",minHeight:"0",textAlign:"left",pos:"relative",overflow:"hidden",p:0,_hover:{shadow:"outline"},_active:{shadow:"outline"},transition:"box-shadow .2s ease",cursor:"pointer",onClick:()=>n(t),sx:{_focusVisible:{".attribution-container":{opacity:1}},_hover:{".attribution-container":{opacity:1}}},isDisabled:s,"data-testid":"image-search-grid-item",role:"group",children:[(0,a.jsx)(eD._,{w:"100%",h:i||"100%",src:v,borderRadius:"base",objectFit:"cover",onLoad:()=>m(!1)}),!c&&(0,a.jsx)(tx.z,{in:y,children:(0,a.jsx)(p.az,{pointerEvents:"none",color:"white",pos:"absolute",inset:0,bg:"rgba(0,0,0,.5)",borderRadius:"base",children:(0,a.jsx)(tS.o,{h:"100%",w:"100%",children:(0,a.jsx)(S.g,{icon:x.e68})})})}),z>=125&&d&&(0,a.jsx)(p.az,{position:"absolute",bottom:-2,left:"50%",transform:"translate(-50%, -50%)",display:"none",_groupHover:{display:"block"},children:(0,a.jsx)(tk,{showDelete:b,currentAttributes:t.attrs,deleteImage:r})}),I&&(0,a.jsx)(td.Tz,{label:(0,a.jsx)(A.x6,{id:"RMBnNX",values:{0:h.user.displayName,1:b?"(You)":""}}),placement:"top",children:(0,a.jsx)(tA.e,{size:"sm",src:h.user.profileImageUrl,name:h.user.displayName,position:"absolute",top:2.5,right:2.5,borderWidth:"2px",borderColor:"gray.200",_hover:{cursor:"pointer"}})}),!t.attrs.src&&(0,a.jsx)(tw.E,{width:"100%",children:(0,a.jsx)(tt.E,{height:"80px",borderRadius:"base"})})]})},t.id)});tC.displayName="AIImageHistoryItem";var tz=l(52192);let tI=(0,C.memo)(e=>{var t;let{attrs:l,onRateImage:n}=e,o=null===(t=l.aiParams)||void 0===t?void 0:t.interactionId,[i,r]=(0,C.useState)(null);(0,C.useEffect)(()=>{l.savedMediaId&&r(null)},[l.savedMediaId]);let s=(0,C.useCallback)((e,t,a)=>{var n;(null===(n=l.aiParams)||void 0===n?void 0:n.interactionId)&&(0,I.XD)({feedback:t,rating:e,tags:a,aiParams:l.aiParams,imageUrl:l.src,interactionId:l.aiParams.interactionId})},[l]),d=(0,C.useCallback)(e=>{r(e),n(e)},[n]);return o?(0,a.jsx)(p.az,{position:"absolute",bottom:2,zIndex:"sticky",right:2,children:(0,a.jsx)(tz.f3,{trackFeedback:s,rating:i||void 0,setRating:d,RatingButtons:tz.Ep,feedbackTags:tj},l.savedMediaId)}):null});tI.displayName="AIImageRating";let tj=[{key:"bad-people",label:(0,a.jsx)(A.x6,{id:"eft1Pc"})},{key:"bad-text",label:(0,a.jsx)(A.x6,{id:"BNmAIN"})},{key:"didnt-follow-prompt",label:(0,a.jsx)(A.x6,{id:"Tq32Jp"})},{key:"wrong-colors",label:(0,a.jsx)(A.x6,{id:"Lx0mWG"})},{key:"wrong-style",label:(0,a.jsx)(A.x6,{id:"HG712W"})},{key:"low-res",label:(0,a.jsx)(A.x6,{id:"i6Gj9B"})},{key:"inappropriate",label:(0,a.jsx)(A.x6,{id:"i/9pR4"})}],tF=e=>{let{imagesMatchingInteractionId:t,currentAttributes:l,isGenerating:n,isDeleting:o,selectedSavedMediaId:i,selectImage:r,onRateImage:s,deleteImage:d}=e,{user:u}=(0,et.ur)(),[c,m]=(0,C.useState)({wA:0,hA:0,wBCD:0,hBCD:0}),f=(0,C.useMemo)(()=>tc(),[]),{ref:p,width:g}=(0,tm.Lh)(),h=(0,C.useMemo)(()=>!!n||!!t&&!(t.length<=1)&&!tR([...t.map(e=>e.attrs),l]),[n,t,l]),b=(0,C.useMemo)(()=>{let e=(null==t?void 0:t.length)>0,l=e?t.find(e=>e.id===i):null,a=(null==l?void 0:l.userId)===(null==u?void 0:u.id);return e&&a},[t,i,u]),y=h?100/3:0;return(0,e$.Vg)(()=>{var e,a,n,o;if((null==l?void 0:null===(e=l.meta)||void 0===e?void 0:e.width)&&(null==l?void 0:null===(a=l.meta)||void 0===a?void 0:a.height)){let e=tB({vpWidth:g||624,gap:8,ratioW:(null==l?void 0:null===(n=l.meta)||void 0===n?void 0:n.width)||1024,ratioH:(null==l?void 0:null===(o=l.meta)||void 0===o?void 0:o.height)||1024,thumbCount:(null==t?void 0:t.length)||0});(Math.abs(e.wA-c.wA)>=f||Math.abs(e.hA-c.hA)>=f||Math.abs(e.wBCD-c.wBCD)>=f||Math.abs(e.hBCD-c.hBCD)>=f)&&m(e)}},[l,t,g,c,f],[l,t,g]),(0,a.jsxs)(O.s,{dir:"row",w:"100%",ref:p,overflow:"hidden",alignItems:"center",justifyContent:"center",gap:"".concat(8,"px"),children:[(0,a.jsxs)(O.s,{justifyContent:"center",position:"relative",overflow:"hidden",h:c.hA,w:"".concat(100-y,"%"),children:[n?(0,a.jsx)(tt.E,{w:"100%",h:c.hA}):(0,a.jsx)(eD._,{h:"100%",w:"100%",objectFit:h?"cover":"contain",src:l.src||void 0,fallbackSrc:l.tempUrl||void 0,alt:"",borderRadius:"md"}),!n&&(0,a.jsx)(tk,{currentAttributes:l,position:"absolute",bottom:2,zIndex:"sticky",left:2,deleteImage:d,showDelete:b}),!n&&(0,a.jsx)(tI,{attrs:l,onRateImage:s})]}),h&&(0,a.jsx)(O.s,{alignItems:"center",justifyContent:"center",direction:"column",overflow:"hidden",gap:"".concat(8,"px"),h:c.hA,borderRadius:"base",children:n?Array.from({length:3},(e,t)=>(0,a.jsx)(tt.E,{w:c.wBCD,h:c.hBCD})):(0,a.jsx)(a.Fragment,{children:t.slice(0,3).map(e=>(0,a.jsx)(tC,{image:e,currentAttributes:l,onImageClick:r,resizeThumbnail:!0,deleteImage:d,isDeleting:o,h:"".concat(c.hBCD,"px"),showQuickActions:!1,showAvatar:!1},e.id))})})]})},tB=e=>{let{vpWidth:t,gap:l,ratioW:a,ratioH:n,thumbCount:o}=e,i=a/n,r=i>eC.square?eC.landscape:i{if(e.length<=1)return!1;let t=t_(e[0]);return e.some(e=>t_(e)!==t)},t_=e=>{var t,l,a,n;let o=null!==(a=null==e?void 0:null===(t=e.meta)||void 0===t?void 0:t.width)&&void 0!==a?a:1,i=null!==(n=null==e?void 0:null===(l=e.meta)||void 0===l?void 0:l.height)&&void 0!==n?n:1;return o>i?"landscape":i>o?"portrait":"square"};var tM=l(39286);let tE=e=>{let{isEnhancingPrompt:t,isGenerating:l,runEnhancePrompt:n}=e;return(0,a.jsx)(m.z,{position:"absolute",bottom:2,right:2,children:(0,a.jsx)(td.Tz,{placement:"top",label:(0,a.jsx)(A.x6,{id:"LwcIt2",values:{GAMMA_PROPER_NOUN:tM.On}}),children:(0,a.jsx)(w.$,{variant:"ghost",rightIcon:(0,a.jsx)(S.g,{icon:x.uts}),isLoading:t,isDisabled:l,"aria-label":o.Ru._({id:"eoAiXB"}),onClick:n,zIndex:"sticky",size:"sm",loadingText:o.Ru._({id:"6xU0OU"}),spinner:(0,a.jsx)(e4.y,{size:"sm",right:2,alignSelf:"flex-end"}),spinnerPlacement:"end",children:(0,a.jsx)(A.x6,{id:"Uehxdq"})})})})};var tT=l(33513);let tO=e=>{let{onSelectImage:t,currentAttributes:l,resizeThumbnails:n,history:o,canLoadMore:i,loadMore:r,isLoadingMore:s,isDeleting:d,deleteImage:u,helpText:c}=e,m=C.useMemo(()=>o.map(e=>e.attrs?(0,a.jsx)(p.az,{position:"relative",children:(0,a.jsx)(tC,{image:e,deleteImage:u,isDeleting:d,currentAttributes:l,onImageClick:t,resizeThumbnail:n,showQuickActions:!0})},e.id):(console.log("Image is missing attrs",e),null)),[o,u,d,l,t,n]);return(0,a.jsxs)(O.s,{direction:"column",align:"stretch",children:[c&&(0,a.jsx)(f.E,{fontSize:"xs",color:"gray.500",mb:4,children:c}),(0,a.jsx)(tT.A,{columnsCount:3,gutter:"0.5rem",children:m}),i&&(0,a.jsx)(w.$,{variant:"plain",onClick:r,mt:4,isLoading:s,children:(0,a.jsx)(A.x6,{id:"yQ2kGp"})})]})};var tP=l(71792),tN=l(96502);let tD={title:(0,a.jsx)(A.x6,{id:"0oUc2U"}),description:(0,a.jsx)(A.x6,{id:"s3XYLh"}),image:"https://cdn.gamma.app/zc87vhr30n8uf3n/9f0b4d71d10f4d388e50febe89bb1853/optimized/Sal-Chill-Cloud.svg"},tL=e=>{let{onSelectImage:t,savedMediaId:l,currentAttributes:n,scope:o,setScope:i,canLoadMore:r,loadMore:s,isLoading:d,isLoadingMore:u,history:c,deleteImage:m,isDeleting:g}=e,h=()=>d?(0,a.jsx)(tU,{}):0===c.length?(0,a.jsx)(p.az,{mt:10,children:(0,a.jsx)(tW,{})}):(0,a.jsx)(tO,{onSelectImage:t,currentAttributes:n,savedMediaId:l,canLoadMore:r,loadMore:s,isLoadingMore:u,history:c,deleteImage:m,isDeleting:g,helpText:"doc"===o?(0,a.jsx)(A.x6,{id:"uNPCE+",values:{GAMMA_ARTIFACT_PROPER_NOUN:tM.TP}}):(0,a.jsx)(A.x6,{id:"+MrfBb"}),resizeThumbnails:!0});return(0,a.jsxs)(eY.t,{size:"sm",variant:"soft-rounded",onChange:e=>{i&&i(1===e?"user":"doc")},isFitted:!0,children:[(0,a.jsxs)(eX.w,{children:[(0,a.jsx)(eZ.o,{children:(0,a.jsx)(f.E,{children:(0,a.jsx)(A.x6,{id:"emHsgB",values:{GAMMA_ARTIFACT_PROPER_NOUN:tM.TP}})})}),(0,a.jsx)(eZ.o,{children:(0,a.jsx)(f.E,{children:(0,a.jsx)(A.x6,{id:"4FBm2s"})})})]}),(0,a.jsxs)(tP.T,{children:[(0,a.jsx)(tN.K,{children:h()}),(0,a.jsx)(tN.K,{children:h()})]})]})},tW=()=>(0,a.jsxs)(s.T,{spacing:6,children:[(0,a.jsx)(eD._,{src:tD.image,width:"200px"}),(0,a.jsxs)(e0.B,{justifyContent:"center",alignItems:"center",spacing:1,children:[(0,a.jsx)(f.E,{fontFamily:"Inter",fontWeight:"500",color:"gray.900",textAlign:"center",children:tD.title}),(0,a.jsx)(f.E,{fontFamily:"Inter",fontWeight:"400",color:"gray.700",textAlign:"center",children:tD.description})]})]}),tU=C.memo(()=>(0,a.jsx)(m.z,{spacing:"4",children:(0,a.jsx)(tT.A,{columnsCount:3,gutter:"0.5rem",children:[void 0,void 0,void 0].map((e,t)=>(0,a.jsx)(tt.E,{height:{base:"125px",lg:"200px"},width:"100%"},t))})}));tU.displayName="AIImageHistorySkeleton";var tG=l(19717),tH=l(80304);let tV=e=>{let t,{selectImage:l,savedMediaContext:a}=e,n=(0,Q.GV)(X.sX),i=(0,Q.GV)(tH.TJ),r=en(a);"new"===i&&(i=void 0,t=j.rWX.Theme);let[s,d]=(0,C.useState)(""),[u,c]=(0,C.useState)(!1),[m,f]=(0,C.useState)(!1),[p,g]=(0,C.useState)("");return{generate:(0,C.useCallback)(async e=>{let a=(0,I.$F)();d(e.prompt),c(!0),f(!1),g("");let s={...e,stylePreset:e.stylePreset||eS.Theme,stylePrompt:e.stylePrompt||"",docId:e.docId||n,themeId:e.themeId||i,context:e.context||t},u=(0,L.pE)(e.model),m=performance.now(),p={interactionId:a,interface:"generate-image",provider:null==u?void 0:u.provider,streaming:!1,inputContent:s.prompt,docId:s.docId,generateImageOptions:s};try{(0,I.rl)(p);let e=await (0,L.hU)({interactionId:a,workspaceId:r,...s});if(c(!1),0===e.length)throw Error("No images generated");e.length>0&&l(e[0]),(0,tG.w)("generateImage",void 0,a),(0,I.Yh)({...p,latency:performance.now()-m,generateImageUrls:e.map(e=>e.attrs.src)})}catch(e){f(!0),g(e.messageTranslated?e.messageTranslated:o.Ru._({id:"QcZqsh"})),c(!1),console.error("(caught) [AIGenerateImage] error:",e),(0,I.tB)({...p,latency:performance.now()-m,errorName:"GenerateImageError",errorMessage:e.message,outputMessage:""})}c(!1)},[n,i,t,r,l]),isGenerating:u,hasError:m,errorMessage:p,searchQuery:s}};var tq=l(63552),tK=l(11403),tJ=l(40173),t$=l(98903),tQ=l(81575),tY=l(27670),tX=l(78821),tZ=l(93834);let t0=e=>{let{product:t="pro",...l}=e;return(0,a.jsx)(tY.E,{size:"sm",variant:"solid",bottom:0,right:0,bg:"pro"===t?"linear-gradient(97deg, #3300D9 -10%, #9D20C9 56.82%, #DF7A6C 120%)":"plus"===t?"trueblue.500":"gray.100",color:"pro"===t||"plus"===t?"white":"gray.800",textShadow:"pro"===t||"plus"===t?"0px 0px 1px rgba(0, 0, 0, .5)":"none",fontSize:"11px",...l,children:(0,tZ.Ok)()[t].name})},t1=e=>{let{canUseFeature:t,productFeature:l,...n}=e,o=(0,tX.gD)(l);return t||null===o?null:(0,a.jsx)(t0,{variant:"solid",product:o,...n})};var t2=l(68984),t6=l(10458),t4=l(44507),t5=l(82223),t3=l(42391);let t8=e=>{let{numSegments:t,numFilledSegments:l,startColor:n,endColor:o}=e,[i,r]=(0,t5.rd)("colors",[n,o||n]);return(0,a.jsx)(O.s,{gap:1,w:"full",alignItems:"center",children:Array.from({length:t}).map((e,n)=>{let o=n1?n/(t-1):0):"gray.200";return(0,a.jsx)(p.az,{h:1.5,borderRadius:"sm",flex:1,bg:o,transition:"background 0.2s ease-in-out"},n)})})},t7=(0,C.memo)(e=>{let{label:t,description:l,image:n,popoverImage:i,bestStyle:r,bestType:d,speed:u}=e;return(0,a.jsxs)(s.T,{align:"stretch",p:4,spacing:4,children:[(0,a.jsxs)(p.az,{position:"relative",children:[(0,a.jsx)(eD._,{src:i.src,alt:t(),borderRadius:"lg",objectFit:"cover",height:"140px",width:"250px"}),(0,a.jsx)(p.az,{position:"absolute",backgroundColor:(0,t3.$3)("black",.4),bottom:2,left:2,p:1,borderRadius:"sm",children:(0,a.jsx)(f.E,{color:"gray.50",fontSize:"xs",fontWeight:"medium",lineHeight:"normal",children:o.Ru._({id:"HmI5oK"})})})]}),(0,a.jsxs)(s.T,{align:"stretch",spacing:3,children:[(0,a.jsxs)(m.z,{spacing:2,children:[(0,a.jsx)(eD._,{src:n.src,w:"20px",h:"20px",objectFit:"contain"}),(0,a.jsx)(f.E,{fontWeight:"semibold",fontSize:"md",color:"gray.800",children:t()})]}),(0,a.jsx)(f.E,{fontSize:"xs",color:"gray.500",fontWeight:"medium",children:l()}),(0,a.jsxs)(p.az,{children:[(0,a.jsx)(f.E,{fontSize:"xs",color:"gray.400",fontWeight:"semibold",mb:2,children:(0,a.jsx)(A.x6,{id:"l9wI00"})}),(0,a.jsx)(t8,{numSegments:4,numFilledSegments:u,startColor:"trueblue.400",endColor:"orchid.500"})]}),(0,a.jsxs)(p.az,{children:[(0,a.jsx)(f.E,{fontSize:"xs",color:"gray.400",fontWeight:"semibold",mb:1,children:(0,a.jsx)(A.x6,{id:"uvPTBJ"})}),(0,a.jsxs)(s.T,{align:"stretch",spacing:1,children:[(0,a.jsxs)(m.z,{spacing:2,children:[(0,a.jsx)(S.g,{icon:x.ffg,color:(0,t3.Lm)("trueblue.400"),size:"xs",width:"0.625rem",height:"0.625rem"}),(0,a.jsx)(f.E,{fontSize:"xs",color:"gray.600",fontWeight:"medium",children:r()})]}),(0,a.jsxs)(m.z,{spacing:2,children:[(0,a.jsx)(S.g,{icon:x.kLe,color:(0,t3.Lm)("trueblue.400"),size:"xs",width:"0.625rem",height:"0.625rem"}),(0,a.jsx)(f.E,{fontSize:"xs",color:"gray.600",fontWeight:"medium",fontFamily:"body",children:d()})]})]})]})]})]})});t7.displayName="AIImageModelPopover";let t9={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/flux-1-schnell.a4d70ddb.jpg",height:500,width:616,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/2wBDAQoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/wgARCAAGAAgDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAX/xAAVAQEBAAAAAAAAAAAAAAAAAAADBf/aAAwDAQACEAMQAAAAmCU3/8QAHRAAAAUFAAAAAAAAAAAAAAAAAAECBBIDESEiMv/aAAgBAQABPwBbBuaSzU5KW15D/8QAGhEAAgIDAAAAAAAAAAAAAAAAAQIAESFRsf/aAAgBAgEBPwAOxvOuT//EABkRAAIDAQAAAAAAAAAAAAAAAAECABEikf/aAAgBAwEBPwAogrC8n//Z",blurWidth:8,blurHeight:6},le={None:{"dall-e-3":{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/dall-e-3.e0424b3d.jpg",height:500,width:616,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/2wBDAQoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/wgARCAAGAAgDASIAAhEBAxEB/8QAFAABAAAAAAAAAAAAAAAAAAAAAP/EABUBAQEAAAAAAAAAAAAAAAAAAAQF/9oADAMBAAIQAxAAAAAJKP/EABsQAAMAAgMAAAAAAAAAAAAAAAEDEgIEABEh/9oACAEBAAE/ANDdXIyYnFkmjYHonvn/xAAaEQACAgMAAAAAAAAAAAAAAAACAwABBDOR/9oACAECAQE/AMh7qPYXZ//EABoRAAEFAQAAAAAAAAAAAAAAAAIABBIxMlH/2gAIAQMBAT8AbgEMDfF//9k=",blurWidth:8,blurHeight:6},"flux-1-pro":{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/flux-1-pro.fcce6522.jpg",height:500,width:616,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/2wBDAQoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/wgARCAAGAAgDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAX/xAAVAQEBAAAAAAAAAAAAAAAAAAADBf/aAAwDAQACEAMQAAAAgiQ3/8QAGxAAAgIDAQAAAAAAAAAAAAAAAQIDEQASUSH/2gAIAQEAAT8AVFiTaR2Y3RND3XnM/8QAGBEAAgMAAAAAAAAAAAAAAAAAAAECESH/2gAIAQIBAT8AtyWn/8QAGREAAQUAAAAAAAAAAAAAAAAAAQADEiJR/9oACAEDAQE/AHKERxf/2Q==",blurWidth:8,blurHeight:6},"flux-1-schnell":t9,"flux-1-ultra":{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/flux-1-ultra.3fdf59fa.jpg",height:500,width:616,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/2wBDAQoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/wgARCAAGAAgDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAT/xAAVAQEBAAAAAAAAAAAAAAAAAAABBf/aAAwDAQACEAMQAAAAkEN//8QAGhAAAgIDAAAAAAAAAAAAAAAAAREAEgIDE//aAAgBAQABPwDLeOdUbBluf//EABYRAQEBAAAAAAAAAAAAAAAAAAEAIf/aAAgBAgEBPwA0v//EABYRAAMAAAAAAAAAAAAAAAAAAAABEf/aAAgBAwEBPwCs/9k=",blurWidth:8,blurHeight:6},"flux-1-quick":{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/flux-1-quick.01258a07.jpg",height:500,width:616,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/2wBDAQoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/wgARCAAGAAgDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAb/xAAVAQEBAAAAAAAAAAAAAAAAAAADBP/aAAwDAQACEAMQAAAAmhCn/8QAHBAAAgEFAQAAAAAAAAAAAAAAAQIDAAQFERJh/9oACAEBAAE/AIsNZxRPp3ZJByelGx6K/8QAGREAAQUAAAAAAAAAAAAAAAAAAQACAwRC/9oACAECAQE/AG2Jjsr/xAAYEQACAwAAAAAAAAAAAAAAAAAAAhETMf/aAAgBAwEBPwCpJw//2Q==",blurWidth:8,blurHeight:6},"ideogram-v2":{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/ideogram-v2.12157ecc.jpg",height:500,width:616,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/2wBDAQoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/wgARCAAGAAgDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAX/xAAUAQEAAAAAAAAAAAAAAAAAAAAC/9oADAMBAAIQAxAAAACeEP/EABsQAQAABwAAAAAAAAAAAAAAAAIAAwQGEhMi/9oACAEBAAE/ABdVfreUxLmP/8QAFxEAAwEAAAAAAAAAAAAAAAAAAAERUf/aAAgBAgEBPwCvT//EABgRAAIDAAAAAAAAAAAAAAAAAAABIVGR/9oACAEDAQE/AIpYf//Z",blurWidth:8,blurHeight:6},"ideogram-v2-turbo":{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/ideogram-v2-turbo.e565fd0e.jpg",height:500,width:616,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/2wBDAQoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/wgARCAAGAAgDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAb/xAAVAQEBAAAAAAAAAAAAAAAAAAAAAf/aAAwDAQACEAMQAAAAiQv/xAAcEAABAwUAAAAAAAAAAAAAAAACAAESAwQFIWH/2gAIAQEAAT8AfMTCBW1Nujpf/8QAGBEAAgMAAAAAAAAAAAAAAAAAAAMBAlL/2gAIAQIBAT8AlrN2P//EABsRAAEEAwAAAAAAAAAAAAAAAAMAAQIhIjFR/9oACAEDAQE/AGEO8I74v//Z",blurWidth:8,blurHeight:6},"imagen-3-flash":{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/imagen-3-flash.3b553c3d.jpg",height:500,width:616,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/2wBDAQoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/wgARCAAGAAgDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAb/xAAUAQEAAAAAAAAAAAAAAAAAAAAC/9oADAMBAAIQAxAAAACbBf8A/8QAGxAAAQQDAAAAAAAAAAAAAAAABQABERICExT/2gAIAQEAAT8AYoK49TCcZrM2X//EABkRAAIDAQAAAAAAAAAAAAAAAAEDACEiMf/aAAgBAgEBPwAPdez2f//EABgRAAIDAAAAAAAAAAAAAAAAAAADAQJS/9oACAEDAQE/AKoViD//2Q==",blurWidth:8,blurHeight:6},"imagen-3-pro":{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/imagen-3-pro.4a7e6241.jpg",height:500,width:616,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/2wBDAQoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/wgARCAAGAAgDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAb/xAAUAQEAAAAAAAAAAAAAAAAAAAAD/9oADAMBAAIQAxAAAACaAP8A/8QAHBAAAgAHAAAAAAAAAAAAAAAAAQIAAwQFExRC/9oACAEBAAE/AKa5pq4klks47CmP/8QAGBEAAgMAAAAAAAAAAAAAAAAAAQMABDL/2gAIAQIBAT8AZYcDsz//xAAZEQACAwEAAAAAAAAAAAAAAAABAwACIRL/2gAIAQMBAT8AqpengbP/2Q==",blurWidth:8,blurHeight:6},"leonardo-phoenix":{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/leonardo-phoenix.5a9b148e.jpg",height:500,width:616,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/2wBDAQoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/wgARCAAGAAgDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAb/xAAUAQEAAAAAAAAAAAAAAAAAAAAD/9oADAMBAAIQAxAAAACQBL//xAAdEAACAQQDAAAAAAAAAAAAAAABAgQAEiEiAxRR/9oACAEBAAE/AElR+u6rHXTlW4WjYtgHHlf/xAAYEQACAwAAAAAAAAAAAAAAAAAAAQIxcv/aAAgBAgEBPwB1HJ//xAAYEQEAAwEAAAAAAAAAAAAAAAABAAMScv/aAAgBAwEBPwAXdnbP/9k=",blurWidth:8,blurHeight:6},"luma-photon-1":{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/luma-photon-1.1649ca4f.jpg",height:500,width:616,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/2wBDAQoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/wgARCAAGAAgDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAb/xAAVAQEBAAAAAAAAAAAAAAAAAAAFBv/aAAwDAQACEAMQAAAAoRNt/wD/xAAaEAABBQEAAAAAAAAAAAAAAAACAAQGITFR/9oACAEBAAE/ACkbztDeav/EABoRAAEFAQAAAAAAAAAAAAAAAAMAAQIhI5H/2gAIAQIBAT8Acxa0l1f/xAAaEQACAgMAAAAAAAAAAAAAAAACAwARATFR/9oACAEDAQE/ABSnN2sN8n//2Q==",blurWidth:8,blurHeight:6},"luma-photon-flash-1":{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/luma-photon-flash-1.d9455e5d.jpg",height:500,width:616,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/2wBDAQoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/wgARCAAGAAgDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAX/xAAUAQEAAAAAAAAAAAAAAAAAAAAF/9oADAMBAAIQAxAAAACSAlv/xAAZEAEAAgMAAAAAAAAAAAAAAAACACEEExb/2gAIAQEAAT8A6jPa1puzVz//xAAaEQACAgMAAAAAAAAAAAAAAAABAgADMUFR/9oACAECAQE/AHrQHeOmf//EABgRAQADAQAAAAAAAAAAAAAAAAEAAlGR/9oACAEDAQE/ACzhwn//2Q==",blurWidth:8,blurHeight:6},"playground-2.5":{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/playground-2.5.19b22551.jpg",height:500,width:616,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/2wBDAQoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/wgARCAAGAAgDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAX/xAAUAQEAAAAAAAAAAAAAAAAAAAAC/9oADAMBAAIQAxAAAACEGf/EAB0QAAEDBQEAAAAAAAAAAAAAAAIBAwUABBQhQlH/2gAIAQEAAT8AupUJVhchjbYKRH0Q+V//xAAZEQABBQAAAAAAAAAAAAAAAAADAAECEiH/2gAIAQIBAT8AgYmtZf/EABoRAAICAwAAAAAAAAAAAAAAAAMhAAERInH/2gAIAQMBAT8AsQ1rjin/2Q==",blurWidth:8,blurHeight:6},"playground-3":{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/playground-3.0cdef738.jpg",height:500,width:616,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/2wBDAQoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/wgARCAAGAAgDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAP/xAAVAQEBAAAAAAAAAAAAAAAAAAACBf/aAAwDAQACEAMQAAAAoJ4//8QAGxAAAgEFAAAAAAAAAAAAAAAAAQMEAAIFEXP/2gAIAQEAAT8AVOZGxQfYpOuYr//EABoRAQACAwEAAAAAAAAAAAAAAAEDIQACEiL/2gAIAQIBAT8Ai9snS1uhef/EABgRAAMBAQAAAAAAAAAAAAAAAAECAwAS/9oACAEDAQE/AIQjQOzTBPbb/9k=",blurWidth:8,blurHeight:6},"recraft-v3":{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/recraft-v3.2bd50396.jpg",height:500,width:616,blurDataURL:"data:image/jpeg;base64,/9j/2wBDAAoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/2wBDAQoKCgoKCgsMDAsPEA4QDxYUExMUFiIYGhgaGCIzICUgICUgMy03LCksNy1RQDg4QFFeT0pPXnFlZXGPiI+7u/v/wgARCAAGAAgDASIAAhEBAxEB/8QAFQABAQAAAAAAAAAAAAAAAAAAAAP/xAAVAQEBAAAAAAAAAAAAAAAAAAABBP/aAAwDAQACEAMQAAAAkJH/xAAbEAACAQUAAAAAAAAAAAAAAAACAwABBQYRE//aAAgBAQABPwBmXXhVFn12JT//xAAZEQADAAMAAAAAAAAAAAAAAAABAiEAMUH/2gAIAQIBAT8ASrSdnuf/xAAWEQEBAQAAAAAAAAAAAAAAAAABAAL/2gAIAQMBAT8AdIt//9k=",blurWidth:8,blurHeight:6},"recraft-v3-svg":{src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/recraft-v3-svg.98cb7b01.svg",height:1024,width:1820,blurWidth:0,blurHeight:0},"stable-diffusion-xl-v1-0":t9}},lt=(0,tq.R)((e,t)=>{let{model:l,...n}=e;return(0,a.jsx)(eN.W,{children:(0,C.createElement)(D.k,{...n,ref:t,key:l.model},(0,a.jsxs)(O.s,{justify:"space-between",align:"center",width:"100%",children:[(0,a.jsxs)(O.s,{justify:"start",align:"center",children:[(0,a.jsx)(eD._,{src:l.image.src,w:"1.5em",h:"1.5em",objectFit:"contain"}),(0,a.jsx)(f.E,{ps:2,fontSize:"sm",children:l.label()})]}),(0,a.jsx)(f.E,{color:"gray.400",fontSize:"xs",children:l.creatorLabel()})]}))})});lt.id="MenuItemOption";let ll=e=>{let{productKey:t,productFeature:l,canUseTier:n,styles:o}=e;return(0,a.jsxs)(O.s,{justify:"start",align:"center",width:"100%",children:[(0,a.jsx)(f.E,{sx:{...o.groupTitle,marginInlineEnd:2},children:(0,tX.kf)(t).header}),l&&(0,a.jsx)(t1,{canUseFeature:n,productFeature:l})]})},la=e=>{let{availableModels:t,handleModelSelect:l,canUsePlusModels:n,canUseProModels:o,selectedModel:i,isDisabled:r}=e,[s,d]=(0,C.useState)(null),u=(0,tK.o5)("Menu",{}),c=e=>{let{tier:n}=e;return t.filter(e=>(0,L.kO)(e.model)===n).map(e=>(0,a.jsx)(lt,{model:e,value:e.model,onClick:()=>l(e.model,n),onMouseEnter:()=>d(e)},e.model))};return(0,a.jsx)(M.MJ,{children:(0,a.jsxs)(E.W,{isLazy:!0,children:[(0,a.jsx)(T.I,{as:w.$,variant:"plain",isDisabled:r,w:"100%",textAlign:"start",justifyContent:"space-between",rightIcon:(0,a.jsx)(S.g,{icon:x.Jt$}),boxShadow:"none",size:"sm",children:(0,a.jsxs)(m.z,{spacing:2,children:[(0,a.jsx)(O.s,{width:"24px",height:"24px",align:"center",justify:"center",children:(0,a.jsx)(eD._,{src:i.image.src,w:"1.25em",h:"1.25em",objectFit:"contain"})}),(0,a.jsx)(f.E,{as:"span",flex:1,children:null==i?void 0:i.label()})]})}),(0,a.jsx)(tJ.Z,{children:(0,a.jsxs)(eP.A,{isLazy:!0,variant:"modal",placement:"start-start",matchWidth:!1,offset:[0,0],trigger:"hover",children:[(0,a.jsx)(t$.d,{children:(0,a.jsx)(P.c,{minWidth:"250px",w:"350px",maxH:"350px",overflowY:"auto",overflowX:"hidden",zIndex:"modalPopover",border:"1px solid",borderColor:"gray.200",onMouseLeave:()=>d(null),children:(0,a.jsxs)(N.i,{type:"radio",value:i.model,children:[(0,a.jsx)(ll,{productKey:"free",canUseTier:!0,styles:u}),c({tier:"free"}),(0,a.jsx)(tQ.N,{}),(0,a.jsx)(ll,{productKey:"plus",productFeature:"ai_models_plus",canUseTier:n,styles:u}),c({tier:"plus"}),(0,a.jsx)(tQ.N,{}),(0,a.jsx)(ll,{productKey:"pro",productFeature:"ai_premium_models",canUseTier:o,styles:u}),c({tier:"pro"})]})})}),!(0,t4.Xb)()&&s&&(0,a.jsx)(eL.h,{width:"282px",children:(0,a.jsx)(t7,{label:s.label,description:s.description,image:s.image,popoverImage:le.None[s.model],bestStyle:s.bestStyle,bestType:s.bestType,speed:s.speed})})]})})]})})},ln=e=>{let{value:t,setValue:l,isDisabled:n}=e,o=(0,L.pE)(t),i=(0,Q.GV)(X.Jo),r=(0,$.ez)("ai_models_plus",null==i?void 0:i.organization),s=(0,$.ez)("ai_premium_models",null==i?void 0:i.organization),{openUpsellModal:d}=(0,t2.I)(),u=(0,C.useCallback)((e,t)=>{if("plus"!==t||r){if("pro"===t&&!s){d({segmentEvent:t6.VV.GAMMA_UPSELL_CALLOUT_AI_IMAGE_MODELS,eventProperties:{model:e}});return}}else{d({segmentEvent:t6.VV.GAMMA_UPSELL_CALLOUT_AI_IMAGE_MODELS,eventProperties:{model:e}});return}l(e)},[r,s,d,l]);return(0,a.jsx)(la,{handleModelSelect:u,canUsePlusModels:r,canUseProModels:s,availableModels:(0,L.vp)().filter(e=>(0,L.CX)(e.model)),selectedModel:{...o,model:t},isDisabled:n})};var lo=l(34363),li=l(65446),lr=l(18658),ls=l(82680),ld=l(88865),lu=l(73893);let lc=async e=>{let{imageUrl:t,upscaleFactor:l}=e,a="".concat(lu.$.API_HOST||"https://api.gamma.app","/media/images/upscale"),n=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({image:t,upscaleFactor:l})});if(!n.ok){let e=await n.json();throw Error("".concat(e.error,": ").concat(e.message),e)}return(await n.json()).data},lm=e=>{let{canGenerate:t,isEnhancingPrompt:l,images:n,loadMore:i,canLoadMore:r,isLoadingMore:d}=e,{isOpen:u,onOpen:c,onClose:p}=(0,eO.j)(),[g,h]=(0,C.useState)([]),[b,v]=(0,C.useState)(2),[k,x]=(0,C.useState)(!1),[S,z]=(0,C.useState)(!1),I=(0,tp.d)(),j=(0,C.useCallback)(e=>{h(t=>t.includes(e.id)?t.filter(t=>t!==e.id):[...t,e.id])},[]),F=(0,C.useCallback)(()=>{S?h([]):h(n.map(e=>e.id)),z(!S)},[n,S]),B=(0,C.useCallback)(async e=>{let t=atob(e),l=Array(t.length);for(let e=0;e{x(!0);let e=n.filter(e=>g.includes(e.id)),t=1;await Promise.all(e.map(async e=>{B(await lc({imageUrl:e.attrs.src,upscaleFactor:b})),I({title:"Image ".concat(t," downloaded"),status:"success",duration:3e3,isClosable:!0}),t++})),x(!1)},[n,g,b,x,I,B]);return(0,a.jsxs)(s.T,{spacing:4,align:"stretch",children:[(0,a.jsx)(w.$,{variant:"outline",isDisabled:!t||l,onClick:c,px:12,children:(0,a.jsx)(A.x6,{id:"DN9OsQ"})}),(0,a.jsxs)(th.aF,{isOpen:u,onClose:p,size:"2xl",scrollBehavior:"inside",children:[(0,a.jsx)(tb.m,{}),(0,a.jsxs)(ty.$,{children:[(0,a.jsx)(lo.r,{children:(0,a.jsx)(A.x6,{id:"Ud0Jjb"})}),(0,a.jsx)(li.s,{}),(0,a.jsxs)(lr.c,{children:[(0,a.jsx)(eU.r,{gap:2,columns:5,children:n.map(e=>(0,a.jsx)(lf,{image:e,isSelected:g.includes(e.id),onSelectImage:j},e.id))}),r&&(0,a.jsx)(w.$,{variant:"plain",onClick:i,mt:4,isLoading:d,children:(0,a.jsx)(A.x6,{id:"yQ2kGp"})})]}),(0,a.jsxs)(ls.j,{justifyContent:"space-between",children:[(0,a.jsxs)(m.z,{spacing:2,children:[(0,a.jsx)(ld.S,{checked:S,onChange:F}),(0,a.jsx)(f.E,{size:"sm",children:(0,a.jsx)(A.x6,{id:"wgNoIs"})})]}),(0,a.jsxs)(m.z,{spacing:4,children:[(0,a.jsx)(td.Tz,{placement:"top",label:(0,a.jsx)(A.x6,{id:"UiTWCg"}),children:(0,a.jsx)(y.D,{size:"sm",children:(0,a.jsx)(A.x6,{id:"yT2JRA"})})}),(0,a.jsx)(w.$,{variant:"solid",mr:3,onClick:R,isLoading:k,isDisabled:0===g.length,children:o.Ru._({id:"0/T2Xv",values:{0:g.length}})})]})]})]})]})]})},lf=e=>{let{image:t,isSelected:l,onSelectImage:n}=e,o=(0,eQ.QV)(t.attrs.src);return(0,a.jsx)(tw.E,{children:(0,a.jsx)(w.$,{borderRadius:"base",display:"block",variant:"ghost",width:"100%",opacity:1,height:"100px",textAlign:"left",pos:"relative",p:0,_hover:{shadow:"outline"},_active:{shadow:"outline"},transition:"box-shadow .2s ease",cursor:"pointer",onClick:()=>n(t),backgroundImage:o,backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center",sx:{_focusVisible:{".attribution-container":{opacity:1}},_hover:{".attribution-container":{opacity:1}}},"data-testid":"image-search-grid-item",role:"group",children:(0,a.jsx)(tx.z,{in:l,children:(0,a.jsx)(p.az,{pointerEvents:"none",color:"white",pos:"absolute",inset:0,bg:"rgba(0,0,0,.5)",borderRadius:"base",children:(0,a.jsx)(tS.o,{h:"100%",w:"100%",children:(0,a.jsx)(S.g,{icon:x.e68})})})})})},t.id)},lp=e=>(0,_.u)("aiImageEditing")?(0,a.jsx)(tr,{...e,generateTab:(0,a.jsx)(lg,{...e})}):(0,a.jsx)(lg,{...e}),lg=e=>{var t,l,n,i;let{currentAttributes:M,updateAttributes:E,editor:T,contextualTheme:O,savedMediaContext:P}=e,N=(0,C.useRef)(null),D=(0,Q.GV)(eK.Gd),L=(0,Q.GV)(X.Jo),W=null==L?void 0:L.id,{hasEnoughCreditsToGenerateImage:U}=(0,R.B9)(),H=(0,_.u)("aiGeneratedImagesAdvancedOptions"),{isInOfflineMode:V}=(0,j.utY)(),q=(0,Q.GV)((0,ea.A1)(null==L?void 0:null===(t=L.organization)||void 0===t?void 0:t.id)),K=(0,C.useMemo)(()=>T?"doc":"user",[T]),[J,$]=(0,C.useState)(K),{prompt:Y,addPrompt:Z,promptPageInfo:ee,nextPrompt:et,prevPrompt:el,model:en,setModel:ei,stylePreset:er,setStylePreset:es,stylePrompt:eu,setStylePrompt:ec,aspectRatio:em,setAspectRatio:ef,negativePrompt:eh,setNegativePrompt:eb,count:ey,setCount:ev,steps:ek,setSteps:ew,cfgScale:ex,setCfgScale:eA,getStylePromptFromPreset:eC,stylePresetOptions:ez,getPresetDisplayMetadata:eI,getThemeNameFromStylePrompt:ej,imageGenerateConfig:eF,loadImageAiParams:eB,resetImageAiParams:eR,isPromptDirty:e_}=eM({contextualTheme:O,lastUsedImageGenerationSettingsInDoc:null==T?void 0:null===(n=T.getAttributes("document"))||void 0===n?void 0:null===(l=n.aiOptions)||void 0===l?void 0:l.imageOptions,aiParams:null==M?void 0:M.aiParams,savedMediaContext:P}),eE=e_(M),eO=(0,eJ.M)(T),{isEnhancing:eP,setIsEnhancing:eN,runEnhanceImagePrompt:eD}=ed({editor:(null==T?void 0:T.parentEditor)||T,prompt:(null==T?void 0:T.isSiteNavbarEditor)?"Logo for ".concat(null==D?void 0:D.name):Y,stylePrompt:eu,addPrompt:Z}),{history:eL,loadMore:eW,canLoadMore:eU,isLoading:eG,isLoadingMore:eV,deleteImage:eY,isDeleting:eX}=eo({docId:W,scope:J,savedMediaContext:P}),eZ=(0,C.useCallback)(e=>{eB(e.attrs,"select"),E({tempUrl:(0,eQ.Ub)(e.attrs.src,eQ.p7,e.attrs.meta),showPlaceholder:!1,...e.attrs}),T&&eO(T.state.selection.from)},[T,eB,eO,E]),{generate:e0,isGenerating:e1,hasError:e2,errorMessage:e6}=tV({selectImage:eZ,savedMediaContext:P}),e4=(0,r.m)(),e5=(null==M?void 0:M.source)==="image.ai-generated"&&!!(null==M?void 0:M.src),e3=null==M?void 0:M.savedMediaId;(0,e$.Vg)(()=>{var e;!e1&&(e5&&(null==M?void 0:null===(e=M.aiParams)||void 0===e?void 0:e.prompt)?eB(M,"load"):!e5&&(null==M?void 0:M.query)&&Z(M.query,"load"))},[Z,M,e5,eB,e1],[M]),(0,C.useEffect)(()=>{setTimeout(()=>{var e;V||null===(e=N.current)||void 0===e||e.focus()},200)},[]);let e8=(0,C.useMemo)(()=>{var e;return(null==M?void 0:null===(e=M.aiParams)||void 0===e?void 0:e.interactionId)||""},[M]),{savedMedia:e7}=eg(e8,(null==M?void 0:null===(i=M.aiParams)||void 0===i?void 0:i.prompt)||""),e9=(0,C.useCallback)(()=>{var e,t,l;if(!T)return null;let{stylePreset:a,model:n,stylePrompt:o}=eF,i=T.getAttributes("document"),r={stylePreset:a,model:n,stylePrompt:a===eS.Custom?o:null!==(l=null===(t=i.aiOptions)||void 0===t?void 0:null===(e=t.imageOptions)||void 0===e?void 0:e.stylePrompt)&&void 0!==l?l:""};T.commands.updateNestedAttributesAtPos(0,{aiOptions:{imageOptions:r}})},[T,eF]);(0,C.useEffect)(()=>{e1&&!(null==M?void 0:M.showPlaceholder)&&(null==M?void 0:M.src)?E({showPlaceholder:!0,loadImageStatus:"queued",loadImageParams:{provider:"aiGenerated",query:Y,options:eF}}):!e1&&(null==M?void 0:M.loadImageStatus)==="queued"&&(null==M?void 0:M.src)&&E({...M,loadImageStatus:"done"})},[e1]);let te=(0,C.useCallback)(async()=>{if(!eP&&!e1)try{if(0===Y.trim().length){let e=await eD();e&&await e0({...eF,prompt:e})}else await e0({...eF,prompt:Y});e9()}catch(e){console.error("Error generating AI image",e)}finally{e4.refetchQueries({include:["GetSavedMedia","GetWorkspaceSavedMedia","GetUserSavedMedia"]}),eN(!1)}},[eP,e1,Y,e9,eD,e0,eF,e4,eN]);(0,C.useEffect)(()=>{(null==M?void 0:M.query)||eP||eD()},[]);let tt=(0,R.tO)(te,"generateImage",eq.VV.GAMMA_UPSELL_CALLOUT_AI_CREDITS_IMAGES),tl=(0,C.useCallback)(e=>{"Enter"===e.key&&e.metaKey&&(e.preventDefault(),tt()),e.stopPropagation()},[tt]),{saveImageRating:ta}=ep(),tn=(0,C.useCallback)(e=>{var t;(null==M?void 0:null===(t=M.aiParams)||void 0===t?void 0:t.interactionId)&&((0,I.WN)({rating:e,aiParams:M.aiParams,imageUrl:M.src,interactionId:M.aiParams.interactionId}),ta(M,e))},[M,ta]),to=(0,C.useCallback)(async e=>{if(await eY(e),e===e3){let t=e7.filter(t=>t.id!==e);t.length>0?eZ(t[0]):E({...M,savedMediaId:"",src:"",tempUrl:""})}},[eY,M,e7,eZ,e3,E]),ti=(null==M?void 0:M.source)==="image.ai-generated";return(0,a.jsxs)(s.T,{spacing:4,align:"stretch",translate:"no",children:[ti&&(0,a.jsx)(tF,{imagesMatchingInteractionId:e8?e7:[],currentAttributes:M,isGenerating:e1,isDeleting:eX,selectedSavedMediaId:null!=e3?e3:"",selectImage:eZ,onRateImage:tn,deleteImage:to}),e2&&(0,a.jsxs)(d.F,{status:"error",flexDirection:"row",alignItems:"start",justifyContent:"start",borderRadius:"md",children:[(0,a.jsx)(u._,{}),(0,a.jsx)(c.T,{children:e6})]}),(0,a.jsxs)(s.T,{align:"stretch",spacing:4,children:[(0,a.jsxs)(s.T,{align:"stretch",spacing:1,children:[(0,a.jsx)(m.z,{position:"relative",align:"center",justify:"space-between",children:(0,a.jsx)(f.E,{fontSize:"sm",fontWeight:"semibold",color:e1?"gray.500":"",children:(0,a.jsx)(A.x6,{id:"sU1/3l"})})}),(0,a.jsxs)(p.az,{position:"relative",children:[(0,a.jsx)(z._,{ref:N,isDisabled:e1,placeholder:eP||P===j.rWX.Theme?"":P===j.rWX.Dashboard?o.Ru._({id:"+VHqP0"}):o.Ru._({id:"6RfNWb"}),onKeyDown:tl,value:Y,onChange:e=>Z(e.target.value,"update"),"data-testid":"image-search-input",rows:5,initialHeight:"65px",bottomSpacing:35}),T&&(0,a.jsx)(tE,{isEnhancingPrompt:eP,isGenerating:e1,runEnhancePrompt:eD})]}),ee.total>1&&(0,a.jsx)(eT,{alignSelf:"end",promptPageInfo:ee,nextPrompt:et,prevPrompt:el,isDisabled:e1||eP})]}),(0,a.jsxs)(s.T,{align:"stretch",gap:4,children:[(0,a.jsxs)(s.T,{align:"stretch",children:[(0,a.jsx)(f.E,{fontSize:"sm",fontWeight:"semibold",color:e1?"gray.500":"",children:(0,a.jsx)(A.x6,{id:"1CalO6"})}),(0,a.jsx)(eH,{stylePreset:er,stylePrompt:eu,setStylePrompt:ec,setStylePreset:es,presetOptions:ez,isDisabled:e1,contextualTheme:O,getThemeNameFromStylePrompt:ej,getPresetDisplayMetadata:eI,onKeyDown:tl,getStylePromptFromPreset:eC})]}),(0,a.jsxs)(m.z,{w:"100%",children:[(0,a.jsxs)(s.T,{w:"100%",align:"stretch",children:[(0,a.jsx)(f.E,{fontSize:"sm",fontWeight:"semibold",color:e1?"gray.500":"",children:(0,a.jsx)(A.x6,{id:"iKM2jY"})}),(0,a.jsx)(G,{value:em,setValue:ef,model:en,isDisabled:e1})]}),(0,a.jsxs)(s.T,{w:"100%",align:"stretch",children:[(0,a.jsx)(f.E,{fontSize:"sm",fontWeight:"semibold",color:e1?"gray.500":"",children:(0,a.jsx)(A.x6,{id:"scu3wk"})}),en&&(0,a.jsx)(ln,{value:en,setValue:ei,isDisabled:e1})]})]})]}),H&&(0,a.jsx)(g.n,{allowToggle:!0,children:(0,a.jsxs)(h.A,{children:[(0,a.jsxs)(b.J,{children:[(0,a.jsx)(p.az,{as:"span",flex:"1",textAlign:"start",children:(0,a.jsx)(y.D,{size:"sm",children:(0,a.jsx)(A.x6,{id:"sxkWRg"})})}),(0,a.jsx)(v.Q,{})]}),(0,a.jsx)(k.v,{pb:4,children:(0,a.jsx)(tu,{enabled:!0,isGenerating:e1,negativePrompt:eh,setNegativePrompt:eb,count:ey,setCount:ev,steps:ek,setSteps:ew,cfgScale:ex,setCfgScale:eA,model:en})})]})}),(0,a.jsxs)(s.T,{spacing:1,align:"stretch",children:[(0,a.jsxs)(w.$,{variant:"solid",isLoading:e1,isDisabled:eP,onClick:tt,px:12,children:[(0,a.jsx)(A.x6,{id:"OSaxlZ"}),(0,a.jsx)(B.G,{type:"generateImage",position:"absolute",insetEnd:4})]}),T&&(0,a.jsx)(w.$,{onClick:()=>eR(M),leftIcon:(0,a.jsx)(S.g,{icon:x.ub2}),isDisabled:!eE||e1,sx:{opacity:eE?1:.5,transition:"opacity 0.2s ease-in-out",_hover:{color:eE?"trueblue.500":""}},children:(0,a.jsx)(A.x6,{id:"L+rMC9"})}),(0,a.jsx)(F.f,{modalId:"ai-credits-modal-message-list",variant:"ghost",justify:"flex-end",segmentEvent:eq.VV.GAMMA_UPSELL_CALLOUT_AI_CREDITS_IMAGES}),H&&(0,a.jsx)(lm,{canGenerate:U,isEnhancingPrompt:eP,images:eL,loadMore:eW,canLoadMore:eU,isLoadingMore:eV})]})]}),T&&(q?(0,a.jsx)(tL,{onSelectImage:eZ,savedMediaId:e3,currentAttributes:M,scope:J,setScope:$,canLoadMore:eU,loadMore:eW,isLoading:eG,isLoadingMore:eV,history:eL,deleteImage:to,isDeleting:eX,resizeThumbnails:!0}):(0,a.jsx)(tO,{onSelectImage:eZ,savedMediaId:e3,currentAttributes:M,scope:J,setScope:$,canLoadMore:eU,loadMore:eW,isLoading:eG,isLoadingMore:eV,history:eL,deleteImage:to,isDeleting:eX,resizeThumbnails:!0}))]})};lp.key="image.ai-generated";var lh=l(90406),lb=l(21098),ly=l(66712);let lv=e=>{let{editor:t,updateAttributes:l,currentAttributes:n,urlPlaceholder:o,embedTip:i}=e,r=(0,lh.Zj)(n);return(0,a.jsxs)(s.T,{align:"flex-start",spacing:4,children:[(0,a.jsx)(ly.VG,{currentUrl:r,updateAttributes:l,placeholder:o||"https://..."}),i,r&&(0,a.jsx)(lb.p,{editor:t,updateAttributes:l,currentAttributes:n})]})};var lk=l(69237),lw=l(3706);let lx=e=>{let{guideLink:t,extraMessage:l,providerName:n}=e;return(0,a.jsxs)(d.F,{status:"info",children:[(0,a.jsx)(u._,{}),(0,a.jsx)(c.T,{children:(0,a.jsx)(A.x6,{id:"qBttXb",values:{providerName:n,extraMessage:l},components:{0:(0,a.jsx)(lw.N,{href:t,textDecoration:"underline",isExternal:!0}),1:(0,a.jsx)(lk.p,{mx:"2px"})}})})]})},lS=e=>(0,a.jsx)(lv,{...e,urlPlaceholder:"https://airtable.com/...",embedTip:(0,a.jsx)(lx,{guideLink:"https://support.airtable.com/docs/embedding-airtable-views",providerName:"Airtable",extraMessage:(0,a.jsx)(A.x6,{id:"gsZDsS"})})});lS.key="embed.airtable";let lA=e=>{let{editor:t,updateAttributes:l,currentAttributes:n}=e,o=(0,lh.Zj)(n);return(0,a.jsxs)(s.T,{align:"flex-start",spacing:4,children:[(0,a.jsx)(ly.VG,{currentUrl:o,updateAttributes:l,placeholder:"{let{updateAttributes:t,currentAttributes:l}=e;return(0,a.jsx)(lz.O,{updateAttributes:t,currentImageUrl:l.src,defaultQuery:l.query||"",enableSearch:!0,enablePagination:!1,provider:"bing",resultsPerPage:lC.s.count})};lI.key="image.bing";let lj=e=>(0,a.jsx)(lv,{...e,urlPlaceholder:"https://calendly.com/..."});lj.key="embed.calendly";var lF=l(91559),lB=l(87747),lR=l(94007),l_=l(20053),lM=l(99742),lE=l(79893),lT=l(31018),lO=l(4977);let lP=e=>{let{updateAttributes:t,editType:l,editor:a,source:n}=e,o=(0,Q.GV)(X.aQ),{currentWorkspace:i}=(0,et.ur)(),{orgId:r,templateId:s}=(0,lB.PJ)(o||(null==i?void 0:i.id),l),d=(0,C.useRef)(null),u=(0,C.useCallback)(e=>{let{tempUrl:l,attributes:a}=e;t({uploadStatus:lO.A.Uploading,showPlaceholder:!1,tempUrl:l,src:null,...a}),d.current=l},[t]),c=(0,C.useCallback)((e,o)=>{let i=d.current||o;if(i){if("node"!==l||!a){t({...(0,lE.yK)({result:e,isError:!1}),source:n});return}(0,lE.Ki)(a,i,e),d.current=null}},[a,l,t,n]),m=(0,C.useCallback)(e=>{if(!d.current||!a){t((0,lE.yK)({isError:!0}));return}(0,lE.wt)(a,d.current,e)},[a,t]),f=(0,C.useCallback)(e=>{if(!r){console.error("[CustomImagePanel] saveImageFromDataURL - No orgId!");return}u({tempUrl:e});try{let t=(0,eQ.Xz)(e,"image");(0,lT.QM)(t,r,{onUploadComplete:c,onOriginalFileUpload:c,onUploadFailed:m},l,void 0,s)}catch(e){m()}},[l,r,m,u,c,s]),p=(0,C.useCallback)(e=>{if(!r){console.error("[CustomImagePanel] saveImageFromUrl - No orgId!");return}u({tempUrl:e});try{(0,lT.j_)(e,r,{onUploadComplete:c,onOriginalFileUpload:c,onUploadFailed:m},l,s)}catch(e){m()}},[l,r,m,u,c,s]),g=(0,C.useCallback)(async e=>{let{blob:t,attributes:a}=e;if(!r){console.error("[QRCodePanel] saveImageFromDataBlob - No orgId!");return}u({tempUrl:window.URL.createObjectURL(t),attributes:a});try{let e=(0,eQ.Xl)({blob:t,filename:"image",ext:"svg"});return await (0,lT.QM)(e,r,{onUploadComplete:c,onOriginalFileUpload:c,onUploadFailed:m},l)}catch(e){m()}},[l,r,m,u,c]),h=(0,C.useCallback)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t({uploadStatus:lO.A.Uploading,showPlaceholder:!0,tempUrl:e,src:null})},[t]),b=(0,C.useCallback)(e=>{let{file:t,tempUrl:l}=e;if(t.type&&(0,eQ.aI)(t.type)){let e="HEIC_tempId_".concat((0,lM.Ak)());h(e),u({tempUrl:e})}else u({tempUrl:l})},[h,u]);return{setTempUrl:u,setUploadedImage:c,saveImageFromDataURL:f,saveImageFromUrl:p,saveImageFromDataBlob:g,onUploadStart:b,setUploadFailed:(0,C.useCallback)(()=>{t((0,lE.yK)({isError:!0}))},[t])}},lN=e=>{let{editor:t,editType:l,updateAttributes:n,currentAttributes:i,resetToPlaceholder:r}=e,{onUploadStart:m,setUploadedImage:p,saveImageFromUrl:g,saveImageFromDataURL:h,setUploadFailed:b}=lP({updateAttributes:n,editor:t,editType:l,source:"image.custom"}),v=(0,Q.GV)(X.aQ),{currentWorkspace:k}=(0,et.ur)(),{isInOfflineMode:x}=(0,lF.u)(),{orgId:S,templateId:C,useStandardThemeBucket:z}=(0,lB.PJ)(v||(null==k?void 0:k.id),l),{src:I,tempUrl:j,meta:F,name:B,showPlaceholder:R,uploadStatus:_}=i,M=I?(0,eQ.bI)(I,{width:500}):void 0;return(I||j||R)&&((null==i?void 0:i.source)==="image.custom"||_===lO.A.Uploading)?(0,a.jsxs)(s.T,{align:"flex-start",spacing:4,children:[_===lO.A.Uploading&&(0,a.jsxs)(d.F,{status:"info",size:"sm",children:[(0,a.jsx)(u._,{as:e4.y,w:5,h:5}),(0,a.jsx)(c.T,{children:(0,a.jsx)(A.x6,{id:"MEDU34"})})]}),R?(0,a.jsx)(lR.Pf,{isUploading:_===lO.A.Uploading,hasUploadError:_===lO.A.Error,width:"100%",height:"200px",borderRadius:"md"}):(0,a.jsx)(eD._,{src:M||j,alt:"",ignoreFallback:!0,borderRadius:"md"}),F&&F.width&&F.height&&(0,a.jsxs)(f.E,{children:[F.width,"\xd7",F.height,"px"]}),B&&(0,a.jsx)(f.E,{children:B}),(0,a.jsx)(w.$,{onClick:r,mt:2,w:"100%",children:(0,a.jsx)(A.x6,{id:"HUPV+K"})})]}):(0,a.jsxs)(s.T,{align:"stretch",spacing:4,children:[z&&(0,a.jsxs)(d.F,{status:"warning",size:"sm",children:[(0,a.jsx)(u._,{}),(0,a.jsx)(c.T,{children:"[Admin] Theme images will be uploaded to production theme_images bucket"})]}),_===lO.A.Error&&(0,a.jsxs)(d.F,{status:"error",size:"sm",children:[(0,a.jsx)(u._,{}),(0,a.jsx)(c.T,{children:(0,a.jsx)(A.x6,{id:"GymiXM"})})]}),(0,a.jsx)(y.D,{size:"md",children:(0,a.jsx)(A.x6,{id:"IagCbF"})}),(0,a.jsx)(ly.VG,{currentUrl:"",placeholder:o.Ru._({id:"jurEzE"}),handleSubmit:g,handleDataSubmit:h,noHeader:!0}),!x&&(0,a.jsx)(y.D,{size:"md",children:(0,a.jsx)(A.x6,{id:"ONWvwQ"})}),S&&(0,a.jsx)(l_.Z,{onUploadSuccess:p,onUploadStart:m,onUploadFailed:b,orgId:S,uploadType:"image",editType:l,templateId:C,tipText:o.Ru._({id:"x4Ts51"})})]})};lN.key="image.custom";let lD=e=>{let{editor:t,updateAttributes:l,currentAttributes:n}=e,i=(0,lh.Zj)(n);return(0,a.jsxs)(s.T,{align:"flex-start",spacing:4,children:[(0,a.jsx)(ly.VG,{currentUrl:i,updateAttributes:l,placeholder:o.Ru._({id:"gzZk6e"})}),i&&(0,a.jsx)(lb.p,{editor:t,updateAttributes:l,currentAttributes:n})]})};lD.key="video.custom";let lL=e=>{let{editor:t,updateAttributes:l,currentAttributes:n}=e,o=(0,lh.Zj)(n);return(0,a.jsxs)(s.T,{align:"flex-start",spacing:4,children:[(0,a.jsx)(ly.VG,{currentUrl:o,updateAttributes:l,placeholder:"https://www.figma.com/file/..."}),(0,a.jsx)(lx,{guideLink:"https://help.figma.com/hc/en-us/articles/360039827134-Embed-files-and-prototypes",providerName:"Figma/FigJam"}),o&&(0,a.jsx)(lb.p,{editor:t,updateAttributes:l,currentAttributes:n})]})};lL.key="embed.figma";let lW=e=>{let{editor:t,updateAttributes:l,currentAttributes:n}=e,o=(0,lh.Zj)(n);return(0,a.jsxs)(s.T,{align:"flex-start",spacing:4,children:[(0,a.jsx)(ly.VG,{currentUrl:o,updateAttributes:l,placeholder:"https://gamma.app/docs/..."}),o&&(0,a.jsx)(lb.p,{editor:t,updateAttributes:l,currentAttributes:n})]})};lW.key="embed.gamma";var lU=l(37786),lG=l.n(lU);let lH=["funny","surprise","hooray","welcome","excited","nope","fail","sad","cry","angry","teamwork","cats","dogs","high five"],lV=e=>{let{updateAttributes:t,currentAttributes:l}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(lz.O,{updateAttributes:t,currentImageUrl:l.src,defaultQuery:l.query,randomQueries:lH,provider:"giphy"}),(0,a.jsx)(O.s,{width:"100%",justify:"center",padding:"10px",paddingTop:"30px",children:(0,a.jsx)(p.az,{maxW:"150px",children:(0,a.jsx)(lG(),{src:"/images/powered-by-giphy.png",width:"150",height:"17",alt:"Powered by GIPHY"})})})]})};lV.key="image.giphy";let lq=e=>(0,a.jsx)(lv,{...e,urlPlaceholder:"https://docs.google.com/...",embedTip:(0,a.jsx)(lx,{guideLink:"https://support.google.com/docs/answer/183965?hl=en&co=GENIE.Platform%3DDesktop#zippy=%2Cedit-embedded-spreadsheets%2Cembed-a-document-spreadsheet-or-presentation",extraMessage:(0,a.jsx)(A.x6,{id:"G6PCHK",values:{GAMMA_ARTIFACT_PROPER_NOUN:tM.TP}}),providerName:"Google Sheets, Docs, or Slides"})});lq.key="embed.gdrive";let lK=e=>(0,a.jsx)(lv,{...e,urlPlaceholder:"https://docs.google.com/forms/..."});lK.key="embed.google.form";let lJ=e=>{let{updateAttributes:t,currentAttributes:l}=e;return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(lz.O,{updateAttributes:t,currentImageUrl:l.src,defaultQuery:l.query||"",provider:"google"})})};lJ.key="image.google";var l$=l(39324),lQ=l.n(l$),lY=l(1602),lX=l.n(lY),lZ=l(25676);let l0={soft:{name:"Soft",spin:[0,-40,40],lighten:[0,0,0]},duo:{name:"Duo",spin:[0,180],lighten:[0,0]},crescent:{name:"Crescent",spin:[0,-45,45,-90,90],lighten:[0,0,0,0,0]},wisp:{name:"Wisp",spin:[0,72,216],lighten:[0,0,0]},mono:{name:"Mono",spin:[0,0,0],lighten:[0,20,40]},cosmos:{name:"Cosmos",spin:[0,72,144,216,288],lighten:[0,0,0,0,0]}},l1=e=>{let t=[];e.forEach((e,l)=>{let a=e.setAlpha(1),n=a.toHsl().h*l,o="radial-gradient(circle at ".concat(2*n%360/360*50,"% ").concat(3*n%360/360*50,"%, ").concat(a.setAlpha(.5).toHex8String()," 0, ").concat(a.setAlpha(0).toHex8String()," ").concat(1*n%360/360*50+50,"%)");t.push(o)});let l=e[0].setAlpha(.5).toHex8String();return t.push("linear-gradient(0deg, ".concat(l," 0%, ").concat(l," 100%)")),{backgroundImage:t.join(",")}},l2=(e,t)=>{let l=l0[e],a=[];return l.spin.forEach(e=>{let l=lX()(t.toHsv()).spin(e);a.push(l)}),l.lighten.forEach((e,t)=>{a[t].lighten(e)}),a},l6=(e,t)=>{let l=l2(e,t),a=l1(l);return{colors:l,gradient:a}},l4=(e,t,l)=>{t.forEach(e=>{e&&(e.style.opacity="0")}),e.forEach((e,a)=>{let n=t[a];if(!n||!l)return;let o=function(e,t){let l=e.offsetWidth,a=lX()(t),n=Math.PI/180*a.toHsl().h,o=-(a.toHsl().l*l)+l;return{x:l/2-o*Math.cos(n),y:l/2-o*Math.sin(n)}}(l,e);n.style.transform="translate(calc(".concat(o.x,"px - 50%),calc(").concat(o.y,"px - 50%))"),n.style.backgroundColor=e.toHexString(),n.style.opacity="1"})},l5=(0,C.forwardRef)(function(e,t){let{isPrimary:l=!1,noTransition:n=!1}=e;return(0,a.jsx)(p.az,{ref:t,borderRadius:"full",boxSize:l?7:5,pos:"absolute",zIndex:l?2:1,shadow:"base",border:"2px solid white",pointerEvents:"none",transitionProperty:n?"none":"transform",transitionDuration:"normal"})}),l3=(0,C.memo)(e=>{let{updateColor:t,colors:l}=e,n=(0,C.useRef)(null),o=(0,C.useRef)(null),i=(0,C.useRef)(null),r=(0,C.useRef)(null),s=(0,C.useRef)(null),d=(0,C.useRef)(null),u=(0,C.useMemo)(()=>[o,i,r,s,d],[]);(0,C.useEffect)(()=>{l4(l,u.map(e=>e.current),n.current)},[l,u]);let c=(0,C.useCallback)(e=>{if(!n.current)return;let l=n.current.getBoundingClientRect();(e.clientX||e.clientY)&&t(function(e,t,l){let a=e.current.offsetWidth,n=e.current.offsetHeight,o=a/2,i=n/2,r=function(e,t,l,a,n){let o=l-e,i=a-t,r=Math.sqrt(i*i+o*o);return ev()(r,0,n)}(t,l,o,i,a/2),s=180/Math.PI*Math.atan2(i-l,o-t),d=s+360*Math.ceil(-s/360)+1,u=Math.abs(-r/a+1);return lX().fromRatio({h:d,s:1,l:u})}(n,e.clientX-l.left,e.clientY-l.top))},[t]),m=(0,C.useCallback)(()=>{document.removeEventListener("mousemove",c)},[c]),f=(0,C.useCallback)(e=>{document.addEventListener("mousemove",c),document.addEventListener("mouseup",m,{once:!0}),c(e)},[c,m]);return(0,a.jsxs)(p.az,{onMouseDown:f,p:4,m:-4,position:"relative",children:[(0,a.jsx)(l5,{ref:o,noTransition:!0,isPrimary:!0}),(0,a.jsx)(l5,{ref:i}),(0,a.jsx)(l5,{ref:r}),(0,a.jsx)(l5,{ref:s}),(0,a.jsx)(l5,{ref:d}),(0,a.jsx)(lZ.g,{ratio:1,children:(0,a.jsxs)(O.s,{ref:n,position:"relative",borderRadius:"full",shadow:"lg",children:[(0,a.jsx)(O.s,{pos:"absolute",borderRadius:"full",bg:"radial-gradient(circle closest-side, rgb(255, 255, 255), transparent)",inset:0,zIndex:1}),(0,a.jsx)(O.s,{pos:"absolute",inset:0,bg:"conic-gradient(red, yellow, lime, aqua, blue, magenta, red)",transform:"rotateZ(270deg)",borderRadius:"full"})]})})]})}),l8={vibe:"mono",primaryColor:"#75d8ff",css:{}},l7=e=>{let{value:t,updateValue:l,isDark:n}=e,{vibe:i,primaryColor:r}={...l8,...t},[s,d]=(0,C.useState)(lX()(r)),{colors:u,gradient:c}=(0,C.useMemo)(()=>l6(i,s),[i,s]),f=(0,C.useCallback)(e=>{let{gradient:t}=l6(i,e);l({vibe:i,primaryColor:e.toHexString(),css:t})},[i,l]),g=(0,e$.wb)(f,100),h=(0,C.useCallback)(e=>{d(e),g(e)},[g]);return(0,a.jsxs)(m.z,{spacing:4,alignItems:"stretch",wrap:"wrap",children:[(0,a.jsx)(p.az,{flex:"1",minW:"120px",children:(0,a.jsx)(l3,{vibe:l0[i],color:s,updateColor:h,colors:u})}),(0,a.jsxs)(e0.B,{flex:"2",spacing:4,minW:"180px",children:[(0,a.jsx)(O.s,{backgroundColor:n?"black":"white",...c,opacity:1,flex:"1",borderRadius:"md",shadow:"md",minH:"80px",mt:2}),(0,a.jsxs)(m.z,{children:[(0,a.jsxs)(E.W,{children:[(0,a.jsx)(T.I,{w:"100%",as:w.$,size:"sm",variant:"plain",textAlign:"left",rightIcon:(0,a.jsx)(S.g,{icon:x.Jt$}),children:l0[i].name}),(0,a.jsx)(P.c,{minWidth:"240px",zIndex:"dropdown",children:(0,a.jsx)(N.i,{onChange:e=>{let{gradient:t}=l6(e,s);l({vibe:e,primaryColor:s.toHexString(),css:t})},value:i,title:o.Ru._({id:"1CalO6"}),type:"radio",children:Object.entries(l0).map(e=>{let[t,{name:l}]=e;return(0,a.jsx)(D.k,{value:t,children:l},t)})})})]}),(0,a.jsx)(tg.e,{size:"sm",variant:"plain",children:(0,a.jsx)(td.Tz,{placement:"top",label:(0,a.jsx)(A.x6,{id:"OVjfHO"}),children:(0,a.jsx)(eE.K,{icon:(0,a.jsx)(S.g,{icon:x.xNJ}),"aria-label":o.Ru._({id:"OVjfHO"}),onClick:()=>{h(lX().fromRatio({h:lQ()(0,360),s:1,l:lQ()(.5,.8)}))}})})})]})]})]})},l9=e=>{let{updateAttributes:t,currentAttributes:l,isDark:n}=e;return(0,a.jsx)(l7,{value:l,updateValue:t,isDark:n})};l9.key="color.gradient";var ae=l(76166),at=l(35436),al=l(20671),aa=l(27372),an=l(73758),ao=l.n(an),ai=l(50933),ar=l.n(ai);let as="60px",ad=(0,C.memo)(e=>{let{icon:t,isSelected:l,onIconClick:n}=e;return(0,a.jsx)(tw.E,{height:as,width:as,children:(0,a.jsx)(w.$,{borderRadius:"base",bgColor:l?"trueblue.100":void 0,color:"gray.900",display:"block",width:"100%",height:"100%",maxH:"100%",pos:"relative",_hover:{bgColor:l?"trueblue.100":"trueblue.50"},_active:{bgColor:"trueblue.100"},transition:"box-shadow .2s ease",variant:"ghost",cursor:"pointer",onClick:()=>n(t),"data-testid":"icon-search-grid-item",children:(0,a.jsx)(p.az,{height:"100%",maxH:"100%",sx:{svg:{width:"100%",height:"100%"}},dangerouslySetInnerHTML:{__html:t.html}})})},t.id)});ad.displayName="ImageSearchGridItem";let au=e=>{let{searchQuery:t,currentAttributes:l,updateAttributes:n}=e,{isInOfflineMode:o}=(0,lF.u)(),[i,r]=(0,C.useState)([]),[s,c]=(0,C.useState)(!0),[m,g]=(0,C.useState)(!1),[h,b]=(0,C.useState)(1),y=(0,C.useCallback)(async e=>{if(o)return;let l="/api/icons/search?count=".concat(100,"&query=").concat(t,"&page=").concat(e);c(!0),g(!1);try{var a;let e=await fetch(l,{credentials:"include"}),t=await e.json();if(c(!1),!((null==t?void 0:null===(a=t.data)||void 0===a?void 0:a.length)>=0))throw Error(t);r(t.data)}catch(e){g(!0),c(!1),console.error("(caught) [ImageSearchGrid] fetchResults:",e)}},[o,t]);(0,C.useEffect)(()=>{r([]),b(1),y(1)},[t,y]),(0,C.useCallback)(()=>{y(h+1),b(h+1)},[y,h]);let v=null==l?void 0:l.src,k=(0,C.useCallback)(async e=>{n({src:e.src,tempUrl:v,meta:{height:e.height,width:e.width},providerMeta:{name:e.provider,id:e.id},query:t})},[t,n,v]),w=i.map((e,t)=>{var n,o;let i=e.id===(null==l?void 0:null===(n=l.providerMeta)||void 0===n?void 0:n.id)&&e.provider===(null==l?void 0:null===(o=l.providerMeta)||void 0===o?void 0:o.name);return(0,a.jsx)(ad,{provider:e.provider,icon:e,isSelected:i,onIconClick:k},t)});return(0,a.jsxs)(O.s,{direction:"column",align:"stretch",children:[(0,a.jsxs)(eU.r,{gap:2,columns:{base:4,"2xl":6},children:[w,s&&!o&&(0,a.jsx)(ac,{})]}),!1,0===i.length&&!s&&(0,a.jsx)(p.az,{width:"100%",textAlign:"center",padding:"10px",children:(0,a.jsx)(f.E,{style:{color:"gray"},children:(0,a.jsx)(A.x6,{id:"2AY48J",values:{searchQuery:t}})})}),m&&(0,a.jsxs)(d.F,{status:"error",children:[(0,a.jsx)(u._,{}),(0,a.jsx)(A.x6,{id:"5hlcZg"})]})]})},ac=()=>(0,a.jsx)(a.Fragment,{children:ao()(100).map((e,t)=>(0,a.jsx)(tw.E,{height:as,children:(0,a.jsx)(lZ.g,{ratio:1,children:(0,a.jsx)(tt.E,{borderRadius:"base"})})},t))}),am=(0,aa.P)(eE.K),af=e=>{let{currentAttributes:t,updateAttributes:l,defaultQuery:n="",randomQueries:i}=e,[r,d]=(0,C.useState)(n),[u,c]=(0,C.useState)("");(0,C.useEffect)(()=>{c(n),d(n)},[n]);let m=(0,C.useCallback)(()=>{let e=ar()(i);for(;e===r;)e=ar()(i);e&&(d(e),c(""))},[i,r]),f=(0,e$.lW)(d,500);return(0,a.jsxs)(s.T,{spacing:4,align:"stretch",translate:"no",children:[(0,a.jsxs)(ae.M,{size:"md",children:[(0,a.jsx)(at.W,{pointerEvents:"none",children:(0,a.jsx)(p.az,{color:"gray.400",children:(0,a.jsx)(S.g,{icon:x.MjD})})}),(0,a.jsx)(al.p,{placeholder:r||o.Ru._({id:"oMAM3/"}),value:u,onChange:e=>{c(e.target.value),f(e.target.value)},"data-testid":"image-search-input"}),i&&(0,a.jsx)(at.t,{children:(0,a.jsx)(td.Tz,{placement:"top",label:(0,a.jsx)(A.x6,{id:"OVjfHO"}),children:(0,a.jsx)(am,{icon:(0,a.jsx)(S.g,{icon:x.xNJ}),"aria-label":o.Ru._({id:"OVjfHO"}),variant:"ghost",onClick:m,size:"sm",whileTap:{y:"-5px"},onMouseDown:tv.Fw})})})]}),(0,a.jsx)(au,{currentAttributes:t,updateAttributes:l,searchQuery:r||""})]})},ap=["animals","arrows","business","party","nature","food"],ag=e=>{let{updateAttributes:t,currentAttributes:l}=e;return(0,a.jsx)(af,{updateAttributes:t,currentAttributes:l,currentIconUrl:l.src,defaultQuery:l.query||"",randomQueries:ap})};ag.key="image.icon";let ah=e=>{let{editor:t,updateAttributes:l,currentAttributes:n}=e,o=(0,lh.Zj)(n);return(0,a.jsxs)(s.T,{align:"flex-start",spacing:4,children:[(0,a.jsx)(ly.VG,{currentUrl:o,updateAttributes:l,placeholder:"https://www.instagram.com/..."}),o&&(0,a.jsx)(lb.p,{editor:t,updateAttributes:l,currentAttributes:n})]})};ah.key="embed.instagram";let ab=e=>(0,a.jsx)(lv,{...e,urlPlaceholder:"https://form.jotform.com/..."});ab.key="embed.jotform";let ay=["wallpaper","textures","background","nature","gradient","relax","sky","water","pattern","abstract"],av=e=>{let{updateAttributes:t,currentAttributes:l}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(lz.O,{updateAttributes:t,currentImageUrl:l.src,defaultQuery:l.query,randomQueries:ay,provider:"lexica",enablePagination:!1}),(0,a.jsx)(p.az,{width:"100%",textAlign:"center",padding:"10px",paddingTop:"30px",children:(0,a.jsx)(f.E,{fontSize:"sm",color:"gray.500",children:(0,a.jsx)(A.x6,{id:"rbDrRg",components:{0:(0,a.jsx)(lw.N,{href:"https://lexica.art",target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"underline"}})}})})})]})};av.key="image.lexica";let ak=C.lazy(()=>Promise.all([l.e(4309),l.e(7113)]).then(l.bind(l,67113)).then(e=>({default:e.LoomPanel}))),aw=e=>(0,a.jsx)(C.Suspense,{fallback:(0,a.jsx)(e4.y,{size:"md"}),children:(0,a.jsx)(ak,{...e})});aw.key="video.loom";let ax=e=>{let{editor:t,updateAttributes:l,currentAttributes:n}=e,i=(0,lh.Zj)(n);return(0,a.jsxs)(s.T,{align:"flex-start",spacing:4,children:[(0,a.jsx)(ly.VG,{currentUrl:i,updateAttributes:l,placeholder:o.Ru._({id:"ORLSr4"})}),(0,a.jsx)(lx,{guideLink:"https://support.microsoft.com/en-us/office/embed-a-word-document-in-your-blog-0faa0253-2751-44bf-8486-ea7837fe7db1",extraMessage:(0,a.jsx)(A.x6,{id:"2csAkv"}),providerName:"Word, Excel, or PowerPoint"}),i&&(0,a.jsx)(lb.p,{editor:t,updateAttributes:l,currentAttributes:n})]})};ax.key="embed.microsoft.office";let aS=e=>{let{editor:t,updateAttributes:l,currentAttributes:n}=e,o=(0,lh.Zj)(n);return(0,a.jsxs)(s.T,{align:"flex-start",spacing:4,children:[(0,a.jsx)(ly.VG,{currentUrl:o,updateAttributes:l,placeholder:"https://www.miro.com/..."}),(0,a.jsx)(lx,{guideLink:"https://help.miro.com/hc/en-us/articles/360016335640-How-to-embed-editable-boards-into-websites",providerName:"Miro"}),o&&(0,a.jsx)(lb.p,{editor:t,updateAttributes:l,currentAttributes:n})]})};aS.key="embed.miro";let aA=e=>{let{editor:t,updateAttributes:l,currentAttributes:n}=e,i=(0,Q.GV)(X.aQ),r=(0,lh.Zj)(n),{isInOfflineMode:d}=(0,lF.u)(),u=(0,C.useRef)(null),c=(0,C.useCallback)(e=>{let{tempUrl:t,file:a}=e,n=(0,lE.bY)(a);u.current=t,l({...n,url:t})},[l]),m=(0,C.useCallback)((e,l)=>{if(!t)return;let a=u.current;(0,lE.XJ)(t,a||l,e),u.current=null},[t]);return(0,a.jsxs)(s.T,{align:"flex-start",spacing:4,children:[(0,a.jsx)(ly.VG,{currentUrl:r,updateAttributes:l,placeholder:o.Ru._({id:"gzZk6e"})}),r&&(0,a.jsx)(lb.p,{editor:t,updateAttributes:l,currentAttributes:n}),!d&&(0,a.jsx)(y.D,{size:"md",children:(0,a.jsx)(A.x6,{id:"ONWvwQ"})}),i&&(0,a.jsx)(l_.Z,{onUploadSuccess:m,onUploadStart:c,orgId:i,uploadType:"doc",dropHereText:o.Ru._({id:"ByKyau",values:{0:"%{browse}"}}),editType:"node"})]})};aA.key="embed.pdf";let aC=["business","rocket","graphs","build","gradient","sky","water"],az=e=>{let{updateAttributes:t,currentAttributes:l}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(lz.O,{updateAttributes:t,currentImageUrl:l.src,defaultQuery:l.query,randomQueries:aC,provider:"pictographic",enablePagination:!0}),(0,a.jsx)(p.az,{width:"100%",textAlign:"center",padding:"10px",paddingTop:"30px",children:(0,a.jsx)(f.E,{fontSize:"sm",color:"gray.500",children:(0,a.jsx)(A.x6,{id:"wOdKZR",components:{0:(0,a.jsx)(lw.N,{href:"https://pictographic.io",target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"underline"}})}})})})]})};az.key="image.pictographic";let aI=e=>{let{editor:t,updateAttributes:l,currentAttributes:n}=e,i=(0,lh.Zj)(n);return(0,a.jsxs)(s.T,{align:"flex-start",spacing:4,children:[(0,a.jsx)(ly.VG,{currentUrl:i,updateAttributes:l,placeholder:o.Ru._({id:"ORLSr4"})}),i&&(0,a.jsx)(lb.p,{editor:t,updateAttributes:l,currentAttributes:n})]})};aI.key="embed.microsoft.powerbi";var aj=l(22218);let aF=e=>aB(e),aB=async e=>{let t=(await l.e(4478).then(l.t.bind(l,94478,23))).default,{text:a,foregroundColor:n,backgroundColor:o,logoUrl:i,dotOption:r}=e;return new t({width:300,height:300,type:"svg",data:a,image:i,margin:10,dotsOptions:{color:n||"#000",type:r},backgroundOptions:{color:o||"#fff"},imageOptions:{crossOrigin:"anonymous",imageSize:.4,margin:0}}).getRawData("svg")},aR=e=>{var t;let{editor:l,editType:n,updateAttributes:i,currentAttributes:r}=e,{saveImageFromDataBlob:m}=lP({updateAttributes:i,editor:l,editType:n,source:"image.qrCode"}),[g,h]=(0,C.useState)(!1),b="#000000",y="#FFFFFF",v="square",[k,x]=(0,C.useState)(null==r?void 0:null===(t=r.meta)||void 0===t?void 0:t.title),[S,z]=(0,C.useState)(null==r?void 0:r.src),I=(0,C.useRef)(),j=(0,C.useCallback)(()=>{h(!0)},[]),F=(0,C.useCallback)(async()=>{if(!k)return;let e=await aF({text:k,foregroundColor:b,backgroundColor:y,dotOption:v});e&&(z(window.URL.createObjectURL(e)),I.current=e)},[k,b,y,v]);(0,C.useEffect)(()=>{F()},[v,y,b,k,k,F]);let{src:B,tempUrl:R,meta:_,showPlaceholder:E,uploadStatus:T}=r,P=B?(0,eQ.bI)(B,{width:500}):void 0,N=!g&&!!(B||R||E),D=(0,C.useCallback)(async()=>{I.current&&(h(!0),await m({blob:I.current,attributes:{meta:{title:k,foregroundColor:b,backgroundColor:y,dotOption:v}}}),h(!1))},[m,k,b,y,v]);return N?(0,a.jsxs)(s.T,{align:"center",spacing:4,children:[T===lO.A.Uploading&&(0,a.jsxs)(d.F,{status:"info",size:"sm",children:[(0,a.jsx)(u._,{as:e4.y,w:5,h:5}),(0,a.jsx)(c.T,{children:(0,a.jsx)(A.x6,{id:"MEDU34"})})]}),E?(0,a.jsx)(lR.Pf,{isUploading:T===lO.A.Uploading,hasUploadError:T===lO.A.Error,width:"100%",height:"200px",borderRadius:"md"}):(0,a.jsx)(eD._,{src:P||R,alt:"",ignoreFallback:!0,borderRadius:"md"}),(null==_?void 0:_.title)&&(0,a.jsx)(f.E,{textAlign:"left",w:"100%",children:_.title}),T!==lO.A.Uploading&&(0,a.jsx)(w.$,{onClick:j,mt:2,w:"100%",children:(0,a.jsx)(A.x6,{id:"4uW88M"})})]}):(0,a.jsxs)(s.T,{align:"stretch",spacing:4,children:[T===lO.A.Error&&(0,a.jsxs)(d.F,{status:"error",size:"sm",children:[(0,a.jsx)(u._,{}),(0,a.jsx)(c.T,{children:(0,a.jsx)(A.x6,{id:"GymiXM"})})]}),(0,a.jsxs)(M.MJ,{id:"qr-url",children:[(0,a.jsx)(aj.l,{children:(0,a.jsx)(A.x6,{id:"IagCbF"})}),(0,a.jsx)(ae.M,{size:"lg",children:(0,a.jsx)(al.p,{id:"qr-url",value:k,placeholder:o.Ru._({id:"qf63PF"}),type:"url",onChange:e=>{x(e.target.value)}})})]}),l&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(p.az,{p:4,py:2,bg:"gray.100",borderRadius:"md",children:(0,a.jsxs)(e0.B,{spacing:2,children:[(0,a.jsx)(f.E,{children:(0,a.jsx)(A.x6,{id:"a37vfH"})}),(0,a.jsx)(O.s,{align:"center",justify:"center",h:"200px",p:1,border:"1px solid",borderColor:"gray.200",borderRadius:"md",overflow:"hidden",bg:"white",children:S?(0,a.jsx)(e0.B,{h:"100%",children:(0,a.jsx)(eD._,{src:S,maxH:"100%"})}):(0,a.jsx)(p.az,{p:2,children:(0,a.jsx)(f.E,{size:"xs",color:"gray.500",textAlign:"center",children:(0,a.jsx)(A.x6,{id:"eu7KCb"})})})}),(0,a.jsx)(f.E,{fontSize:"sm",color:"gray.600",children:(0,a.jsx)(A.x6,{id:"wjRHQb"})})]})}),(0,a.jsx)(td.Tz,{isDisabled:!!S,shouldWrapChildren:!0,label:(0,a.jsx)(A.x6,{id:"Y1WnIF"}),children:(0,a.jsx)(w.$,{onClick:D,w:"100%",variant:"solid",tabIndex:0,isDisabled:!S,children:(0,a.jsx)(A.x6,{id:"IChvxB"})})})]})]})};aR.key="image.qrCode";let a_=e=>{let{editor:t,updateAttributes:l,currentAttributes:n}=e,o=(0,lh.Zj)(n);return(0,a.jsxs)(s.T,{align:"flex-start",spacing:4,children:[(0,a.jsx)(ly.VG,{currentUrl:o||"",updateAttributes:l,placeholder:"https://open.spotify.com/..."}),(0,a.jsx)(lx,{guideLink:"https://artists.spotify.com/en/help/article/embedded-players-follow-buttons",providerName:"Spotify",extraMessage:(0,a.jsx)(A.x6,{id:"ItAUcI"})}),o&&(0,a.jsx)(lb.p,{editor:t,updateAttributes:l,currentAttributes:n})]})};a_.key="video.spotify";let aM=e=>(0,a.jsx)(lv,{...e,urlPlaceholder:"https://tally.so/..."});aM.key="embed.tally";let aE=e=>{let{editor:t,updateAttributes:l,currentAttributes:n}=e,o=(0,lh.Zj)(n);return(0,a.jsxs)(s.T,{align:"flex-start",spacing:4,children:[(0,a.jsx)(ly.VG,{currentUrl:o,updateAttributes:l,placeholder:"https://www.tiktok.com/..."}),(0,a.jsx)(lx,{guideLink:"https://developers.tiktok.com/doc/embed-videos/",providerName:"TikTok"}),o&&(0,a.jsx)(lb.p,{editor:t,updateAttributes:l,currentAttributes:n})]})};aE.key="video.tiktok";let aT=e=>{let{editor:t,updateAttributes:l,currentAttributes:n}=e,o=(0,lh.Zj)(n);return(0,a.jsxs)(s.T,{align:"flex-start",spacing:4,children:[(0,a.jsx)(ly.VG,{currentUrl:o,updateAttributes:l,placeholder:"https://twitter.com/..."}),o&&(0,a.jsx)(lb.p,{editor:t,updateAttributes:l,currentAttributes:n})]})};aT.key="embed.twitter";let aO=e=>(0,a.jsx)(lv,{...e,urlPlaceholder:"https://typeform.com/..."});aO.key="embed.typeform";let aP=["wallpaper","textures","architecture","background","nature","gradient","experimental","animals","california","flowers","relax","sky","water","pattern","abstract"],aN=e=>{let{updateAttributes:t,currentAttributes:l}=e;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(lz.O,{updateAttributes:t,currentImageUrl:l.src,defaultQuery:l.query,randomQueries:aP,provider:"unsplash"}),(0,a.jsx)(p.az,{width:"100%",textAlign:"center",padding:"10px",paddingTop:"30px",children:(0,a.jsx)(f.E,{fontSize:"sm",color:"gray.500",children:(0,a.jsx)(A.x6,{id:"k16iQH",values:{UNSPLASH_PROPER_NOUN:"Unsplash"},components:{0:(0,a.jsx)(lw.N,{href:"https://unsplash.com",target:"_blank",rel:"noopener noreferrer",style:{textDecoration:"underline"}})}})})})]})};aN.key="image.unsplash";let aD=e=>{let{editor:t,updateAttributes:l,currentAttributes:n}=e,o=(0,lh.Zj)(n);return(0,a.jsxs)(s.T,{align:"flex-start",spacing:4,children:[(0,a.jsx)(ly.VG,{currentUrl:o,updateAttributes:l,placeholder:"https://vimeo.com/..."}),o&&(0,a.jsx)(lb.p,{editor:t,updateAttributes:l,currentAttributes:n})]})};aD.key="video.vimeo";let aL=["modern office workspace","sustainable energy landscape","vintage automobile collection","future technology concept","tropical beach paradise","urban street art","classical music instruments","mountain hiking adventure","wildlife safari","space exploration visuals","ancient ruins aerial view","deep sea marine life","high fashion runway event","robotics in manufacturing","gourmet food presentation","winter sports scene","abstract art paintings","traditional village festival","modern architecture landmarks","digital art fantasy worlds"],aW=e=>{let{updateAttributes:t,currentAttributes:l}=e;return(0,a.jsx)(lz.O,{updateAttributes:t,currentImageUrl:l.src,defaultQuery:l.query||"",enablePagination:!0,enableLicenseFilter:!0,provider:"web",resultsPerPage:48,randomQueries:aL,resizeThumbnails:!0})};aW.key="image.web";let aU=e=>{let{editor:t,updateAttributes:l,currentAttributes:n}=e,{proxy:i,displayStyle:r}=n,d=(0,lh.Zj)(n);return(0,a.jsxs)(s.T,{align:"flex-start",spacing:4,children:[(0,a.jsx)(ly.VG,{currentUrl:d||"",updateAttributes:l,placeholder:o.Ru._({id:"gzZk6e"})}),d&&r&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(ld.S,{isChecked:i,onChange:e=>l({proxy:e.target.checked}),children:(0,a.jsx)(A.x6,{id:"Fl9cgp"})}),(0,a.jsx)(f.E,{fontSize:"sm",color:"gray.500",mt:-2,children:(0,a.jsx)(A.x6,{id:"J87/8N"})})]}),d&&(0,a.jsx)(lb.p,{editor:t,updateAttributes:l,currentAttributes:n})]})};aU.key="embed.custom";let aG=e=>{let{editor:t,updateAttributes:l,currentAttributes:n}=e,o=(0,lh.Zj)(n);return(0,a.jsxs)(s.T,{align:"flex-start",spacing:4,children:[(0,a.jsx)(ly.VG,{currentUrl:o,updateAttributes:l,placeholder:"{let{editor:t,updateAttributes:l,currentAttributes:n}=e,o=(0,lh.Zj)(n);return(0,a.jsxs)(s.T,{align:"flex-start",spacing:4,children:[(0,a.jsx)(ly.VG,{currentUrl:o,updateAttributes:l,placeholder:"https://www.youtube.com/watch?v=..."}),o&&(0,a.jsx)(lb.p,{editor:t,updateAttributes:l,currentAttributes:n})]})};aH.key="video.youtube";let aV=Object.fromEntries(Object.values([lI,lV,lJ,aW,av,aN,aH,aw,lL,lK,lq,aU,lN,aR,lp,ax,aI,aT,aD,lD,aA,aS,lS,lA,aG,a_,aE,ah,l9,ag,lj,aO,ab,aM,lW,az]).flat().map(e=>[e.key,e]));var aq=l(48192),aK=l(38684);let aJ=e=>{let{accentImages:t,isDark:l,handleDelete:n,handleItemClick:i,currentAttributes:r,editType:s}=e,d=(0,C.useCallback)(e=>t=>{n&&(t.stopPropagation(),n(e))},[n]),u=(0,C.useCallback)(e=>()=>{i&&i(e)},[i]);return(0,a.jsx)(eU.r,{gap:2,columns:{base:2,"2xl":3},children:t.map(e=>{let t=(0,aK.FD)(e,l,eQ.p7),c=("node"===s||"accessory"===s)&&e.image,m=c?{...e.image,source:e.source}:e,f=c?(null==r?void 0:r.src)===e.image.src:(null==r?void 0:r.accentId)===e.accentId;return(0,a.jsx)(tw.E,{children:(0,a.jsxs)(p.az,{as:w.$,variant:"unstyled",backgroundColor:l?"black":"white",cursor:i?"pointer":void 0,...t,opacity:1,width:"100%",borderRadius:"base",shadow:"md",minH:"100px",position:"relative",role:"group",onClick:u(m),children:[n&&(0,a.jsx)(td.Tz,{label:(0,a.jsx)(A.x6,{id:"Rz0Yis"}),placement:"top",children:(0,a.jsx)(eE.K,{"aria-label":o.Ru._({id:"Rz0Yis"}),icon:(0,a.jsx)(S.g,{icon:x.yLS}),onClick:d(e),isRound:!0,position:"absolute",top:1,insetEnd:1,size:"sm",color:"red.600",opacity:0,_hover:{color:"red.600"},_groupHover:{opacity:1}})}),r&&(0,a.jsx)(tx.z,{in:f,children:(0,a.jsx)(p.az,{pointerEvents:"none",color:"white",pos:"absolute",inset:0,bg:"rgba(0,0,0,.5)",borderRadius:"base",children:(0,a.jsx)(tS.o,{h:"100%",w:"100%",children:(0,a.jsx)(S.g,{icon:x.e68})})})})]})},e.accentId)})})};var a$=l(1771),aQ=l(32133),aY=l(70323),aX=l(1984),aZ=l(75254),a0=l.n(aZ),a1=l(33919),a2=l(76228);let a6=(0,tq.R)((e,t)=>{let{color:l,name:n,isActive:o,size:i=8,onClick:r,buttonProps:s}=e,d=(0,a$.ZY)(l)?"white":"black";return(0,a.jsx)(td.Tz,{label:n,placement:"top",isDisabled:!n,children:(0,a.jsx)(w.$,{display:"inline-block",alignSelf:"center",boxSize:i,borderRadius:"md",border:"1px solid",borderColor:"gray.200",color:d,css:(0,a$.Sf)(l),onClick:()=>null==r?void 0:r(l),variant:"unstyled",minW:i,fontSize:"xs",transitionProperty:"border",transitionDuration:"normal",ref:t,...s,children:o&&(0,a.jsx)(a2.S,{})})})});a6.displayName="ThemeColorIcon";let a4=e=>{let{mode:t,setMode:l}=e;return(0,a.jsxs)(E.W,{children:[(0,a.jsx)(T.I,{as:w.$,size:"sm",rightIcon:(0,a.jsx)(S.g,{icon:x.Jt$,size:"sm"}),minW:24,textAlign:"left",children:t}),(0,a.jsx)(P.c,{children:(0,a.jsx)(N.i,{defaultValue:t,value:t,title:"Color Mode",type:"radio",onChange:l,children:["HEX","RGB","HSL"].map(e=>(0,a.jsx)(D.k,{value:e,children:e},e))})})]})},a5={type:"solid",color:"#FF0000"},a3=e=>{let[t,l]=(0,C.useState)("HEX"),n=e.color||e.defaultColor||a5,o=(0,a$.Ik)(n),{updateColor:i}=e,r=(0,C.useCallback)(e=>{i({type:"solid",color:e})},[i]);return(0,a.jsxs)(s.T,{align:"start",spacing:4,children:[(0,a.jsx)(nf,{...e}),(0,a.jsxs)(s.T,{children:[(0,a.jsx)(nt,{color:o,onChange:r}),(0,a.jsxs)(m.z,{w:"100%",spacing:4,children:[(0,a.jsx)(a6,{color:n}),(0,a.jsx)(ne,{color:o,onChange:r}),(0,a.jsx)(nl,{color:o,onChange:r})]}),(0,a.jsxs)(m.z,{flex:1,w:"100%",children:[(0,a.jsx)(a4,{mode:t,setMode:l}),"HEX"===t&&(0,a.jsx)(a8,{initialFocusRef:e.initialFocusRef,color:o,updateColor:r,placeholder:a5.color}),"HSL"===t&&(0,a.jsx)(a7,{color:o,updateColor:r}),"RGB"===t&&(0,a.jsx)(a9,{color:o,updateColor:r})]})]})]})},a8=e=>{let{color:t,updateColor:l,placeholder:n,initialFocusRef:o}=e,[i,r]=(0,C.useState)(t),[s,d]=(0,C.useState)(!1);(0,C.useEffect)(()=>{r(t)},[t]);let u=(0,C.useCallback)(e=>{let t=e.target.value;r(t),(0,t3.fd)(t)&&l(t)},[l]),c=(0,C.useCallback)(e=>{let t=ng(e.target.value);(0,t3.fd)(t)&&l(t)},[l]);return(0,C.useEffect)(()=>{if(o&&!s){var e;null===(e=o.current)||void 0===e||e.select(),d(!0)}},[s,o]),(0,a.jsx)(al.p,{ref:o,size:"sm",type:"text",value:i,onChange:u,onBlur:c,onKeyDown:e=>{"Enter"===e.key&&c(e)},fontFamily:"mono",placeholder:n,"data-testid":"color-picker-text-input-hex"})},a7=e=>{let{color:t,updateColor:l}=e,n=lX()(t).toHsl(),[o,i,r]=[n.h,100*n.s,100*n.l],s=e=>{l(lX()({h:e,s:i/100,l:r/100}).toHexString())},d=e=>{l(lX()({h:o,s:e/100,l:r/100}).toHexString())},u=e=>{l(lX()({h:o,s:i/100,l:e/100}).toHexString())};return(0,a.jsxs)(m.z,{children:[(0,a.jsx)(al.p,{size:"sm",type:"number",value:Math.round(o),onChange:e=>s(Number(e.target.value)),min:0,max:360,step:1,flex:1}),(0,a.jsx)(al.p,{size:"sm",type:"number",value:Math.round(i),onChange:e=>d(Number(e.target.value)),min:0,max:100,step:1,flex:1}),(0,a.jsx)(al.p,{size:"sm",type:"number",value:Math.round(r),onChange:e=>u(Number(e.target.value)),min:0,max:100,step:1,flex:1})]})},a9=e=>{let{color:t,updateColor:l}=e,n=lX()(t).toRgb(),[o,i,r]=[n.r,n.g,n.b],s=e=>{l(lX()({r:e,g:i,b:r}).toHexString())},d=e=>{l(lX()({r:o,g:e,b:r}).toHexString())},u=e=>{l(lX()({r:o,g:i,b:e}).toHexString())};return(0,a.jsxs)(m.z,{children:[(0,a.jsx)(al.p,{size:"sm",type:"number",value:o,onChange:e=>s(Number(e.target.value)),min:0,max:255,step:1,flex:1}),(0,a.jsx)(al.p,{size:"sm",type:"number",value:i,onChange:e=>d(Number(e.target.value)),min:0,max:255,step:1,flex:1}),(0,a.jsx)(al.p,{size:"sm",type:"number",value:r,onChange:e=>u(Number(e.target.value)),min:0,max:255,step:1,flex:1})]})},ne=e=>{let{color:t,onChange:l}=e,n=lX()(t).toHsv(),[o,i]=(0,C.useState)(n.h);return(0,C.useEffect)(()=>{i(n.h)},[n.h]),(0,a.jsxs)(aX.Ap,{min:0,max:360,defaultValue:o,value:o,size:"lg",onChange:e=>{i(e),l(lX()({h:e,s:n.s,v:n.v}).toHexString())},step:.1,focusThumbOnChange:!1,children:[(0,a.jsx)(aX.hB,{h:3,borderRadius:"full",bgGradient:"linear(to-r, hsl(0, 100%, 50%), hsl(60, 100%, 50%), hsl(120, 100%, 50%), hsl(180, 100%, 50%), hsl(240, 100%, 50%), hsl(300, 100%, 50%), hsl(360, 100%, 50%))"}),(0,a.jsx)(aX.OQ,{borderWidth:3,borderColor:"white",bg:"hsl(".concat(n.h,", 100%, 50%)"),boxSize:"24px",shadow:"md",outline:"1px solid",outlineColor:"blackAlpha.200"})]})},nt=e=>{let{color:t,onChange:l}=e,[n,o]=(0,C.useState)(!1),i=(0,C.useRef)(null),r=(0,C.useRef)(null),s=(0,C.useRef)(null),d=lX()(t).toHsv(),u=lX()({h:d.h,s:100,v:100}),c=(0,C.useCallback)((e,t)=>{if(!i.current)return;let l=e/i.current.width,a=1-t/i.current.height;return d.s=l,d.v=a,d},[d]),m=(0,C.useCallback)(e=>{if(!i.current)return{x:0,y:0};let t=lX()(e).toHsv(),l=t.s,a=t.v;return{x:l*i.current.width,y:(1-a)*i.current.height}},[]),f=(0,C.useCallback)(()=>{let e=i.current,t=null==e?void 0:e.getContext("2d");if(!e||!t)return;let l=e.width,a=e.height,n=t.createLinearGradient(0,0,l,0);n.addColorStop(0,"white"),n.addColorStop(1,u.toHexString()),t.fillStyle=n,t.fillRect(0,0,l,a);let o=t.createLinearGradient(0,0,0,a);o.addColorStop(0,"rgba(0,0,0,0)"),o.addColorStop(1,"black"),t.fillStyle=o,t.fillRect(0,0,l,a)},[u]),g=(0,C.useCallback)((e,t)=>{if(!i.current||!r.current)return{x:0,y:0};let l=i.current.clientWidth,a=i.current.clientHeight,n=ev()(e,0,l),o=ev()(t,0,a);return r.current.style.left="".concat(n,"px"),r.current.style.top="".concat(o,"px"),{x:n,y:o}},[]);(0,C.useEffect)(()=>{f();let{x:e,y:l}=m(t);g(e,l)},[t,m,f,g]);let h=(0,C.useCallback)(e=>{if(!s.current)return;let t=s.current.getBoundingClientRect(),{x:a,y:n}=g(e.clientX-t.left,e.clientY-t.top),o=c(a,n);o&&(l(lX()(o).toHexString()),e.preventDefault())},[l,c,g]),b=(0,C.useCallback)(e=>{o(!1),e.preventDefault()},[]),y=(0,C.useCallback)(e=>{o(!0),h(e),e.preventDefault()},[h]);return(0,C.useEffect)(()=>{if(n)return document.addEventListener("mousemove",h),document.addEventListener("mouseup",b),()=>{document.removeEventListener("mousemove",h),document.removeEventListener("mouseup",b)}},[h,b,n]),(0,a.jsxs)(p.az,{pos:"relative",ref:s,onMouseDown:y,children:[(0,a.jsx)(p.az,{ref:r,pos:"absolute",w:5,h:5,border:"2px solid white",borderRadius:"full",transform:"translate(-50%, -50%) scale(".concat(n?1.2:1,")"),boxShadow:"md",transitionProperty:"transform",transitionDuration:"normal",bg:lX()(t).toHexString(),outline:"1px solid",outlineColor:"blackAlpha.200"}),(0,a.jsx)(p.az,{as:"canvas",ref:i,width:"100%",height:"150px",borderRadius:"md",shadow:"base",border:"1px solid",borderColor:"gray.200"})]})},nl=e=>{let{onChange:t}=e,l=(0,C.useCallback)(()=>{new window.EyeDropper().open().then(e=>{t(e.sRGBHex)}).catch(e=>{console.error("Eyedropper error:",e)})},[t]);return"EyeDropper"in window?(0,a.jsx)(eE.K,{size:"sm",icon:(0,a.jsx)(S.g,{fixedWidth:!0,icon:x.jC5}),onClick:l,variant:"ghost","aria-label":o.Ru._({id:"A94+Ww"})}):null},na=e=>{let[t,l]=(0,C.useState)("HEX"),{updateColor:n,color:o}=e,[i,r]=(0,C.useState)(0),d=o.stops[i],u=(0,C.useCallback)((e,t)=>{let l=[...o.stops];void 0===t?(l.splice(e,1),r(Math.min(e,l.length-1))):(l[e]=t,r(e)),n({...o,stops:l})},[o,n]),c=(0,C.useCallback)(e=>{let t=[...o.stops];t.push(e),t.sort((e,t)=>e.position-t.position),r(a0()(t,e)),n({...o,stops:t})},[o,n]),f=(0,C.useCallback)(e=>{u(i,{...d,color:e})},[d,i,u]);return(0,a.jsxs)(s.T,{align:"start",spacing:4,children:[(0,a.jsx)(nn,{...e,addStop:c,currentStop:d,updateStop:u,currentStopIndex:i,setCurrentStopIndex:r}),(0,a.jsx)(nf,{...e,updateColor:e=>{"linear-gradient"===e.type?n(e):f(null==e?void 0:e.color)}}),(0,a.jsx)(aY.c,{}),(0,a.jsxs)(s.T,{children:[(0,a.jsx)(nt,{color:d.color,onChange:f}),(0,a.jsxs)(m.z,{w:"100%",spacing:4,children:[(0,a.jsx)(a6,{color:o}),(0,a.jsx)(ne,{color:d.color,onChange:f}),(0,a.jsx)(nl,{color:d.color,onChange:f})]}),(0,a.jsxs)(m.z,{flex:1,w:"100%",children:[(0,a.jsx)(a4,{mode:t,setMode:l}),"HEX"===t&&(0,a.jsx)(a8,{initialFocusRef:e.initialFocusRef,color:d.color,updateColor:f,placeholder:a5.color}),"HSL"===t&&(0,a.jsx)(a7,{color:d.color,updateColor:f}),"RGB"===t&&(0,a.jsx)(a9,{color:d.color,updateColor:f})]}),(0,a.jsx)(no,{...e})]})]})},nn=e=>{let{color:t,updateStop:l,currentStopIndex:n,setCurrentStopIndex:i,addStop:r}=e,{stops:s}=t,d=s.length>2,u=s.length<5;return(0,a.jsxs)(m.z,{w:"100%",spacing:0,children:[(0,a.jsx)(O.s,{borderRadius:"full",background:(0,a1.yh)({...t,angle:90}),pos:"relative",h:3,border:"1px solid",borderColor:"gray.200",flex:1,mr:2,children:s.map((e,t)=>{let o=t===n;return(0,a.jsx)(O.s,{pos:"absolute",inset:0,top:-1.5,children:(0,a.jsxs)(aX.Ap,{size:"lg",value:e.position,min:0,max:100,step:1,onChange:a=>{l(t,{...e,position:a})},onClick:()=>i(t),children:[(0,a.jsx)(aX.hB,{bg:"transparent",h:3}),(0,a.jsx)(aX.OQ,{borderWidth:3,borderColor:"white",boxSize:"24px",shadow:"md",outline:o?"2px solid":"1px solid",outlineColor:o?"trueblue.300":"blackAlpha.200",bg:e.color})]})},t)})}),(0,a.jsx)(td.Tz,{label:(0,a.jsx)(A.x6,{id:"VztmP9"}),children:(0,a.jsx)(eE.K,{icon:(0,a.jsx)(S.g,{icon:x.yLS}),"aria-label":o.Ru._({id:"VztmP9"}),onClick:()=>l(n,void 0),size:"sm",variant:"ghost",isDisabled:!d})}),(0,a.jsx)(td.Tz,{label:(0,a.jsx)(A.x6,{id:"MKajKJ"}),children:(0,a.jsx)(eE.K,{icon:(0,a.jsx)(S.g,{icon:x.QLR}),"aria-label":o.Ru._({id:"MKajKJ"}),onClick:()=>{r(ni(t))},size:"sm",variant:"ghost",isDisabled:!u})})]})},no=e=>{let{color:t,updateColor:l}=e;return(0,a.jsxs)(s.T,{align:"start",w:"100%",children:[(0,a.jsx)(f.E,{fontWeight:"600",fontSize:"sm",color:"gray.500",children:(0,a.jsx)(A.x6,{id:"YMybpT"})}),(0,a.jsx)(eU.r,{columns:4,spacing:2,w:"100%",children:nr.map(e=>{let n=t.angle===e.value;return(0,a.jsx)(a6,{color:{...t,angle:e.value},onClick:()=>l({...t,angle:e.value}),isActive:n,buttonProps:{w:"100%"},name:e.label},e.value)})})]})},ni=e=>{let t=e.stops[0],l=e.stops[1],a=e.stops.reduce((a,n,o)=>{let i=e.stops[o+1];if(!i)return a;let r=i.position-n.position;return r>a.distance?(t=n,l=i,{distance:r,position:n.position+r/2}):a},{distance:0,position:0});return{color:(0,t3.tV)(t.color,l.color,a.position/100),position:a.position}},nr=[{label:"0\xb0",value:0},{label:"45\xb0",value:45},{label:"90\xb0",value:90},{label:"135\xb0",value:135},{label:"180\xb0",value:180},{label:"225\xb0",value:225},{label:"270\xb0",value:270},{label:"315\xb0",value:315}],ns=(0,tq.R)((e,t)=>{let{color:l,updateColor:n,defaultColor:i={type:"solid",color:"#000000"},onClick:r,canReset:s,dataTestId:d}=e;return(0,a.jsxs)(ae.M,{size:"md","data-testid":d,children:[(0,a.jsx)(al.p,{type:"text",placeholder:i?"".concat((0,a$.ZR)(i)," ").concat(o.Ru._({id:"P9Cyl9"})):o.Ru._({id:"ovBPCi"}),value:l?(0,a$.ZR)(l):"",readOnly:!0,fontFamily:"monospace",bg:"white",onFocus:r}),(0,a.jsx)(at.W,{children:(0,a.jsx)(a6,{color:l||i,ref:t,onClick:r,size:7})}),s&&(0,a.jsx)(at.t,{children:(0,a.jsx)(td.Tz,{label:(0,a.jsx)(A.x6,{id:"L+rMC9"}),placement:"top",children:(0,a.jsx)(eE.K,{"aria-label":o.Ru._({id:"cnGeoo"}),variant:"ghost",onClick:()=>n(void 0),icon:(0,a.jsx)(S.g,{icon:x.U23}),size:"sm",colorScheme:"red"})})})]})});ns.displayName="ThemeColorPickerInput";let nd=e=>{let t=(0,C.useRef)(null);return(0,a.jsxs)(eP.A,{isLazy:!0,strategy:"fixed",modifiers:[{name:"preventOverflow",options:{altAxis:!0}}],initialFocusRef:t,children:[(0,a.jsx)(eN.W,{children:(0,a.jsx)(ns,{...e,canReset:!!(e.color&&e.defaultColor)})}),(0,a.jsx)(eL.h,{zIndex:"modalPopover",border:"1px solid",borderColor:"gray.100",children:(0,a.jsx)(eW.e,{children:(0,a.jsx)(nm,{...e,initialFocusRef:t})})})]})},nu=e=>(0,a.jsx)(nd,{...e,solidOnly:!0}),nc=["solid","linear-gradient"],nm=e=>{let{color:t,updateColor:l,solidOnly:n}=e,o=(null==t?void 0:t.type)||"solid",i=nc.indexOf(o),r=(0,C.useCallback)(e=>{let a=nc[e];if(o===a)return;let n=(0,a$.Ik)(t||a5);"solid"===a?l({color:n,...t,type:"solid"}):"linear-gradient"===a&&l({stops:[{color:n,position:0},{color:(0,t3.Pf)(n,(0,t3.$p)(n)?20:-20),position:100}],angle:45,...t,type:"linear-gradient"})},[o,t,l]);return n?(0,a.jsx)(a3,{...e}):(0,a.jsxs)(eY.t,{variant:"soft-rounded",size:"sm",isFitted:!0,isLazy:!0,index:i,onChange:r,children:[(0,a.jsxs)(eX.w,{children:[(0,a.jsx)(eZ.o,{children:(0,a.jsxs)(m.z,{children:[(0,a.jsx)(S.g,{icon:x.l8N,fixedWidth:!0}),(0,a.jsx)(A.x6,{id:"5bi1la"})]})}),(0,a.jsx)(eZ.o,{children:(0,a.jsxs)(m.z,{children:[(0,a.jsx)(S.g,{icon:x.IlC,fixedWidth:!0}),(0,a.jsx)(A.x6,{id:"/S8bMP"})]})})]}),(0,a.jsxs)(tP.T,{children:[(0,a.jsx)(tN.K,{p:0,pt:4,children:(0,a.jsx)(a3,{...e})}),(0,a.jsx)(tN.K,{p:0,pt:4,children:(0,a.jsx)(na,{...e,color:t})})]})]})},nf=e=>{let{theme:t,color:l,updateColor:n,solidOnly:o=!1,palette:i="theme"}=e,r=[];return("theme"===i?r=(0,a$.ND)(t,o):"accent"===i&&(r=(0,a$.CD)(t)),o&&(r=r.filter(a$.mO)),0===r.length)?null:(0,a.jsxs)(s.T,{align:"start",children:[(0,a.jsx)(f.E,{fontWeight:"600",fontSize:"sm",color:"gray.500",children:(0,a.jsx)(A.x6,{id:"DNUgpN"})}),(0,a.jsx)(m.z,{wrap:"wrap",children:r.map((e,t)=>(0,a.jsx)(a6,{name:(0,a$.mO)(e)?(0,a$.ZR)(e):void 0,color:e,onClick:n,isActive:l&&(0,a$.Gw)(l,e)},t))})]})},np=e=>e.replaceAll("#","").replaceAll(/[^A-Fa-f0-9]/g,"").slice(0,6),ng=e=>{let t=np(e),l="";switch(t.length){case 0:return"";case 1:for(let e=0;e<6;e++)l+=t;break;case 2:for(let e=0;e<3;e++)l+=t;break;case 3:case 4:case 5:l=t.slice(0,3).split("").map(function(e){return e+e}).join("");break;default:l=t}return"#"+l.toUpperCase()};var nh=l(26813);let nb="default",ny="color.solid",nv={Default:[{label:()=>o.Ru._({id:"EdQY6l"}),availableOffline:!0,key:nb,backgroundType:nh.h.NONE}],Image:[{...i.mx,nodeName:"image",backgroundType:nh.h.IMAGE,priority:10},{...i.OO,nodeName:"image",disabled:!0,backgroundType:nh.h.IMAGE},{...i.Rn,nodeName:"image",backgroundType:nh.h.IMAGE},{...i.TV,nodeName:"image",disabled:!0,backgroundType:nh.h.IMAGE},{...i.Up,nodeName:"image",backgroundType:nh.h.IMAGE},{...i.ae,nodeName:"image",backgroundType:nh.h.IMAGE},{...i.Pl,nodeName:"image",backgroundType:nh.h.IMAGE},{...i.xT,nodeName:"image",backgroundType:nh.h.IMAGE},{...i.Z_,nodeName:"image"},{...i.yj,nodeName:"image",disabled:!0,backgroundType:nh.h.IMAGE},{...i.fb,nodeName:"image"},{label:()=>o.Ru._({id:"COXEr5"}),key:aq.j,availableOffline:!0,icon:n.yvG,backgroundType:nh.h.IMAGE,nodeName:"image",keywords:["accent image"]}],Video:[{...i.GQ,nodeName:"video"},{...i.fX,nodeName:"video"},{...i.N$,nodeName:"video"},{...i.O5,nodeName:"video"},{...i.r9,nodeName:"video"},{...i.w,nodeName:"video"},{...i.st,nodeName:"video"}],Embed:[{...i.Jp,nodeName:"embed",priority:10},{...i.Zd,nodeName:"embed"},{...i.Il,nodeName:"embed"},{...i.fG,nodeName:"embed"},{...i.uF,nodeName:"embed"},{...i.Oz,nodeName:"embed"},{...i.V2,nodeName:"embed"},{...i.Dr,nodeName:"embed"},{...i.MN,nodeName:"embed"},{...i.qD,nodeName:"embed"},{...i.ap,nodeName:"embed"},{...i.Ve,nodeName:"embed"},{...i.RA,nodeName:"embed"},{...i.Ow,nodeName:"embed"},{...i.hb,nodeName:"embed"},{...i.sI,nodeName:"embed"},{...i.sS,nodeName:"embed"}],Color:[{label:()=>o.Ru._({id:"iFeLoB"}),key:ny,availableOffline:!0,icon:n.fyG,backgroundType:nh.h.COLOR,keywords:["solid color"]},{...i.UX,availableOffline:!0,backgroundType:nh.h.GRADIENT}]},nk=Object.fromEntries(Object.values(nv).flat().map(e=>[e.key,e])),nw={...aV,[nb]:()=>(0,a.jsx)(a.Fragment,{}),[aq.j]:e=>{let{currentAttributes:t,updateAttributes:l,editType:n}=e,o=(0,Q.GV)(X.SJ),{accentBackgrounds:i}=o.config;return(0,a.jsxs)(s.T,{align:"stretch",children:[i&&(0,a.jsx)(aJ,{currentAttributes:t,accentImages:i,isDark:(0,a$.Mw)(o),handleItemClick:l,editType:n}),(0,a.jsxs)(d.F,{status:"info",children:[(0,a.jsx)(u._,{}),(0,a.jsx)(c.T,{children:(0,a.jsx)(A.x6,{id:"zOCB9A"})})]})]})},[ny]:e=>{let{currentAttributes:t,updateAttributes:l,contextualTheme:n}=e,o=(0,aQ.d4)(X.SJ),i=(0,C.useCallback)(e=>l({hex:(0,a$.Ik)(e)}),[l]);if("string"==typeof t)return i(t),(0,a.jsx)(a.Fragment,{});let{hex:r}=t;return(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(nu,{color:{type:"solid",color:r},updateColor:i,theme:n||o,palette:"theme"})})}},nx={Default:()=>o.Ru._({id:"ovBPCi"}),Image:()=>o.Ru._({id:"hG89Ed"}),Video:()=>o.Ru._({id:"vSJd18"}),Embed:()=>o.Ru._({id:"KKBlUU"}),Color:()=>o.Ru._({id:"jZlrte"})}},94007:(e,t,l)=>{"use strict";l.d(t,{Hy:()=>j,Pf:()=>F,Td:()=>I,v9:()=>B});var a=l(31085),n=l(70403),o=l(43342),i=l(61778),r=l(25420),s=l(2600),d=l(80532),u=l(62313),c=l(12917),m=l(20501),f=l(24221),p=l(52177),g=l(14041),h=l(88957),b=l(87747),y=l(83292),v=l(15428),k=l(35789);function w(){let e=(0,y._)(["\n from {transform: rotate(-5deg) scale(1)}\n to {transform: rotate(5deg) scale(1.2)}\n "]);return w=function(){return e},e}let x=e=>{let{provider:t,color:l="gray"}=e,n=(0,v.i7)(w()),r="aiGenerated"===t?m._$C:m.$UM;return(0,a.jsxs)(k.o,{className:"image-loading-spinner",children:[(0,a.jsx)(o.y,{color:"".concat(l,".300"),thickness:"3px",size:"xl",position:"absolute",speed:"0.7s",emptyColor:"transparent"}),(0,a.jsx)(i.E,{color:"".concat(l,".400"),position:"absolute",lineHeight:"2",fontSize:"lg",animation:"".concat(n," infinite alternate 700ms ease-out"),children:(0,a.jsx)(f.g,{icon:r,fixedWidth:!0})})]})};var S=l(61690),A=l(80916),C=l(73818),z=l(48416);let I=e=>{let{removeBackground:t=!1,scootRight:l=!1}=e;return(0,a.jsxs)(n.vw,{size:"sm",variant:"subtle",colorScheme:"gray",pos:"absolute",top:4,left:4,p:1,ml:l?28:0,children:[(0,a.jsx)(o.y,{color:"gray.600",size:"xs"}),t&&(0,a.jsx)(i.E,{as:"span",ml:1,fontFamily:"body",children:(0,a.jsx)(p.x6,{id:"gVcJ1/"})})]})},j=()=>(0,a.jsx)(n.vw,{size:"sm",variant:"subtle",colorScheme:"red",pos:"absolute",top:4,left:4,children:(0,a.jsxs)(n.d1,{children:[(0,a.jsx)(f.g,{icon:m.tUE})," ",(0,a.jsx)(p.x6,{id:"rmh/nq"})]})}),F=(0,g.memo)(e=>{let{children:t,icon:l=c.Cyq,isLoading:n=!1,isUploading:o=!1,hasUploadError:i=!1,isAccentImageDrawer:m=!1,loadingProvider:p,openEditBackgroundDrawer:y,onSelectAndFocus:v,defaultSource:k,hasQuickActions:w=!1,handleDoubleClick:F,...B}=e,[R,_]=(0,g.useState)(!1),M=(0,h.GV)(S.nD),E=(0,b.rd)();return(0,g.useEffect)(()=>{k&&!1===(0,C.Ub)(k)?_(!1):w&&M?_(!0):_(!1)},[k,w,M]),(0,a.jsxs)(r.s,{"data-testid":"media-placeholder","data-test-media-source":k,color:E?A.N.DARK_COLOR:A.N.LIGHT_COLOR,align:"center",justify:"center",p:3,bg:E?A.N.DARK_BG:A.N.LIGHT_BG,className:"placeholder","data-drag-handle":!0,"data-export-as-image":!0,position:"relative",cursor:"default",sx:{containerType:"size","@container (width < 150px) or (height < 140px)":{".quick-actions":{display:"none"},".ai-image-loading-spinner":{transform:"scale(0.5)"}}},onDoubleClick:F,transition:"background-color 0.2s",...B,children:[!n&&(0,a.jsxs)(s.T,{pointerEvents:"none",children:[(0,a.jsx)(d.az,{color:E?A.N.DARK_ICON_COLOR:A.N.LIGHT_ICON_COLOR,sx:{"@container (0px <= width <= 32px) or (height < 100px)":{fontSize:"sm"},"@container (32px < width <= 80px)":{fontSize:"2xl"},fontSize:"4xl"},children:(0,a.jsx)(f.g,{icon:l,fixedWidth:!0})}),R&&(0,a.jsx)(u.z,{pointerEvents:"auto",className:"quick-actions",children:(0,a.jsx)(z.Z,{onSelectImage:v,isAccentImageDrawer:m,openEditBackgroundDrawer:y})})]}),n&&(0,a.jsx)(x,{provider:p}),o&&(0,a.jsx)(I,{}),i&&(0,a.jsx)(j,{}),t]})});F.displayName="MediaPlaceholderImage";let B={minW:16,minH:16,bg:"gray.200"}},48416:(e,t,l)=>{"use strict";l.d(t,{Z:()=>v});var a=l(31085),n=l(80532),o=l(25420),i=l(9021),r=l(3040),s=l(24221),d=l(95986),u=l(52177),c=l(12327),m=l(14041),f=l(74327),p=l(87747),g=l(83380),h=l(59707),b=l(80916),y=l(21696);let v=e=>{let{onSelectImage:t,isAccentImageDrawer:l=!1,openEditBackgroundDrawer:i,...s}=e,{setMediaDrawerSourceKeyAction:d,setBackgroundDrawerSourceKeyAction:m}=(0,y.B)(),p=[{id:"image.custom",label:(0,a.jsx)(u.x6,{id:"6MxxvO"}),ariaLabel:c.Ru._({id:"6MxxvO"}),icon:r.MNJ,onClick:()=>{null==t||t(),d(f.mx.key,!0),setTimeout(()=>(0,g.G)(!1),0)}},{id:"image.web",label:(0,a.jsx)(u.x6,{id:"Of4gkp"}),ariaLabel:c.Ru._({id:"Of4gkp"}),icon:r.$UM,onClick:()=>{null==t||t(),d(f.Rn.key,!0),setTimeout(()=>(0,g.G)(!1),0)}},{id:"image.ai-generated",label:(0,a.jsx)(u.x6,{id:"UQ4o1/"}),ariaLabel:c.Ru._({id:"UQ4o1/"}),icon:r._$C,onClick:()=>{null==t||t(),d(f.Up.key,!0),setTimeout(()=>(0,g.G)(!1),0)}}],b=[{id:"image.custom",label:(0,a.jsx)(u.x6,{id:"6MxxvO"}),ariaLabel:c.Ru._({id:"6MxxvO"}),icon:r.MNJ,onClick:()=>{null==t||t(),m(f.mx.key),setTimeout(()=>null==i?void 0:i(!1),0)}},{id:"image.web",label:(0,a.jsx)(u.x6,{id:"Of4gkp"}),ariaLabel:c.Ru._({id:"Of4gkp"}),icon:r.$UM,onClick:()=>{null==t||t(),m(f.Rn.key),setTimeout(()=>null==i?void 0:i(!1),0)}},{id:"image.ai-generated",label:(0,a.jsx)(u.x6,{id:"UQ4o1/"}),ariaLabel:c.Ru._({id:"UQ4o1/"}),icon:r._$C,onClick:()=>{null==t||t(),m(f.Up.key),setTimeout(()=>null==i?void 0:i(!1),0)}}];return(0,a.jsx)(n.az,{pos:"relative",zIndex:100,...s,children:(0,a.jsx)(o.s,{marginBottom:"-8px",onClick:h.dG,children:(l?b:p).map((e,t)=>(0,a.jsx)(k,{...e},t))})})},k=(0,m.memo)(e=>{let{label:t,ariaLabel:l,icon:n,id:o,onClick:r}=e,u=(0,p.rd)();return(0,a.jsx)(d.Tz,{label:t,placement:"top",closeOnClick:!0,children:(0,a.jsx)(i.K,{icon:(0,a.jsx)(s.g,{icon:n,size:"1x"}),"aria-label":l,"data-testid":"quick-action","data-test-media-source":o,variant:"ghost",rounded:"md",onMouseDown:r,width:"32px",height:"32px",color:u?b.N.DARK_ICON_COLOR:b.N.LIGHT_ICON_COLOR,display:"flex",alignItems:"center",justifyContent:"center",p:1,cursor:"pointer",_hover:"image.ai-generated"===o?u?{color:b.N.DARK_AI_BTN_HOVER_COLOR,bg:b.N.DARK_AI_BTN_HOVER_BG}:{color:b.N.LIGHT_AI_BTN_HOVER_COLOR,bg:b.N.LIGHT_AI_BTN_HOVER_BG}:u?{color:b.N.DARK_BTN_HOVER_COLOR,bg:b.N.DARK_BTN_HOVER_BG}:{color:b.N.LIGHT_BTN_HOVER_COLOR,bg:b.N.LIGHT_BTN_HOVER_BG},animation:"fadeIn",transition:"color 0.2s, background-color 0.2s"})})});k.displayName="QuickActionButton"},21696:(e,t,l)=>{"use strict";l.d(t,{B:()=>s,j:()=>r});var a=l(14041),n=l(88957),o=l(95709),i=l(94984);let r=(e,t)=>(0,a.useCallback)(()=>{e.chain().focus().selectNodeAtPos(t(),!1).run(),setTimeout(()=>{e.view.focus()})},[e,t]),s=()=>{let e=(0,n.jL)(),t=(0,n.GV)(o.Pj),l=(0,n.GV)(o.kW),r=(0,n.GV)(i.HF);return{currentMediaDrawerSourceKey:t,isQuickAction:l,setMediaDrawerSourceKeyAction:(0,a.useCallback)(function(t){let l=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e((0,o.st)({sourceKey:t,overrideDefault:l}))},[e]),currentEditBackgroundDrawerSourceKey:r,setBackgroundDrawerSourceKeyAction:(0,a.useCallback)(t=>{e((0,i.mR)({sourceKey:t}))},[e])}}},73818:(e,t,l)=>{"use strict";l.d(t,{Ub:()=>o,Bz:()=>a.B,j8:()=>a.j}),l(48416);var a=l(21696);let n=["image.custom","image.web","image.ai-generated","accent.theme"],o=e=>n.includes(e)},80916:(e,t,l)=>{"use strict";l.d(t,{N:()=>a});let a={LIGHT_BG:"gray.200",LIGHT_COLOR:"gray.300",LIGHT_ICON_COLOR:"gray.400",LIGHT_BTN_HOVER_BG:"gray.100",LIGHT_BTN_HOVER_COLOR:"gray.500",LIGHT_AI_BTN_HOVER_BG:"trueblue.100",LIGHT_AI_BTN_HOVER_COLOR:"trueblue.300",DARK_BG:"gray.800",DARK_COLOR:"gray.600",DARK_ICON_COLOR:"gray.600",DARK_BTN_HOVER_BG:"gray.700",DARK_BTN_HOVER_COLOR:"gray.400",DARK_AI_BTN_HOVER_BG:"trueblue.800",DARK_AI_BTN_HOVER_COLOR:"trueblue.300",LIGHT_GALLERY_BG:"gray.100",DARK_GALLERY_BG:"gray.900"}},27930:(e,t,l)=>{"use strict";l.d(t,{Ud:()=>C,VM:()=>A,Hy:()=>w.Hy,Pf:()=>w.Pf,Td:()=>w.Td});var a=l(13236),n=l(81570),o=l(83380),i=l(58599),r=l(43873),s=l(90406),d=l(31085),u=l(25420),c=l(12917),m=l(14041),f=l(4977),p=l(88957),g=l(61690),h=l(57284),b=l(25472),y=l(95905),v=l(17835),k=l(62216),w=l(94007),x=l(73818);let S=e=>(0,d.jsx)(h.u,{...e,as:"div",children:(0,d.jsx)(A,{...e})}),A=e=>{var t;let{node:l,decorations:a,editor:n}=e,{source:i,horizontalAlign:r,uploadStatus:s,loadImageParams:h,loadImageStatus:S}=l.attrs,{getPos:A}=e,{isFullWidth:C}=(0,b.D)(a),z=(null===(t=k.Fn[i])||void 0===t?void 0:t.icon)||c.Cyq,I=(0,v.NZ)(e),j=(0,x.j8)(n,A),F=(0,p.GV)(g.nD),B=(0,o.f)(),R=(0,m.useCallback)(()=>{B({isOpen:!0})},[B]);return(0,d.jsx)(u.s,{w:"100%",h:"100%",dir:(0,y.fZ)(a,r),direction:"column",sx:(0,y.yp)(r),children:(0,d.jsx)(w.Pf,{hasUploadError:s===f.A.Error&&!n.isThumbnail,isUploading:s===f.A.Uploading,isLoading:"queued"===S&&!n.isThumbnail,loadingProvider:null==h?void 0:h.provider,"data-content-reference":!0,icon:z,width:C||I?"100%":"18em",maxW:"100%",h:I?"100%":"10em",maxH:"100%",onSelectAndFocus:j,defaultSource:i,"data-drag-handle":!0,"data-selection-ring":!0,"data-selection-background":!0,borderRadius:"var(--box-border-radius)",hasQuickActions:!n.isThumbnail,handleDoubleClick:F?R:void 0})})},C=a.bP.create({name:"mediaPlaceholder",group:"block media",atom:!0,selectable:!0,draggable:!0,priority:r.y.MediaPlaceholder,addNodeView:()=>(0,i.gu)(S),addAttributes:()=>({source:{},fullWidthBlock:{default:!1}}),addKeyboardShortcuts:()=>({Enter:e=>{let{editor:t}=e,l=t.state.selection;return!!(l instanceof n.nh&&(0,s.Bv)(l.node))&&((0,o.G)(),!0)}}),addCommands:()=>({insertMediaBlock:e=>t=>{let{commands:l}=t;return l.insertContentAndSelect({type:"mediaPlaceholder",attrs:{source:e}}),requestAnimationFrame(()=>{(0,o.G)()}),!0}}),parseHTML:()=>[{tag:"img[placeholder=true]",priority:60}],renderHTML(e){let{HTMLAttributes:t}=e;return["img",(0,a.KV)(t,{placeholder:"true"})]}})},57569:(e,t,l)=>{"use strict";l.d(t,{X0:()=>h,Y3:()=>g,u4:()=>b});var a=l(31085),n=l(78141),o=l(97331),i=l.n(o),r=l(14041),s=l(89864),d=l(95994),u=l(62849),c=l(26374);let m="resizeable-control-wrapper",f=(0,s.yX)([s.cM]),p=(e,t)=>Math.max(e,d.MK*Math.max(t.clientWidth/t.clientHeight,1));function g(e){let[t,l]=(0,r.useState)(!1),a=(0,u.jm)(),o=(0,r.useRef)(null),i=(0,c.KS)(o),[s,d]=(0,r.useState)(!1),m=(0,r.useCallback)(()=>{var t,a;null===(t=(a=e.commands).forceHideBubbleMenu)||void 0===t||t.call(a,!0),l(!0)},[e]),f=(0,r.useCallback)(()=>{var t,a;null===(t=(a=e.commands).forceHideBubbleMenu)||void 0===t||t.call(a,!1),l(!1)},[e]);return(0,n.w)(()=>{var t,l;null===(t=(l=e.commands).forceHideBubbleMenu)||void 0===t||t.call(l,s||i)},[e,s,i]),{ref:o,isResizing:s,setIsResizing:d,isAnimating:t,resizeableSx:{".moveable-control":{display:a||i||t?"none":""}},onLayoutAnimationStart:m,onLayoutAnimationComplete:f}}let h={[".".concat(m)]:{zIndex:11,".moveable-control":{bg:"white",border:"2px solid var(--chakra-colors-trueblue-300)",w:"".concat(8,"px"),h:"".concat(8,"px"),opacity:1,zIndex:10,borderRadius:0,_hover:{opacity:1},transitionProperty:"opacity",transitionDuration:"normal","&.moveable-ne, &.moveable-sw":{cursor:"nesw-resize"},"&.moveable-nw, &.moveable-se":{cursor:"nwse-resize"},"&.moveable-se, &.moveable-ne, &.moveable-e":{marginLeft:"-".concat(5,"px")},"&.moveable-sw, &.moveable-nw, &.moveable-w":{marginLeft:"-".concat(3,"px")},"&.moveable-ne, &.moveable-nw, &.moveable-n":{marginTop:"-".concat(3,"px")},"&.moveable-se, &.moveable-sw, &.moveable-s":{marginTop:"-".concat(5,"px")},"&.moveable-e, &.moveable-w":{cursor:"ew-resize",marginTop:"-".concat(4,"px")},"&.moveable-n, &.moveable-s":{cursor:"ns-resize",marginLeft:"-".concat(4,"px")}},".moveable-line":{display:"none"}}},b=e=>{let{imageWrapperRef:t,setIsResizing:l,updateResizeAttrs:n,refreshDeps:o,keepRatio:s=!0,onResizing:u}=e,c=(0,r.useRef)(null);return(0,r.useEffect)(()=>{setTimeout(()=>{requestAnimationFrame(()=>{var e,t;null===(e=c.current)||void 0===e||e.updateRect(),null===(t=c.current)||void 0===t||t.updateTarget()})},300)},[o]),(0,r.useEffect)(()=>{let e=()=>{var e;null===(e=c.current)||void 0===e||e.updateTarget()},t=i()(e,250);return document.addEventListener("drop",e),window.addEventListener("resize",t),()=>{document.removeEventListener("drop",e),window.removeEventListener("resize",t)}},[]),(0,a.jsx)(f,{ref:e=>{c.current=e},className:m,target:t.current,renderDirections:["se","nw","sw","ne","n","s","e","w"],keepRatio:s,draggable:!1,resizable:!0,origin:!1,onResizeStart:()=>{l(!0)},onResize:e=>{let{target:t,width:l,height:a}=e,n=p(l,t),o=s?a:p(a,t);t.style.width="".concat(n,"px"),s||(t.style.height="".concat(o,"px")),null==u||u({width:n,height:o})},onResizeEnd:e=>{let{target:t}=e,a=t.clientWidth,o=t.clientHeight,i=parseFloat(getComputedStyle(t).fontSize)/d.Ef;n({width:a/i,height:s?null:o/i,isAuto:!1}),l(!1),t.style.width="",t.style.height=""}})}},12127:(e,t,l)=>{"use strict";l.d(t,{p:()=>d,z:()=>s});var a=l(99742),n=l(81570),o=l(387),i=l(86671);let r=new n.hs("UniqueMediaId"),s=()=>(0,a.Ak)(5),d=i.S.extend({name:"UniqueMediaId"}).configure({attributeName:"id",types:["image","embed","video","smartLayoutCell"],initialValue:s,filterTransaction:o.kz,pluginKey:r})},70031:(e,t,l)=>{"use strict";l.d(t,{Q:()=>d});var a=l(13236),n=l(4977),o=l(17539),i=l(90406),r=l(93090),s=l(39452);let d=a.YY.create({name:"mediaUpload",addCommands(){return{cancelImageUploadsOnLoad:()=>e=>{let{tr:t,state:l}=e;return!!this.editor.isEditable&&((0,a.xe)(l.doc,e=>{let t=(0,s.um)(e);return!!(t&&t.uploadStatus===n.A.Uploading)}).forEach(e=>{let l=(0,s.um)(e.node),a=(0,s.wH)(e.node,(null==l?void 0:l.src)?{uploadStatus:n.A.Done}:{tempUrl:null,uploadStatus:n.A.Error});t.setNodeMarkup(e.pos,null,a).setMeta("addToHistory",!1).setMeta("imageUploadUpdateAttrs",!0)}),!0)},uploadBlobsOnLoad:()=>e=>{let{tr:t,state:l}=e;return!!this.storage.orgId&&!!this.editor.isEditable&&((0,a.xe)(l.doc,e=>{let t=(0,s.um)(e);return!!(null==t?void 0:t.src)&&t.src.startsWith("blob:")}).forEach(e=>{let l=(0,s.um)(e.node);if(!l)return;let a=l.src,n=(0,s.wH)(e.node,(0,s.F)(a));t.setNodeMarkup(e.pos,null,n).setMeta("addToHistory",!1).setMeta("imageUploadUpdateAttrs",!0),(0,r.xH)(this.editor,a)}),!0)},uploadRemoteUrlsOnLoad:()=>e=>{let{tr:t,state:l}=e;return!!this.storage.orgId&&!!this.editor.isEditable&&((0,a.xe)(l.doc,e=>{let t=(0,s.um)(e);return!!(null==t?void 0:t.src)&&t.src.startsWith("http")&&(0,o.cW)(t.src)&&t.uploadStatus!==n.A.Done}).forEach(e=>{var l;let a=(0,s.um)(e.node);if(!a)return;let o=a.src,i=(0,s.wH)(e.node,{uploadStatus:n.A.Uploading,source:null!==(l=a.source)&&void 0!==l?l:"image.custom",tempUrl:o});t.setNodeMarkup(e.pos,null,i).setMeta("addToHistory",!1).setMeta("imageUploadUpdateAttrs",!0),(0,r.XE)(this.editor,o,void 0,!0)}),!0)},uploadDataUrlsOnLoad:()=>e=>{let{tr:t,state:l}=e;return!!this.storage.orgId&&!!this.editor.isEditable&&((0,a.xe)(l.doc,e=>{let t=(0,s.um)(e);return!!(null==t?void 0:t.src)&&t.src.startsWith("data:")}).forEach(e=>{let l=(0,s.um)(e.node);if(!l)return;let a=(0,o.Xz)(l.src),n=URL.createObjectURL(a),i=(0,s.wH)(e.node,(0,s.F)(n));t.setNodeMarkup(e.pos,null,i).setMeta("addToHistory",!1).setMeta("imageUploadUpdateAttrs",!0),(0,r.XE)(this.editor,n,a)}),!0)},initializeUploadExtension:e=>t=>{let{chain:l}=t;return this.storage.orgId=e,l().cancelImageUploadsOnLoad().uploadBlobsOnLoad().uploadDataUrlsOnLoad().uploadRemoteUrlsOnLoad().revokeAllImageTempURLs().run(),!0},revokeAllImageTempURLs:()=>e=>{let{tr:t,state:l}=e;return(0,a.xe)(l.doc,e=>{let t=(0,s.um)(e);return!!(t&&t.tempUrl&&t.src&&t.uploadStatus===n.A.Done)}).forEach(e=>{let l=(0,s.wH)(e.node,{tempUrl:null});t.setNodeMarkup(e.pos,null,l).setMeta("addToHistory",!1).setMeta("imageUploadUpdateAttrs",!0)}),!0},revokeImageTempURLs:e=>t=>{let{tr:l,state:n}=t;return(0,a.xe)(n.doc,t=>{let l=(0,s.um)(t);return!!l&&l.tempUrl===e}).forEach(e=>{let t=(0,s.wH)(e.node,{tempUrl:null});l.setNodeMarkup(e.pos,null,t).setMeta("addToHistory",!1).setMeta("imageUploadUpdateAttrs",!0)}),URL.revokeObjectURL(e),!0},updateImageOnUploadFailure:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return l=>{let{tr:a,state:o}=l,i=o.doc.nodeAt(e);if(!i||!i.attrs)return!1;let r=(0,s.um)(i),d=t?{...r,uploadStatus:n.A.Done}:(0,s.yK)({isError:!0}),u=(0,s.wH)(i,d);return a.setNodeMarkup(e,void 0,u).setMeta("imageUploadUpdateAttrs",!0).setMeta("addToHistory",!1).setMeta("annotationEvent",{type:"update-node-attrs",pos:e}),!0}},updateImageOnUploadSuccess:(e,t)=>l=>{let{tr:a,state:n}=l,o=n.doc.nodeAt(e);if(!o||!o.attrs)return!1;let r=(0,s.yK)({isError:!1,result:t,attrs:o.attrs}),d=(0,i.Ez)(r),u=(0,s.wH)(o,d);return a.setNodeMarkup(e,void 0,u).setMeta("imageUploadUpdateAttrs",!0).setMeta("addToHistory",!1).setMeta("annotationEvent",{type:"update-node-attrs",pos:e}),!0}}},addStorage:()=>({orgId:void 0,completedUploads:{}}),addProseMirrorPlugins(){return[(0,r.Qx)(this.editor)]}})},79893:(e,t,l)=>{"use strict";l.d(t,{Ki:()=>n.Ki,Q8:()=>a.Q,XJ:()=>n.XJ,bY:()=>n.bY,um:()=>n.um,wH:()=>n.wH,wt:()=>n.wt,yK:()=>n.yK});var a=l(70031),n=l(39452)},20265:(e,t,l)=>{"use strict";l.d(t,{TH:()=>c,YC:()=>p,kT:()=>m,nK:()=>f});var a=l(99742),n=l(74327),o=l(4977),i=l(26813),r=l(20277),s=l(16676),d=l(17539),u=l(39452);let c=(e,t,l,r)=>{var s;let c;let m={type:i.h.IMAGE,source:n.mx.key,image:{uploadStatus:o.A.Uploading,source:n.mx.key}};(0,d.aI)(l.type)?(m.image.showPlaceholder=!0,c="HEIC_tempId_".concat((0,a.Ak)())):c=URL.createObjectURL(l),m.image.tempUrl=c;let f=(t,l)=>{if(!c&&!l)return;let a=c||l;(0,u.Ki)(e,a,t)};t.setNodeAttribute(r,"background",m).setMeta("imageUploadUpdateAttrs",!0),(0,n.QM)(l,null===(s=e.storage.mediaUpload)||void 0===s?void 0:s.orgId,{onOriginalFileUpload:f,onUploadComplete:f,onUploadFailed:t=>{(0,u.wt)(e,c,t),URL.revokeObjectURL(c)}})},m=(e,t)=>t.map(t=>(0,d.u3)(t.type)?p(t,e):(0,s.cZ)(t.type,(0,s.QC)(t))?g(t,e):null).filter(e=>null!==e),f=function(e,t,l){let a=m(e,t);if(0==a.length)return;let n=a.map(e=>e.content),o=e.state.doc.resolve(l),i=o.parent.inlineContent,s=l;i&&0===o.parentOffset?s=l-1:i&&null===o.nodeAfter&&(s=l+1),e.chain().insertContentAt(s,n,{updateSelection:!1}).command(e=>{var t;let{tr:l}=e,a=l.doc.resolve(l.mapping.map(s)),n=(0,r.s)(l.doc.resolve(a.pos-((null===(t=a.nodeBefore)||void 0===t?void 0:t.nodeSize)||1)));return n&&l.setSelection(n),!0}).run(),a.forEach(e=>{e.upload()}),setTimeout(()=>{e.commands.scrollIntoView()},200)},p=(e,t)=>{let l={uploadStatus:o.A.Uploading,source:n.mx.key};(0,d.aI)(e.type)?(l.showPlaceholder=!0,l.tempUrl="HEIC_tempId_".concat((0,a.Ak)())):l.tempUrl=URL.createObjectURL(e);let i=(e,a)=>{let n=l.tempUrl;(n||a)&&(0,u.Ki)(t,n||a,e)},r={onOriginalFileUpload:i,onUploadComplete:i,onUploadFailed:e=>{l.tempUrl&&((0,u.wt)(t,l.tempUrl,e),URL.revokeObjectURL(l.tempUrl))}};return{name:e.name,content:{type:"image",attrs:l},upload:()=>{var l;return(0,n.QM)(e,null===(l=t.storage.mediaUpload)||void 0===l?void 0:l.orgId,r)}}},g=(e,t)=>{let l=URL.createObjectURL(e),a={...(0,u.bY)(e),url:l},o=(e,a)=>{(l||a)&&(0,u.XJ)(t,l||a,e)},i={onOriginalFileUpload:o,onUploadComplete:o};return{name:e.name,content:{type:"embed",attrs:a},upload:()=>{var l;return(0,n.QM)(e,null===(l=t.storage.mediaUpload)||void 0===l?void 0:l.orgId,i,"node","doc")}}}},93090:(e,t,l)=>{"use strict";l.d(t,{Qx:()=>p,p$:()=>y,dM:()=>g,bC:()=>v,KS:()=>f,xH:()=>m,XE:()=>c});var a=l(81570),n=l(74327),o=l(16676),i=l(17539),r=l(57036),s=l(20265);let d=e=>RegExp("^\\s*\\s*$","s").test(e);var u=l(39452);let c=(e,t,l,a)=>{let o=(l,a)=>{(0,u.Ki)(e,a||t,l)},i={onOriginalFileUpload:o,onUploadComplete:o,onUploadFailed:l=>{(0,u.wt)(e,t,l,a)}};l?(0,n.QM)(l,e.storage.mediaUpload.orgId,i):(0,n.j_)(t,e.storage.mediaUpload.orgId,i)},m=async(e,t)=>{try{let l=await fetch(t),a=await l.blob(),n=new File([a],"blob.png",{type:a.type});c(e,t,n)}catch(l){(0,u.wt)(e,t,l)}},f=e=>(0,i.u3)(e.type)||(0,o.cZ)(e.type,(0,o.QC)(e)),p=e=>new a.k_({props:{transformPasted:t=>(t.content.descendants(t=>{if("image"===t.type.name&&t.attrs.tempUrl){let l=e.storage.mediaUpload.completedUploads[t.attrs.tempUrl];l&&Object.assign(t.attrs,(0,u.wH)(t,(0,u.yK)({isError:!1,result:l})))}else if("image"===t.type.name&&t.attrs.src&&!(0,i.md)(t.attrs.src)){let l,a=t.attrs.src;if(a.startsWith("blob:")){Object.assign(t.attrs,(0,u.F)(a)),m(e,a);return}a.startsWith("data:")&&(l=(0,i.Xz)(t.attrs.src),a=URL.createObjectURL(l)),Object.assign(t.attrs,(0,u.F)(a)),c(e,a,l)}}),t),handlePaste:(t,l,a)=>b(e,t,l,a),handleDOMEvents:{drop:(t,l)=>h(e,t,l)}}}),g=(e,t)=>{var l;if(!e.clipboardData)return null;let a=e.clipboardData.getData("text/html"),n=e.clipboardData.getData("text/plain");if(n&&!a&&d(n))return[(0,i.Qm)(n)];let o=Array.prototype.slice.call(e.clipboardData.items);return o.some(e=>"text/html"===e.type)&&(t.content.childCount>1||(null===(l=t.content.firstChild)||void 0===l?void 0:l.type.name)!=="image")?null:o.map(e=>e.getAsFile()).filter(e=>!!e).filter(f)},h=(e,t,l)=>{if(t.props.editable&&!t.props.editable(t.state))return!1;let a=y(l).filter(f);if(0===a.length)return!1;let n=(0,r.M)(t,l);return!!n&&(l.preventDefault(),(0,s.nK)(e,a,n),!0)},b=(e,t,l,a)=>{if(t.props.editable&&!t.props.editable(t.state))return!1;let n=g(l,a);if(!n||0===n.length)return!1;let{selection:o}=t.state,i=o.from;return o.empty||e.commands.deleteSelection(),(0,s.nK)(e,n,i),!0};function y(e){let t=[],l=e.target;if(e.dataTransfer){let l=e.dataTransfer;l.files&&l.files.length?t=l.files:l.items&&l.items.length&&(t=l.items)}else l&&l.files&&(t=l.files);return Array.prototype.slice.call(t)}let v=(e,t,l)=>{let a=g(t,l);if(!a||1!==a.length)return!1;let n=a[0],o=(0,s.YC)(n,e);return{attrs:o.content.attrs,upload:o.upload}}},39452:(e,t,l)=>{"use strict";l.d(t,{F:()=>f,Ki:()=>y,XJ:()=>w,bY:()=>x,um:()=>g,wH:()=>p,wt:()=>v,yK:()=>m});var a=l(13236),n=l(46123),o=l.n(n),i=l(82451),r=l.n(i),s=l(41263),d=l.n(s),u=l(4977),c=l(16676);let m=e=>{let{result:t,isError:l,attrs:a}=e;if(l)return{uploadStatus:u.A.Error,showPlaceholder:!0,tempUrl:null,src:null};let{fullResults:n,...o}=t;return{uploadStatus:u.A.Done,showPlaceholder:!1,source:(null==a?void 0:a.source)||"image.custom",...o}},f=e=>({tempUrl:e,uploadStatus:u.A.Uploading,src:null,source:"image.custom"}),p=(e,t)=>{let l=e.type.spec.imageKeyPath,a=l?d()({},l,t):t;return r()({},e.attrs,a)},g=e=>{let t=e.type.spec.imageKeyPath;return t||"image"===e.type.name?t?o()(e.attrs,t,e.attrs):e.attrs:null},h=(e,t)=>(0,a.xe)(e.state.doc,e=>{let l=g(e);return[null==l?void 0:l.tempUrl,null==l?void 0:l.src].includes(t)}),b=(e,t)=>(0,a.xe)(e.state.doc,e=>"embed"===e.type.name&&e.attrs.url===t),y=(e,t,l)=>{e.parentEditor&&(e=e.parentEditor),t&&k(e,l,t);let a=h(e,t);if(0==a.length){console.warn("[MediaUpload] Couldn't find placeholder node");return}a.forEach(t=>{let{pos:a}=t;e.commands.updateImageOnUploadSuccess(a,l)}),setTimeout(()=>{e.commands.revokeImageTempURLs(t)},3e4)},v=function(e,t,l){let a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.parentEditor&&(e=e.parentEditor);let n=h(e,t);if(0==n.length){console.warn("[MediaUpload] Couldn't find placeholder node");return}n.forEach(t=>e.commands.updateImageOnUploadFailure(t.pos,a)),console.error(l)},k=(e,t,l)=>{e.storage.mediaUpload.completedUploads[l]=t},w=(e,t,l)=>{let a=b(e,t);if(0==a.length){console.warn("[MediaUpload] Couldn't find placeholder node");return}a.forEach(t=>{e.commands.updateAttributesAtPos(t.pos,{url:l.src,sourceUrl:l.src,embed:{url:l.src},thumbnail:{src:l.thumbnail,uploadStatus:u.A.Done,showPlaceholder:!1}})})},x=e=>({meta:{title:e.name,description:(0,c.z3)(e.size,1)},thumbnail:{uploadStatus:u.A.Uploading,showPlaceholder:!0},source:"embed.pdf"})},90286:(e,t,l)=>{"use strict";l.d(t,{K:()=>u,z:()=>c});var a=l(31085),n=l(80532);l(14041);var o=l(73893),i=l(88957),r=l(95580),s=l(61690),d=l(87643);let u=e=>{let{enterZoom:t,doubleClickNonZoomHandler:l,...r}=e,d=(0,i.GV)(s.nD),u=!d,c=d&&!l;return o.$.GAMMA_PUPPETEER_SERVICE?null:(0,a.jsx)(n.az,{inset:0,w:"100%",h:"100%",position:"absolute",zIndex:1,cursor:u?"zoom-in":"default",onDoubleClick:c?t:l,onClick:u?t:void 0,"data-testid":"zoom-click-capture","data-zoom-click-capture":!0,opacity:0,...r})},c=e=>{let{decorations:t,node:l,editor:o}=e,u=(0,d.DM)(t)||!(0,r.We)(o),c=(0,i.GV)(s.nD),{displayStyle:m}=l.attrs;return(0,a.jsx)(n.az,{position:"absolute",inset:0,zIndex:1,pointerEvents:c&&!u&&"inline"===m?"auto":"none",cursor:"default"})}},76304:(e,t,l)=>{"use strict";l.d(t,{zA:()=>D.z,Kc:()=>D.K,_M:()=>N,Gx:()=>T,$B:()=>H,RL:()=>G});var a=l(31085),n=l(65352),o=l(3091),i=l(25420),r=l(62313),s=l(9021),d=l(80532),u=l(12327),c=l(27372),m=l(63373),f=l(92154),p=l.n(f),g=l(98087),h=l.n(g),b=l(14041),y=l(38452),v=l(22544),k=l(59707),w=l(44507);let x={type:"spring",duration:.5,bounce:0},S=(0,w.Xb)()?"0.75rem":"2.5rem";var A=l(23970),C=l(40173),z=l(12567),I=l(32133),j=l(73524),F=l(88957),B=l(29719),R=l(17303);let _=()=>{let e=(0,F.GV)(R.C),{inPreviewContext:t}=(0,B.$E)();return e&&!t};var M=l(62849);let E=(0,c.P)(d.az),T=e=>{let{children:t,isZoomed:l,exitZoom:n,editor:o}=e,r=(0,I.wA)(),c=_();(0,b.useEffect)(()=>{if(!c)return y.WC.on("keydown","ZOOMABLE_OVERLAY",e=>l&&["ArrowDown","ArrowUp"].includes(e.key)?(e.preventDefault(),!0):!!((0,z.v_)("Esc")(e)||(0,z.v_)("Enter")(e))&&!!l&&(n(),e.preventDefault(),!0))},[n,l,c]),(0,b.useEffect)(()=>{c||r((0,j.WI)({id:"zoomableOverlay",isOpen:l}))},[r,l,c]);let m=(0,b.useRef)(null);return((0,M.Vg)(()=>{if(o.isEditable){if(l){var e;null===(e=m.current)||void 0===e||e.focus()}else o.commands.focus()}},[o,l],[l],!1),c)?null:(0,a.jsx)(C.Z,{children:l&&(0,a.jsxs)(d.az,{position:"fixed",inset:0,padding:S,zIndex:"modal",userSelect:"none",onClick:e=>{!(0,w.mG)()&&(e.target.closest(".image")||e.target.closest("[data-carousel-filmstrip]")||n())},onMouseDown:k.Fw,"data-in-editor-focus":!0,"data-testid":"zoomable-overlay",children:[(0,a.jsx)(E,{position:"absolute",inset:0,initial:{opacity:0},animate:{opacity:(0,w.Xb)()?.9:.86},transition:x,backgroundColor:"black"},"shade"),(0,a.jsx)(d.az,{position:"absolute",right:2,top:2,zIndex:"docked",contentEditable:!1,suppressContentEditableWarning:!0,children:(0,a.jsx)(s.K,{"aria-label":u.Ru._({id:"8qZ5De"}),colorScheme:"whiteAlpha",color:"whiteAlpha.800",size:"md",onClick:n,onMouseDown:k.Fw,icon:(0,a.jsx)(A.U,{}),variant:"ghost",className:"exit-button",ref:m})}),(0,a.jsx)(i.s,{position:"relative",zIndex:"1",h:"100%",w:"100%",pt:"2.8rem",align:"center",justify:"center",direction:"column",css:{"--overlay-maxH":"calc(100vh - 2 * ".concat(S,")"),"--overlay-maxW":"calc(100vw - 2 * ".concat(S,")"),"--media-maxH":"var(--overlay-maxH)","--media-maxW":"var(--overlay-maxW)"},children:t})]})})},O=(0,c.P)(i.s),P="80px",N=e=>{let{children:t,zoomedId:l,isZoomComplete:c,setZoomedId:f,isZoomed:g,exitZoom:w,editor:A}=e,C=p()(t,e=>e.id===l),z=t[C],I=(0,b.useRef)(null),j=(0,b.useCallback)(()=>{f((t[C+1]||t[0]).id)},[C,t,f]),F=(0,b.useCallback)(()=>{f((t[C-1]||h()(t)).id)},[C,t,f]);return((0,b.useEffect)(()=>{if(g&&!(t.length<2))return y.WC.on("keydown","ZOOMABLE_OVERLAY",e=>{switch(e.key){case"ArrowLeft":return F(),!0;case"ArrowRight":return j(),!0;default:return!1}})},[w,g,f,t,C,j,F]),(0,b.useEffect)(()=>{if(I.current&&c){let e=I.current.querySelector('[data-thumb-id="'.concat(l,'"]'));null==e||e.scrollIntoView({inline:"center",behavior:"smooth"})}},[l,c]),v.D1)?null:(0,a.jsxs)(T,{isZoomed:g,exitZoom:w,editor:A,children:[(0,a.jsx)(i.s,{flex:1,w:"100%",justify:"center",align:"center","data-testid":"zoomable-carousel-expanded",pos:"relative",children:(0,a.jsx)(m.N,{children:z&&(0,a.jsx)(O,{css:{"--media-maxH":"calc(var(--overlay-maxH) - ".concat(P," - ").concat(S,")")},initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},position:"absolute",transition:x,w:"100%",h:"100%",children:z.full},z.id)})}),t.length>1&&(0,a.jsx)(r.z,{w:"100vw",mt:S,px:S,gap:0,"data-carousel-filmstrip":!0,children:(0,a.jsxs)(i.s,{overflowX:"auto",width:"100%",justify:"center",align:"stretch",overflow:"hidden",children:[(0,a.jsx)(s.K,{icon:(0,a.jsx)(n.Y,{boxSize:"24px"}),"aria-label":u.Ru._({id:"MHk+7g"}),colorScheme:"whiteAlpha",variant:"ghost",size:"md",color:"whiteAlpha.900",borderColor:"whiteAlpha.200",borderWidth:"2px",borderStyle:"solid",onClick:F,_hover:{bg:"whiteAlpha.200",borderColor:"whiteAlpha.400"},h:"auto",mr:2}),(0,a.jsx)(r.z,{spacing:1,onClick:k.dG,"data-testid":"zoomable-carousel-thumbnails",ref:I,overflow:"scroll",sx:{"::-webkit-scrollbar":{display:"none"}},children:t.map(e=>{let t=e.id===l;return(0,a.jsx)(d.az,{border:t?"2px solid white":"2px solid transparent",boxSizing:"content-box",borderRadius:"md",overflow:"hidden",onClick:()=>f(e.id),transitionProperty:"border",transitionDuration:"normal",h:P,css:{"--media-maxH":P,"--media-maxW":"200px",flexShrink:0},"data-thumb-id":e.id,cursor:"pointer",padding:"2px",_hover:{borderColor:!t&&"whiteAlpha.500"},children:(0,a.jsx)(d.az,{w:"100%",h:"100%",borderRadius:"sm",overflow:"hidden",children:e.thumbnail})},e.id)})}),(0,a.jsx)(s.K,{icon:(0,a.jsx)(o.v,{boxSize:"24px"}),"aria-label":u.Ru._({id:"EatZYJ"}),colorScheme:"whiteAlpha",variant:"ghost",size:"md",color:"whiteAlpha.900",borderColor:"whiteAlpha.200",borderWidth:"2px",borderStyle:"solid",onClick:j,_hover:{bg:"whiteAlpha.200",borderColor:"whiteAlpha.400"},h:"auto",ml:2})]})})]})};var D=l(90286),L=l(61690);let W=e=>t=>(0,L.dK)(t)===e,U=e=>t=>{let l=(0,L.dK)(t);return l&&e.includes(l)?l:null},G=e=>{let t=(0,I.wA)(),l=(0,F.GV)(W(e)),a=(0,b.useCallback)(l=>{t((0,L.a)({nodeId:l?e:null}))},[t,e]),n=(0,b.useCallback)(()=>a(!0),[a]),o=(0,b.useCallback)(()=>a(!1),[a]);return{isZoomed:l,setIsZoomed:a,enterZoom:n,exitZoom:o}},H=e=>{let t=(0,I.wA)(),l=(0,F.GV)(U(e)),a=!!l,n=(0,b.useCallback)(e=>{t((0,L.a)({nodeId:e}))},[t]),o=(0,b.useCallback)(()=>n(null),[n]),[i,r]=(0,b.useState)(a);return(0,b.useEffect)(()=>{let e;return a?e=window.setTimeout(()=>{r(!0)},1e3*x.duration):r(!1),()=>clearTimeout(e)},[a]),{isZoomed:a,isZoomComplete:i,zoomedId:l,setZoomedId:n,exitZoom:o}}},95994:(e,t,l)=>{"use strict";l.d(t,{Ef:()=>o,MK:()=>n,Mg:()=>r,St:()=>i});var a=l(63751);let n=30,o=16,i=a.s5*o,r=.6},87071:(e,t,l)=>{"use strict";l.d(t,{E:()=>i,S:()=>o});var a=l(69069),n=l(57569);let o="gamma-moveable-wrapper",i={...a.BT,...n.X0}},90406:(e,t,l)=>{"use strict";l.d(t,{Bv:()=>i,Ez:()=>b,JY:()=>c,Kk:()=>h,XJ:()=>p,Xs:()=>g,Zj:()=>u,_Y:()=>s,bi:()=>r,eb:()=>m,gk:()=>f,lQ:()=>d});var a=l(25817),n=l(95994);let o=["image","video","embed","mediaPlaceholder"],i=e=>r(e.type),r=e=>o.includes(e.name),s=e=>"video"===e.type.name||"embed"===e.type.name,d=e=>e.href||e.url||e.sourceUrl||e.embedUrl||void 0,u=e=>{var t;return(null===(t=e.embed)||void 0===t?void 0:t.url)?e.embed.url:"embedUrl"in e&&e.embedUrl?e.embedUrl:d(e)},c=e=>{var t,l;let a=e.attrs;return[null===(t=a.meta)||void 0===t?void 0:t.title,null===(l=a.meta)||void 0===l?void 0:l.site].filter(Boolean).join(" - ")},m=(e,t)=>{var l;return null!==(l=e.clickBehavior)&&void 0!==l?l:t?"newTab":"expand"},f=e=>null!=e?e:"expand",p=e=>{var t,l;return null!==(l=null==e?void 0:null===(t=e.split(".").pop())||void 0===t?void 0:t.startsWith("svg"))&&void 0!==l&&l},g=e=>p((null==e?void 0:e.src)||(null==e?void 0:e.tempUrl))&&e.source===a.Z.key,h=(e,t)=>{if(!e)return e;try{let l=new URL(e);return l.searchParams.set("ctx",t||"inline-svg"),l.toString()}catch(t){return console.error("[getSrcUrlForInlineSvg] Error with src url for inline SVG",t),e}},b=e=>{let{width:t,height:l,resize:a}=e.meta||{};if(!t||!l||(null==a?void 0:a.isAuto)===!1)return e;let o=n.St,i=window.innerHeight*n.Mg;return l/t*o>i?{...e,resize:{width:Math.min(o,t/l*i),clipType:null,clipPath:null,clipAspectRatio:null,isAuto:!0}}:e}},56922:(e,t,l)=>{"use strict";l.d(t,{D0:()=>n,Hj:()=>i,cw:()=>o,hu:()=>s,kb:()=>a,md:()=>r});let a=75,n="".concat(a,"px"),o=10,i="navbar-view-backdrop",r="navbar-view-content",s="data-navbar-closed-toggle"},97404:(e,t,l)=>{"use strict";l.d(t,{a:()=>r});var a=l(13236),n=l(81570),o=l(20277),i=l(68566);let r=a.YY.create({name:"focusHelpers",addCommands:()=>({focusDelayed:()=>e=>{let{editor:t}=e;return requestAnimationFrame(()=>t.commands.focus()),!0},insertContentAndSelect:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return l=>{let{chain:a,state:n}=l,{from:o,$from:i}=n.selection;return 0===i.parentOffset?a().insertContentAt({from:o-1,to:o},e,{updateSelection:!1}).selectInsertedNode(t).run():a().insertContent(e,{updateSelection:!1}).selectInsertedNode(t).run()}},focusMapped:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;return a=>{let{tr:n,view:i}=a,r=n.mapping.map(e,l)+t;try{let e=(0,o.s)(n.doc.resolve(r));e&&n.setSelection(e),i.focus()}catch(e){console.error("[focusMapped] error selecting pos",r,e)}return!0}},selectInsertedNode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return t=>{let{tr:l,view:a}=t,n=(0,o.t)(l);if(!n)return!1;let i=(0,o.s)(n,e);return!!i&&(l.setSelection(i),a.focus(),!0)}},selectNodeAtPos:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return l=>{let{state:a,tr:o,view:i}=l;try{o.setSelection(n.nh.create(a.doc,e)),t&&o.scrollIntoView(),i.focus()}catch(t){console.warn("[selectNodeAtPos] Error selecting node",e,t)}return!0}},selectInsideNodeAtPos:(e,t)=>l=>{let{tr:a,state:n}=l,i=n.doc.resolve(e),r=(0,o.s)(i,t);return!!r&&(a.setSelection(r),!0)},deleteSelectionAndSelectNear:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return t=>{let{tr:l,state:a}=t,{selection:n}=a;if(n.empty)return!1;l.deleteSelection().scrollIntoView();let o=(0,i.n)(l.doc.resolve(n.from),e);return o&&l.setSelection(o),!0}}})})},87643:(e,t,l)=>{"use strict";l.d(t,{DM:()=>f,b0:()=>p,bU:()=>g});var a=l(13236),n=l(81570),o=l(73686),i=l(95580),r=l(17835),s=l(77583),d=l(68043),u=l(34095);let c=e=>e.isLeaf||["paragraph","table","tableRow","tableCell","gridLayout","gridCell","heading","title","card","cardLayoutItem","cardAccentLayoutItem","button","buttonGroup","gallery","blockquote","calloutBox","smartLayout","smartLayoutCell","toggle","navbar","navbarLinks"].includes(e.type.name),m=e=>e.isAtom||["gallery","card"].includes(e.type.name),f=e=>e.some(e=>e.spec.focusedNode),p=e=>e.some(e=>e.spec.isSelectingNode),g=a.YY.create({name:"focusedNodes",addProseMirrorPlugins(){let e=this.editor;return[new n.k_({props:{decorations(t){var l;if(!e.isEditable||!(0,i.We)(e)||(null===(l=document.activeElement)||void 0===l?void 0:l.tagName)==="IFRAME")return;let a=t.selection,f=[];return t.doc.nodesBetween(a.from,a.to,(e,t,l)=>{if(c(e)){let i=a instanceof d.HT&&"tableRow"===e.type.name&&a.getTableNode()===l&&a.isRowSelection()&&!a.isColSelection(),r=a instanceof d.HT&&(0,u.hj)(e)&&a.getTableNode()===e&&a.isSelectingAllCells(),s={focusedNode:!0,isSelected:a.from<=t,isFocusedInside:a.from>t||a.to=t+e.nodeSize&&!(a instanceof n.nh)},c=[s.focusedNode?"is-focused":"",s.isSelected?"is-selected":"",s.isFocusedInside?"is-focused-inside":"",s.isSelectingNode?"is-selecting-node":"",s.isSelectingAround?"is-selecting-around":""].join(" ");f.push(o.NZ.node(t,t+e.nodeSize,{class:c},s))}if((0,r.Pb)(e)&&a.from<=t&&a.from<=t)return!1;if("table"===e.type.name&&a instanceof d.HT&&a.isColSelection()&&!a.isSelectingAllCells()){let l=a.$anchorCell.pos,{left:n}=s.J3.get(e).findCell(l-(t+1));f.push(o.NZ.node(t,t+e.nodeSize,{},{isColumnSelected:!0,colNumber:n}))}}),o.zF.create(t.doc,f)}}})]}})},12408:(e,t,l)=>{"use strict";l.d(t,{Ms:()=>o,Qj:()=>n});var a=l(81570);let n=e=>{let t=e.state.selection;return t instanceof a.U3&&!t.empty},o=e=>e.some(e=>e.spec.isFocusedInside)},86047:(e,t,l)=>{"use strict";l.d(t,{I2:()=>j,Rj:()=>I,UE:()=>w,vi:()=>R});var a=l(13236),n=l(65998),o=l(63152),i=l(88957),r=l(65084),s=l(61690),d=l(19534),u=l(45864),c=l(38678),m=l(98371),f=l(95580),p=l(69646),g=l(32262),h=l(82354),b=l(77646),y=l(46896),v=l(15944);let k=()=>n.of.get("presentModeFlat"),w=(e,t)=>{let l=t.pos?e.state.doc.nodeAt(t.pos):null;return l&&I(l,t.cardId)},x=e=>{let{tr:t,editor:l,spotlight:a,bias:n=0,method:o="replace"}=e;t.setMeta(v.n,a);let i=v.n.getState(l.state);if(a.cardId||(0,c.o)({cardId:null,method:o,emitChange:!1}),i.cardId!==a.cardId&&a.cardId){(0,c.o)({cardId:a.cardId,method:o,emitChange:!1});let e=(0,b.W0)(l,a.cardId);e&&t.setSelection(u.J.create(t.doc,e.pos,n))}l.commands.user({spotlight:a})},S=(e,t)=>{if(!t)return;let l=document.querySelector("".concat(e," ").concat((0,h.OB)(t)));l&&(null==l||l.classList.add("cardWiggle"),setTimeout(()=>{null==l||l.classList.remove("cardWiggle")},750))},A=(e,t)=>{let l=w(e,t),a=l&&t.cardId&&t.pos&&R(e,t.cardId,t.pos,e=>I(e,t.cardId),!0).cardId!==t.cardId;return{isSpotlightingBlock:l,isSpotlightingFirstBlock:a}},C=e=>{switch(e.type.name){case"card":return!(0,p.Wq)(e);case"toggle":return(0,y.vb)(e.attrs.id);default:return!1}},z=e=>{switch(e.type.name){case"card":return(0,p.wE)(e.attrs.id,!0),!0;case"toggle":return(0,y.bG)(e.attrs.id,!1),!0;default:return!1}},I=(e,t)=>{switch(e.type.name){case"paragraph":case"heading":case"title":case"math_display":case"codeBlock":return e.textContent.trim().length>0||e.content.content.some(e=>"text"!==e.type.name);case"calloutBox":case"blockquote":case"bullet":case"numbered":case"todo":case"embed":case"video":case"image":case"mediaPlaceholder":case"gallery":case"drawing":case"diagram":case"chart":case"contributors":case"tableOfContents":case"toggleSummary":case"table":case"buttonGroup":case"gridCell":case"smartLayoutCell":return!0;case"toggle":return!(0,y.vb)(e.attrs.id);case"card":{let l=(0,s.Ev)((0,i.KA)().getState()).parents[e.attrs.id].slice(-1)[0];if(k())return!0===(0,p.Wq)(e)&&!1===(0,p.Wq)(l);return l===t}default:return!1}},j=e=>{switch(e.type.name){case"toggle":return(0,y.vb)(e.attrs.id);case"card":return!(0,p.Wq)(e);case"footnote":case"gallery":case"gridCell":case"smartLayoutCell":case"table":case"cardNotes":case"blockquote":case"calloutBox":return!1;default:return!0}};a.YY.create({name:"spotlight",addOptions:()=>({scrollerSelector:"body"}),addCommands(){var e=this;return{syncSpotlightAndScroll:e=>{let{spotlight:t,scroll:l,scrollOffset:a,isFollowing:n=!1}=e;return e=>{let{editor:i,view:r,tr:s}=e,{pos:u,cardId:c}=t,m=v.n.getState(i.state).cardId!==c;if(u){let e=r.state.doc.nodeAt(u),t=r.nodeDOM(u);if(e&&t instanceof HTMLElement){console.debug("[Spotlight.syncSpotlight] Scrolling to specific card at pos: ".concat(u),t);let l=(0,d.jg)(e)&&e.attrs.id===c;setTimeout(()=>requestAnimationFrame(()=>{l?E({}):M({element:t})}),m?h.y0:0)}}else if(null==l?void 0:l.pos){let{pos:e,pct:t}=l;setTimeout(()=>requestAnimationFrame(()=>{i.commands.scrollToPositionInCard(e,t||void 0,a)}),m?h.y0:0)}return(0,o.up)({following:n}),(0,o.ki)({cardId:c}),x({editor:i,tr:s,spotlight:{pos:u,cardId:c}}),!0}},spotlightCardById:function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return l=>{let{editor:a,view:n}=l,o=v.n.getState(a.state),i=(0,b.W0)(a,e);if(!i)return!0;let r=a.state.doc.resolve(i.pos),s=r.depth>1&&k(),d=s?(0,g.hT)(a.state.doc,i.pos):i;if(d){let l=o.cardId!==e;if(s){(0,p.wE)(e,!1),(0,g.Ib)({pos:r.pos,editor:a});let t=n.nodeDOM(i.pos);t instanceof HTMLElement&&setTimeout(()=>requestAnimationFrame(()=>{M({element:t,behavior:"smooth"})}),l?h.y0:0)}return t&&k()?a.commands.spotlightNextBlock(!1,{pos:i.pos,cardId:e}):a.commands.syncSpotlightAndScroll({spotlight:{pos:null,cardId:d.node.attrs.id}})}return!0}},spotlightCurrentCard:()=>e=>{let t,{editor:l,tr:a}=e,n=()=>{console.warn("[Spotlight.spotlightCurrentCard] Couldnt find a card to spotlight, so using first card.");let e=l.view.state.doc.nodeAt(1);return e&&(0,d.jg)(e)?x({editor:l,tr:a,spotlight:{pos:null,cardId:e.attrs.id}}):console.error("[Spotlight.spotlightCurrentCard] nodeAt(1) is unexpectedly not a card. Cannot spotlight"),!0};if(!document.querySelector(this.options.scrollerSelector))return n();let o=l.state.selection.from,i=o&&l.view.coordsAtPos(o);if(i&&i.top0)console.debug("%c [Spotlight.spotlightCurrentCard] Using cursor pos","background-color: deeppink",{posToUse:t=o});else{let e=(0,f.ls)(l,this.options.scrollerSelector,135).pos;console.debug("%c [Spotlight.spotlightCurrentCard] Using top center pos","background-color: deeppink",{posToUse:t=null==e?void 0:e.pos})}(!t||t<2)&&console.warn("%c [Spotlight.spotlightCurrentCard] Using fallback pos","background-color: deeppink",{posToUse:t=2});let r=k()?(0,g.hT)(l.state.doc,t):(0,g.Tv)(l,t,!1);return r&&r.pos?(k()&&(0,g.Ib)({editor:l,pos:t}),x({editor:l,tr:a,spotlight:{pos:null,cardId:r.node.attrs.id}}),!0):n()},ascendUpToParentCard:function(){let t=!(arguments.length>0)||void 0===arguments[0]||arguments[0];return l=>{let{editor:n,view:i,tr:r}=l,s=v.n.getState(n.state),u=s.pos;if(!u){let t=(0,f.ls)(n,e.options.scrollerSelector,window.innerHeight/2).pos;u=null==t?void 0:t.pos}if(!u)return!1;let c=n.view.state.doc.nodeAt(u),m=(0,g.Tv)(n,u,!1);if(k())return!!m&&!!t&&(S(e.options.scrollerSelector,s.cardId),!0);if(!m)return!1;let p=(0,a.eL)(n.state.doc.resolve(m.pos),d.jg);if(!p)return m&&t&&S(e.options.scrollerSelector,m.node.attrs.id),!1;{let e=i.nodeDOM(m.pos);if(!e)return console.warn("[Spotlight.ascendUpToParentCard] Cant find dom node",{domNode:e,presentingCard:m,parentOfPresentingCard:p,node:c,lastSpotlight:s}),!1;let t=p.node.attrs.id,{isSpotlightingBlock:l}=A(n,s);if(l)return n.commands.spotlightNextBlock(!1,{pos:p.pos,cardId:t});(0,o.ki)({cardId:t}),x({editor:n,tr:r,spotlight:{pos:null,cardId:t}}),_(M,h.M2)({element:e})}return!0}},descendIntoCurrentCard:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"replace";return l=>{let{editor:a,tr:n}=l,o=v.n.getState(a.state),i=e||o.pos;if(k())return a.commands.spotlightExpandCard(i);if(!i)return!0;let r=a.view.state.doc.nodeAt(i);if(!(r&&(0,d.jg)(r)&&r.attrs.id!==o.cardId))return!0;let s=r.attrs.id,{isSpotlightingBlock:u}=A(a,o);return(console.debug("[Spotlight.descendIntoCurrentCard]",{node:r,isSpotlightingBlock:u}),u)?a.commands.spotlightNextBlock(!1,{pos:i,cardId:s}):(x({editor:a,tr:n,spotlight:{pos:null,cardId:s},method:t}),setTimeout(()=>{requestAnimationFrame(()=>{E({})})},h.y0),!0)}},spotlightCollapseCard:e=>t=>{let{editor:l,tr:a}=t;if(!k())return l.commands.ascendUpToParentCard();let n=l.view.state.doc.nodeAt(e);if(!n||!(0,d.jg)(n))return console.warn("[Spotlight.spotlightCollapseCard] pos does not resolve to a card node. This is a noop",e),!0;let o=v.n.getState(l.state),i=n.attrs.id;return(0,p.wE)(i,!0),x({editor:l,tr:a,spotlight:o}),(0,r.H1)("editor").scrollElementIntoView({element:l.view.nodeDOM(e),attempts:0,offsetFromTop:null}),!0},spotlightCollapseNearestExpandableNode:e=>t=>{let{editor:l,tr:n}=t,o=v.n.getState(l.state),i=e||l.state.selection.from,s={pos:i,node:l.view.state.doc.nodeAt(i)};if(!s.node||!C(s.node)){let e=(0,a.eL)(l.state.doc.resolve(i),C);s.node=(null==e?void 0:e.node)||null,s.pos=(null==e?void 0:e.pos)||0}let d=s.pos&&(0,g.hT)(l.state.doc,s.pos);if(!s.node||!s.pos||!d||d.node.attrs.id===s.node.attrs.id)return console.warn("[Spotlight.spotlightCollapseNearestExpandableNode] pos does not resolve to a valid collapsible node. This is a noop",s.pos),!1;if(!(d.pos<=s.pos&&d.pos+d.node.nodeSize>=s.pos))return console.warn("[Spotlight.spotlightCollapseNearestExpandableNode] posToUse is outside of the presenting card. This is a noop",s.pos),!1;console.debug("[Spotlight.spotlightCollapseNearestExpandableNode]",{result:s});let c=z(s.node);return c&&((0,r.H1)("editor").scrollElementIntoView({element:l.view.nodeDOM(s.pos),attempts:0,offsetFromTop:null}),s.pos===l.state.selection.from?l.commands.reHighlightExpandableNode():n.setSelection(u.J.create(l.state.doc,s.pos)),w(l,o)&&x({editor:l,tr:n,spotlight:{pos:s.pos,cardId:d.node.attrs.id}})),c},spotlightExpandCard:e=>t=>{let{editor:l}=t,a=v.n.getState(l.state),n=e&&l.view.state.doc.nodeAt(e);if(!n||!(0,d.jg)(n))return console.warn("[Spotlight.spotlightExpandCard] pos does not resolve to a card node. This is a noop",e),!0;let o=n.attrs.id,{isSpotlightingBlock:i}=A(l,a);return(0,p.wE)(o,!1),console.debug("[Spotlight.spotlightExpandCard]",{node:n,isSpotlightingBlock:i}),setTimeout(()=>{i?l.commands.spotlightNextBlock(!1,{pos:e,cardId:o},"smooth"):l.commands.scrollToPositionInCard(e,0,50)},h.M2),!0},spotlightNextExpandedCard:e=>t=>{let{editor:l,commands:a}=t,n=v.n.getState(l.state);if(!n.pos||!n.cardId)return!0;let o=(0,g.hT)(l.state.doc,n.pos),i=(0,b.Oq)(l,n.pos);if(!o||!i)return!0;let r={node:null,pos:null,cardId:null},s=n.pos;return(l.state.doc.descendants((t,a,n)=>{if(!e&&r.pos)return!1;let o=!(0,p.Wq)(t);if(!((0,d.jg)(t)&&o&&(e?as)))return o;let u=t!==i.node||!e;if(!u){let{isSpotlightingFirstBlock:e}=A(l,{pos:s,cardId:t.attrs.id});u=!e}return u&&(r.node=t,r.pos=a,r.cardId=t.attrs.id),o}),r.pos&&r.cardId)?a.spotlightNextBlock(!1,{pos:r.pos,cardId:r.cardId}):(S(this.options.scrollerSelector,o.node.attrs.id),!0)},spotlightNextCard:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"top";return l=>{let{editor:n,commands:i,tr:r}=l,s=v.n.getState(n.state),u=s.pos,{isSpotlightingBlock:c,isSpotlightingFirstBlock:m}=A(n,s);if(c&&k())return i.spotlightNextExpandedCard(e);if(!u){let e=(0,b.W0)(n,s.cardId);u=null==e?void 0:e.pos}if(!u)return console.warn("[Spotlight.spotlightNextCard] Could not find posToUse",{lastSpotlight:s}),!1;let f=n.view.state.doc.nodeAt(u),p=!!(f&&e&&c&&!m&&f.attrs.id!==s.cardId),g=f&&s.cardId&&f.attrs.id===s.cardId?{node:f,pos:u}:(0,a.eL)(n.state.doc.resolve(u),d.jg),y=p?g:(null==g?void 0:g.pos)?F(n,g.pos,e):null;if(y&&null!==y.pos){console.debug("[Spotlight.spotlightNextCard] Found next card:",{next:y,posToUse:u,isSpotlightingBlock:c});let l=y.node.attrs.id,a=y.pos;if(c)return n.commands.spotlightNextBlock(!1,{pos:a,cardId:l});(0,o.ki)({cardId:l}),x({editor:n,tr:r,bias:e?1:-1,spotlight:{pos:null,cardId:l}});let i=s.cardId!==l,d="top"==t?E:T;null!==t&&setTimeout(()=>{d({sync:!0,behavior:"auto"})},i?h.y0:0)}else console.debug("[Spotlight.spotlightNextCard] No next node. Will attempt to ascendUp",{lastSpotlight:s,posToUse:u,node:f}),n.commands.ascendUpToParentCard();return!0}},spotlightNextBlock:(e,t,l)=>a=>{let{editor:n,tr:i}=a,r=v.n.getState(n.state);if(!r.cardId)return!0;let s=n.state.selection,c=s instanceof u.J,m=c&&(-1===s.side&&e||1===s.side&&!e)?-1:0,f=c?e?s.to+m:s.from+m:void 0,p=(null==t?void 0:t.cardId)||r.cardId,b=(null==t?void 0:t.pos)||r.pos||f,y=c&&null===r.pos&&(0,d.jg)(s.node)&&1===s.$from.depth,{pos:w,cardId:S,domNode:A}=b&&!y?R(n,p,b,I,e):B(n,r.cardId,this.options.scrollerSelector,e);if(null!==w&&A instanceof HTMLElement){var C;let t=k()?null===(C=(0,g.hT)(n.state.doc,w))||void 0===C?void 0:C.node.attrs.id:S;if(!t)return!0;(0,o.ki)({cardId:t}),console.debug("%c [Spotlight.spotlightNextBlock]","background-color: deeppink",{prevCardId:r.cardId,cardId:t,pos:w}),setTimeout(()=>{M({element:A,behavior:l})},r.cardId===t?0:h.y0),x({editor:n,tr:i,bias:e?1:-1,spotlight:{pos:w,cardId:t}})}else n.commands.ascendUpToParentCard();return!0},spotlightNodeAtPos:e=>t=>{let{editor:l,tr:a}=t,n=v.n.getState(l.state);if(!n.cardId)return!1;let o=n.cardId,i=(0,f.TK)(l.state.doc.resolve(e),e=>I(e)),r=i.reverse().find((e,t)=>!(t!==i.length-1&&j(e.node)));return!!r&&(r.pos!==n.pos?(x({editor:l,tr:a,spotlight:{pos:r.pos,cardId:o}}),!0):l.commands.turnOffSpotlight())},turnOffSpotlight:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return t=>{let{editor:l,tr:a}=t,n=v.n.getState(l.state);return x({editor:l,tr:a,spotlight:{pos:null,cardId:e?null:n.cardId}}),!0}},scrollToPositionInCard:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return a=>{let{editor:n}=a,o=(0,m.Oc)((0,f.NR)(n,e)),i=null==o?void 0:o.getBoundingClientRect();if(!o||!i)return!0;let r=(t||0)*i.height;return console.debug("%c [Spotlight.scrollToPositionInCard]","background-color: deeppink",JSON.stringify({pos:e,offset:l-r}),o),(0,m.BX)({element:o,color:"deeppink",requiredCookie:"spotlightScrollDebug=true"}),M({element:o,offset:l-r}),!0}},scrollToNodeWithPin:(e,t)=>()=>(console.debug("%c [Spotlight.scrollToNodeWithPin] WITH NODE","background-color: deeppink",{scrollToNode:e}),_(M,h.M2,0)({element:e,offset:t}),!0)}},addProseMirrorPlugins(){return[(0,v._)((e,t)=>I(e,t),this.editor)]}});let F=function(e,t){var l;let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=e.view.state.doc.nodeAt(t),i=o&&(0,d.jg)(o)?{node:o,pos:t}:(0,a.eL)(e.state.doc.resolve(t),d.jg);if(!i)return;let r=e.state.doc.resolve(n?i.pos:i.pos+(null===(l=i.node)||void 0===l?void 0:l.nodeSize)),s=n?r.nodeBefore:r.nodeAfter;if(!s)return;let u=n?r.pos-s.nodeSize:r.pos;if((0,d.jg)(s))return console.debug("[Spotlight.findNextDirectSiblingCard]",{nextNode:s,nextPos:u}),{node:s,pos:u}},B=function(e,t,l){var a;let n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o={node:null,pos:null,cardId:null,domNode:null},i=(null===(a=(0,f.ls)(e,l,135).pos)||void 0===a?void 0:a.inside)||null,r=i?e.state.doc.nodeAt(i):null;if(!i||!r)return o;if(r.attrs.id===t)return R(e,t,i,e=>I(e,t),n);let s=e.state.doc.resolve(i),d=(0,b.Oq)(e,s.before());if(!d)return o;let u=s.before(d.depth+2),c=e.state.doc.nodeAt(u);if(c&&I(c,t)){let t=e.state.doc.resolve(u);return o.pos=t.pos,o.node=c,o.cardId=null==d?void 0:d.node.attrs.id,o.domNode=e.view.nodeDOM(o.pos),o}return R(e,t,u,e=>I(e,t),n)},R=function(e,t,l,n){let o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i={node:null,pos:null,cardId:null,domNode:null},r=e.state.doc.resolve(l),s=e.view.state.doc.nodeAt(l),u=(0,a.eL)(r,e=>(0,d.jg)(e)&&e.attrs.id===t),c=s&&(0,d.jg)(s)&&(null==s?void 0:s.attrs.id)===t?{node:s,pos:l}:u;if(!c)return console.debug("[Spotlight.findNextNode] - No card found:",{cardId:t,from:l,node:s}),i;let m=(e,t)=>{let a=e.attrs.id;e.descendants((r,s)=>{let d=t+s+1,u=n(r,a)&&(o?dl);return(!!o||!i.node)&&(u&&(i.node=r,i.pos=d,i.cardId=e.attrs.id),j(r))})};m(c.node,c.pos);let f=c.pos;for(;null===i.pos;){let t=F(e,f,o);if(t)m(t.node,t.pos),f=t.pos;else break}return null!==i.pos&&(i.domNode=e.view.nodeDOM(i.pos)),console.debug("[Spotlight.findNextNode]",{result:i}),i},_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return a=>{let n;let o={...a,sync:!0,behavior:"auto"};e(o);let i=!1;Promise.race([new Promise(e=>setTimeout(()=>e(!1),l+t+300)),new Promise(e=>{n=()=>e(!0),a.element.addEventListener("transitionend",n)})]).then(e=>{console.debug("[scrollTo withDurationPin] transitionend race result",e),i=!0}).finally(()=>{a.element.removeEventListener("transitionend",n)});let r=+new Date,s=()=>requestAnimationFrame(()=>{e(o),(+new Date-r{var t;let{element:l,sync:a=!1,behavior:n="smooth",offset:o}=e;if(!(0,m.IK)(l)){let e=l.querySelector("[data-content-reference]");if(!e||!(0,m.IK)(e))return;l=e}let i=(0,r.H1)("editor");if(!(null===(t=i.scroller)||void 0===t?void 0:t.clientHeight))return;let s=(0,m.sR)(l,i.scrollSelector),d=l.clientHeight/2,u=.45*i.scroller.clientHeight-d,c=s-Math.max(void 0!==o?o:u,125);i.scrollTo({top:c,sync:a,behavior:n})},E=e=>{let{sync:t=!1,behavior:l="smooth"}=e;(0,r.H1)("editor").scrollTo({top:0,behavior:l,sync:t})},T=e=>{let{sync:t=!1,behavior:l="smooth"}=e,a=(0,r.H1)("editor"),n=a.scroller;n&&a.scrollTo({top:n.scrollHeight,behavior:l,sync:t})}},15944:(e,t,l)=>{"use strict";l.d(t,{_:()=>h,n:()=>p});var a=l(81313),n=l(81570),o=l(73686),i=l(88957),r=l(9335),s=l(61690),d=l(19534),u=l(387),c=l(95580),m=l(12408),f=l(86047);let p=new n.hs("spotlight"),g=(e,t,l)=>{if(null===t.pos)return o.zF.create(e.doc,[]);let n=[],i=e.doc.nodeAt(t.pos);i&&(0,d.jg)(i)&&!l(i,t.cardId)?n.push(o.NZ.node(t.pos,t.pos+i.nodeSize,{class:"presenting-card"})):i&&l(i,t.cardId)&&n.push(o.NZ.node(t.pos,t.pos+i.nodeSize,{class:"spotlight-block"}));let r=t.pos;return e.doc.descendants((e,i)=>(l(e,t.cardId)&&n.push(o.NZ.node(i,i+e.nodeSize,{class:(0,a.cx)("spotlightable",i>r&&"after-spotlight")})),(0,f.I2)(e)||(0,d.jg)(e))),o.zF.create(e.doc,n)},h=(e,t)=>new n.k_({key:p,state:{init:(t,l)=>{let a={pos:null,cardId:""};return{...a,decorations:g(l,a,e)}},apply(t,l,a,n){let o=t.getMeta(p),i=(0,u.he)(t);if(o||i){let t=o||l;return{...t,decorations:g(n,t,e)}}let r=l.decorations.map(t.mapping,t.doc);return{...l,decorations:r}}},props:{attributes:t=>{let l=p.getState(t);if(!l||null===l.pos)return{class:""};let a=t.doc.nodeAt(l.pos);return a&&e(a,l.cardId)?{class:"spotlight-active"}:{class:""}},decorations:e=>{let t=p.getState(e);return t?t.decorations:null},handleDOMEvents:{click(e,l){if(l.detail>1||(0,m.Qj)(e))return;let a=(0,i.KA)(),n=a.getState(),o=(0,s.FI)(n);if(!(o&&(0,f.UE)(t,o))||(0,s.QF)(n))return;if((0,s.YL)(n)){a.dispatch((0,s.tB)());return}let r=p.getState(e.state);if(!(null==r?void 0:r.cardId))return;let d=e.posAtDOM(l.target,0);if(null===d||d<1)return;if(!e.state.doc.nodeAt(d)){t.commands.turnOffSpotlight();return}let[u]=(0,c.TK)(e.state.doc.resolve(d),e=>(0,f.Rj)(e));u?t.commands.spotlightNodeAtPos(d):t.commands.turnOffSpotlight()},contextmenu(e,l){let a=p.getState(e.state);if(!(null==a?void 0:a.cardId))return;let n=(0,i.KA)().getState();if((0,s.QF)(n))return;let o=e.posAtDOM(l.target,0),d=t.state.doc.resolve(o),u=e.state.doc.nodeAt(o),[m]=u&&(0,f.Rj)(u)?[{pos:o,start:d.start(d.depth+1)}]:(0,c.TK)(t.state.doc.resolve(o),e=>(0,f.Rj)(e));r.LF.emit(r.DN.OPEN_PRESENT_MODE_CONTEXT_MENU,{e:l,cardId:a.cardId,pos:m?m.start:null})}}}})},65641:(e,t,l)=>{"use strict";l.d(t,{X:()=>M});var a=l(13236),n=l(58599),o=l(43873),i=l(29362),r=l(77583),s=l(75621),d=l(31085),u=l(80532),c=l(80853),m=l(81313),f=l(20501),p=l(24221),g=l(95986),h=l(12327),b=l(119),y=l.n(b),v=l(14041),k=l(70605),w=l(71220),x=l(2696),S=l(20277),A=l(59707),C=l(62849),z=l(57284),I=l(4468),j=l(91725);let F=e=>{let{colWidths:t}=e;return(0,d.jsxs)("colgroup",{children:[(0,d.jsx)("col",{style:{width:"0%"}}),t.map((e,t)=>(0,d.jsx)("col",{className:"col-width-control",style:{width:"".concat(e,"%")}},t))]})};F.displayName="ColGroup";let B=e=>{var t;let l=(0,x.FX)(),{node:a,editor:o,getPos:i,decorations:b,updateAttributes:I}=e,{colMinPercent:B,newColSize:_}=o.schema.nodes.table.spec,M=(0,s.cG)(a.attrs.colWidths,_,B),E=r.J3.get(a),T=b.some(e=>e.spec.isFocusedInside),O=null===(t=b.find(e=>e.spec.isColumnSelected))||void 0===t?void 0:t.spec.colNumber,{colWidths:P}=a.attrs,N=(0,C.En)();(0,v.useEffect)(()=>{E.width!==P.length&&setTimeout(()=>{I({colWidths:(0,s.I)(E.width)})},0)},[E.width,P,I]);let D=(0,v.useCallback)(e=>i()+1+E.positionAt(0,e,a),[i,a,E]),L=(0,v.useCallback)(e=>{let t=D(e+1)+1;o.chain().addColumnAfter(e).command(e=>{let{tr:l}=e,a=(0,S.s)(l.doc.resolve(t));return a&&l.setSelection(a),!0}).run()},[o,D]),W=(0,v.useCallback)(()=>{L(E.width-1)},[L,E.width]),U=y()(a.attrs.colWidths.reduce((e,t)=>e+t,0),20);return N?(0,d.jsx)(z.u,{as:"div",...e,...a.attrs,children:(0,d.jsxs)(u.az,{w:"fit-content",overflowX:l?"auto":void 0,position:"relative",width:"100%",className:(0,m.cx)("table-wrapper",w.a0),"data-selection-ring":!0,children:[(0,d.jsxs)("table",{style:{width:l?"max-content":"".concat(U,"%"),minWidth:l?"100%":void 0,maxWidth:l?"200vw":void 0,tableLayout:l?"auto":"fixed",position:"relative"},children:[(0,d.jsx)(F,{cols:E.width,colWidths:P}),(0,d.jsx)("thead",{children:(0,d.jsx)(R,{numColumns:E.width,selectedColumn:O,getColumnPosition:D,...e})}),(0,d.jsx)(n.$p,{as:"tbody",className:"table-content"})]}),(0,d.jsx)(j.A,{...e,"data-testid":"select-table-button",onClick:()=>{let e=D(0);o.chain().focus().selectTable(e).run()},label:h.Ru._({id:"3xRGMR"})}),T&&(0,d.jsxs)(u.az,{contentEditable:!1,suppressContentEditableWarning:!0,children:[(0,d.jsx)(g.Tz,{placement:"right",label:h.Ru._({id:"AgvHni"}),children:(0,d.jsx)(c.$,{position:"absolute",insetInlineStart:"100%",top:"0",height:"100%",onClick:W,onMouseDown:A.Fw,minWidth:"0",width:"auto",isDisabled:!M,zIndex:1,"data-testid":"add-col-end-button",size:"xs",shadow:"sm",variant:"unstyled",color:"var(--body-color)",className:k.Gx,backgroundColor:"var(--clickable-background-color)",marginInlineStart:1,w:5,children:(0,d.jsx)(p.g,{icon:f.QLR})})}),(0,d.jsx)(g.Tz,{placement:"bottom",label:h.Ru._({id:"qZd/ph"}),children:(0,d.jsx)(c.$,{position:"absolute",insetInlineStart:"0",top:"100%",width:"100%",onClick:()=>{let e=i()+1,t=E.height-1,l=E.width-1,n=e+E.positionAt(t,l,a);o.chain().focus(n).addRowAfter().run(),requestAnimationFrame(()=>o.chain().focus(n).goToNextCell().run())},onMouseDown:A.Fw,minHeight:"0",height:6,zIndex:4,"data-testid":"add-row-end-button",size:"xs",shadow:"sm",variant:"unstyled",color:"var(--body-color)",className:k.Gx,mt:1,children:(0,d.jsx)(p.g,{icon:f.QLR})})})]})]})}):null},R=e=>{let{numColumns:t,selectedColumn:l,getColumnPosition:a,...n}=e,{editor:o}=n,i=(0,v.useCallback)(e=>{let t=a(e);o.chain().focus().selectColumn(t).run()},[o,a]);if(!t)return null;let r=Array.from(Array(t).keys());return(0,d.jsxs)("tr",{contentEditable:!1,suppressContentEditableWarning:!0,children:[(0,d.jsx)("th",{style:{padding:0}}),r.map(e=>(0,d.jsx)(_,{colNumber:e,selectColumn:i,isSelected:e===l,...n},e))]})},_=(0,v.memo)(e=>{let{colNumber:t,selectColumn:l,...a}=e,{decorations:n}=a,{colHover:o}=(0,I.L3)(n),{colFocus:i}=(0,I.lF)(n),r=(0,v.useCallback)(()=>l(t),[t,l]);return(0,d.jsx)("th",{style:{position:"relative",padding:0,border:0},className:"table-col-control",children:(0,d.jsx)(j.A,{...a,handlePlacement:"top",label:h.Ru._({id:"K3GOZ1"}),zIndex:"3",isVisible:o===t||i===t,onClick:r,"data-test-column-control":t})},t)});_.displayName="SelectColumnHeader";let M=a.bP.create({name:"table",priority:o.y.Table,containerHandle:!0,addNodeView:()=>(0,n.gu)(B,{update:i.z0}),addOptions:()=>({resizable:!0,handleWidth:10,colMinPercent:10,newColSize:20,lastColumnResizable:!1,allowTableNodeSelection:!0}),content:"tableRow+",tableRole:"table",isolating:!0,allowGapCursor:!1,group:"cardBlock layoutBlock footnoteBlock calloutBlock",parseHTML:()=>[{tag:"table"}],renderHTML(e){let{HTMLAttributes:t}=e;return["table",(0,a.KV)(this.options.HTMLAttributes,t),["tbody",0]]},addAttributes(){let e="colWidths";return{colWidths:{default:[],renderHTML:t=>{let{colWidths:l}=t;return l&&l.length?{[e]:JSON.stringify(l)}:{}},parseHTML:t=>{let l=t.getAttribute(e);if(l)try{let e=JSON.parse(l);if(Array.isArray(e))return(0,s.fF)(e),e}catch(e){}let a=t.querySelector("tr");if(!a)return[];let n=0;return a.childNodes.forEach(e=>{"TD"===e.nodeName&&n++}),(0,s.I)(n)}},fullWidthBlock:{default:!1}}},addCommands(){return{insertTable:function(){let{rows:e=3,cols:t=3,withHeaderRow:l=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a=>{let{dispatch:n,editor:o,commands:i}=a;if(!n)return!1;let r=function(e,t,l,a,n){let o=function(e){if(e.cached.tableNodeTypes)return e.cached.tableNodeTypes;let t={};return Object.keys(e.nodes).forEach(l=>{let a=e.nodes[l];a.spec.tableRole&&(t[a.spec.tableRole]=a)}),e.cached.tableNodeTypes=t,t}(e),i=[],r=[];for(let e=0;et=>{let{state:l,dispatch:a,tr:n}=t;if(!(0,r.aH)(l.selection)||!a)return!1;let{table:o,tableStart:i}=(0,r._t)(l.selection);return(0,r.cq)(n,{table:o,col:e,tableStart:i,newColSize:this.options.newColSize,colMinPercent:this.options.colMinPercent})},addColumnAfter:e=>t=>{let{state:l,dispatch:a,tr:n}=t;if(!(0,r.aH)(l.selection)||!a)return!1;let{table:o,tableStart:i}=(0,r._t)(l.selection);return(0,r.cq)(n,{table:o,col:e+1,tableStart:i,newColSize:this.options.newColSize,colMinPercent:this.options.colMinPercent})},equalizeColumns:()=>e=>{let{state:t,dispatch:l,tr:a}=e;if(!(0,r.aH)(t.selection)||!l)return!1;let{map:n,tableStart:o}=(0,r._t)(t.selection);return a.setNodeMarkup(o-1,void 0,{colWidths:(0,s.I)(n.width)}),!0},visualizeTable:()=>e=>{let{state:t,dispatch:l,tr:a}=e;if(!(0,r.aH)(t.selection)||!l)return!1;let{map:n,tableStart:o}=(0,r._t)(t.selection);return a.setNodeMarkup(o-1,void 0,{colWidths:(0,s.I)(n.width)}),!0},deleteColumn:()=>e=>{let{state:t,dispatch:l,tr:a}=e;return!!l&&(0,r.Kl)(t.selection,a,l)},addRowBefore:()=>e=>{let{state:t,dispatch:l}=e;return(0,r.JD)(t,l)},addRowAfter:()=>e=>{let{state:t,dispatch:l}=e;return(0,r.gC)(t,l)},deleteRow:()=>e=>{let{state:t,dispatch:l,tr:a}=e;return(0,r.QN)(t.selection,a,l)},deleteTable:()=>e=>{let{state:t,tr:l,dispatch:a}=e;return!!a&&(0,r.CG)(t.selection,l,a)},deleteTableWhenEmpty:()=>e=>{let{state:t,tr:l,dispatch:a}=e;return!!a&&(0,r.lD)(t.selection,l,a)},deleteColWhenEmpty:()=>e=>{let{state:t,tr:l,dispatch:a}=e;return!!a&&(0,r.Tn)(t.selection,l,a)},deleteRowWhenEmpty:()=>e=>{let{state:t,tr:l,dispatch:a}=e;return!!a&&(0,r.rO)(t.selection,l,a)},mergeCells:()=>e=>{let{state:t,dispatch:l}=e;return(0,r.w7)(t,l)},splitCell:()=>e=>{let{state:t,dispatch:l}=e;return(0,r.L0)(t,l)},toggleHeaderColumn:()=>e=>{let{state:t,dispatch:l}=e;return(0,r.Qg)(t,l)},toggleHeaderRow:()=>e=>{let{state:t,dispatch:l}=e;return(0,r.uC)(t,l)},toggleHeaderCell:()=>e=>{let{state:t,dispatch:l}=e;return(0,r._G)(t,l)},mergeOrSplit:()=>e=>{let{state:t,dispatch:l}=e;return!!(0,r.w7)(t,l)||(0,r.L0)(t,l)},setCellAttribute:(e,t)=>l=>{let{state:a,dispatch:n}=l;return(0,r.i4)(e,t)(a,n)},goToNextCell:()=>e=>{let{state:t,dispatch:l}=e;return(0,r.D8)(1)(t,l)},goToPreviousCell:()=>e=>{let{state:t,dispatch:l}=e;return(0,r.D8)(-1)(t,l)},fixTables:()=>e=>{let{state:t,dispatch:l}=e;return l&&(0,r.rP)(t),!0},setCellSelection:e=>t=>{let{tr:l,dispatch:a}=t;if(a){let t=r.rn.create(l.doc,e.anchorCell,e.headCell);l.setSelection(t)}return!0}}},addKeyboardShortcuts(){let e=()=>this.editor.commands.first(e=>{let{commands:t}=e;return[()=>t.deleteTableWhenEmpty(),()=>t.deleteRowWhenEmpty(),()=>t.deleteColWhenEmpty()]});return{Tab:()=>!!this.editor.commands.goToNextCell()||!!this.editor.can().addRowAfter()&&this.editor.chain().addRowAfter().goToNextCell().run(),"Shift-Tab":()=>this.editor.commands.goToPreviousCell(),Backspace:e,"Mod-Backspace":e,Delete:e,"Mod-Delete":e}},addProseMirrorPlugins(){return this.options.resizable,[(0,r.AL)({handleWidth:this.options.handleWidth,colMinPercent:this.options.colMinPercent,lastColumnResizable:this.options.lastColumnResizable}),(0,r.LF)({allowTableNodeSelection:this.options.allowTableNodeSelection})]},extendNodeSchema(e){var t,l;let n={name:e.name,options:e.options,storage:e.storage};return{colMinPercent:null===(t=e.options)||void 0===t?void 0:t.colMinPercent,newColSize:null===(l=e.options)||void 0===l?void 0:l.newColSize,tableRole:(0,a.gk)((0,a.iI)(e,"tableRole",n))}}})},68043:(e,t,l)=>{"use strict";l.d(t,{HT:()=>d,Wz:()=>m,lz:()=>c});var a=l(69e3),n=l(81570),o=l(73686),i=l(37838),r=l(27474),s=l(23988);class d extends n.LN{map(e,t){let l=e.resolve(t.map(this.$anchorCell.pos)),a=e.resolve(t.map(this.$headCell.pos));if((0,s.NH)(l)&&(0,s.NH)(a)&&(0,s.kV)(l,a)){let e=this.$anchorCell.node(-1)!=l.node(-1);return e&&this.isRowSelection()?d.rowSelection(l,a):e&&this.isColSelection()?d.colSelection(l,a):new d(l,a)}return n.U3.between(l,a)}content(){let e=this.$anchorCell.node(-1),t=r.J.get(e),l=this.$anchorCell.start(-1),n=t.rectBetween(this.$anchorCell.pos-l,this.$headCell.pos-l),o={},i=[];for(let l=n.top;l0||u>0){let e=i.attrs;d>0&&(e=(0,s.Pn)(e,0,d)),u>0&&(e=(0,s.Pn)(e,e.colspan-u,u)),i=a.leftn.bottom){let e=(0,s.ob)(i.attrs,"rowspan",Math.min(a.bottom,n.bottom)-Math.max(a.top,n.top));i=a.top1&&void 0!==arguments[1]?arguments[1]:a.Ji.empty,l=e.steps.length,o=this.ranges;if(0===t.size){if(this.isSelectingAllCells()){(0,i.CG)(this,e);return}if(this.isRowSelection()){(0,i.QN)(this,e);return}if(this.isColSelection()){(0,i.Kl)(this,e);return}}for(let n=0;n{e(l,a)||(t=!1)}),t}forEachCell(e){let t=this.$anchorCell.node(-1),l=r.J.get(t),a=this.$anchorCell.start(-1),n=l.cellsInRect(l.rectBetween(this.$anchorCell.pos-a,this.$headCell.pos-a));for(let l=0;l0)&&Math.max(e+this.$anchorCell.nodeAfter.attrs.rowspan,t+this.$headCell.nodeAfter.attrs.rowspan)==this.$headCell.node(-1).childCount}static colSelection(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,l=r.J.get(e.node(-1)),a=e.start(-1),n=l.findCell(e.pos-a),o=l.findCell(t.pos-a),i=e.node(0);return n.top<=o.top?(n.top>0&&(e=i.resolve(a+l.map[n.left])),o.bottom0&&(t=i.resolve(a+l.map[o.left])),n.bottom0)&&Math.max(l+this.$anchorCell.nodeAfter.attrs.colspan,a+this.$headCell.nodeAfter.attrs.colspan)==e.width}eq(e){return e instanceof d&&e.$anchorCell.pos==this.$anchorCell.pos&&e.$headCell.pos==this.$headCell.pos}static rowSelection(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,l=r.J.get(e.node(-1)),a=e.start(-1),n=l.findCell(e.pos-a),o=l.findCell(t.pos-a),i=e.node(0);return n.left<=o.left?(n.left>0&&(e=i.resolve(a+l.map[n.top*l.width])),o.right0&&(t=i.resolve(a+l.map[o.top*l.width])),n.right2&&void 0!==arguments[2]?arguments[2]:t;return new d(e.resolve(t),e.resolve(l))}getBookmark(){return new u(this.$anchorCell.pos,this.$headCell.pos)}constructor(e,t=e){let l=e.node(-1),a=r.J.get(l),o=e.start(-1),i=a.rectBetween(e.pos-o,t.pos-o),s=e.node(0),d=a.cellsInRect(i).filter(e=>e!=t.pos-o);d.unshift(t.pos-o);let u=d.map(e=>{let t=l.nodeAt(e),a=e+o+1;return new n.yn(s.resolve(a),s.resolve(a+t.content.size))});super(u[0].$from,u[0].$to,u),this.$anchorCell=e,this.$headCell=t,this.$anchorCell=e,this.$headCell=t}}if(!d.prototype.jsonID)try{n.LN.jsonID("CellSelection2",d)}catch(e){}class u{map(e){return new u(e.map(this.anchor),e.map(this.head))}resolve(e){let t=e.resolve(this.anchor),l=e.resolve(this.head);return"row"==t.parent.type.spec.tableRole&&"row"==l.parent.type.spec.tableRole&&t.index(){t.push(o.NZ.node(l,l+e.nodeSize,{class:"selectedCell"}))}),o.zF.create(e.doc,t)}function m(e,t,l){let a,o;let i=(t||e).selection,s=(t||e).doc;if(i instanceof n.nh&&(o=i.node.type.spec.tableRole)){if("cell"==o||"header_cell"==o)a=d.create(s,i.from);else if("row"==o){let e=s.resolve(i.from+1);a=d.rowSelection(e,e)}else if(!l){let e=r.J.get(i.node),t=i.from+1,l=t+e.map[e.width*e.height-1];a=d.create(s,t+1,l)}}else i instanceof n.U3&&function(e){let{$from:t,$to:l}=e;if(t.pos==l.pos||t.pos=0&&!(t.after(o+1)=0&&!(l.before(e+1)>l.start(e));e--,n--);return a==n&&/row|table/.test(t.node(o).type.spec.tableRole)}(i)?a=n.U3.create(s,i.from):i instanceof n.U3&&function(e){let t,l,{$from:a,$to:n}=e;for(let e=a.depth;e>0;e--){let l=a.node(e);if("cell"===l.type.spec.tableRole||"header_cell"===l.type.spec.tableRole){t=l;break}}for(let e=n.depth;e>0;e--){let t=n.node(e);if("cell"===t.type.spec.tableRole||"header_cell"===t.type.spec.tableRole){l=t;break}}return t!==l&&0===n.parentOffset}(i)&&(a=n.U3.create(s,i.$from.start(),i.$from.end()));return a&&(t||(t=e.tr)).setSelection(a),t}},75621:(e,t,l)=>{"use strict";l.d(t,{H0:()=>m,I:()=>o,KJ:()=>p,XC:()=>g,cG:()=>f,fF:()=>h});var a=l(119),n=l.n(a);let o=e=>{let t=n()(100/e,2),l=[];for(let a=0;aa?s(e,t,l):r(e,t),r=(e,t)=>{let l=0,a=[];for(let n=t+1;n{let a=0,n=[];for(let o=t+1;ol&&(a+=t,n.push(o))}let o=[];for(let t=0;t{let t=e.reduce((e,t)=>e+t,0),l=[];for(let a=0;a{let a=0,n=[];for(let o=0;ol&&(a+=i,n.push(o))}let o=[];for(let n=0;n3&&void 0!==arguments[3]?arguments[3]:0,n=0;for(let o=0;o{let n=[...e],o=e[t],r=o-a,s=e.reduce((e,l,n)=>nt?e+a:e,0),d=l>0?Math.min(l,100-s-o):Math.max(-r,l),u=i(n,t,a,d>0),m=Math.abs(d),f=d>0,p=0;for(;m>.001;){let e=Math.min(m,1);f&&(e*=-1);let l=c(n,e,u,a);if(n[t]-=l,m-=Math.abs(l),u=i(n,t,a,d>0),++p>1e3)break}return h(n,a),n},f=(e,t,l)=>p(e,e.length,t,l).length!==e.length,p=(e,t,l,a)=>{let n=l,o=[...e];o.splice(t,0,0);let i=u(o,t,a),r=!1;for(;n>.001;){if(i.every(e=>0===e)){r=!0;break}let e=c(o,-Math.min(n,1),i,a);o[t]-=e,i=u(o,t,a),n-=Math.abs(e)}return r?e:(h(o,a),o)},g=(e,t)=>{let l=0,a=t.sort((e,t)=>t-e),n=[...e];a.forEach(t=>{l+=e[t],n.splice(t,1)});let o=d(n);for(;l>.001;){let e=c(n,Math.min(l,1),o);o=d(n),l-=Math.abs(e)}return h(n,0),n},h=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:100,a=0;e.forEach((t,l)=>{let n=Math.round(100*t);e[l]=n,a+=n});let n=100*l-a,o=Math.abs(n),i=0;for(;o>0;){let l=n<0?-1:1,a=i%e.length;if(void 0!==t&&l<0&&e[a]<=100*t){i++;continue}e[a]+=l,i++,o--}for(let t=0;t{"use strict";l.d(t,{CG:()=>j,D8:()=>I,JD:()=>g,Kl:()=>f,L0:()=>k,QN:()=>b,Qg:()=>C,Tn:()=>R,_G:()=>z,_t:()=>c,cq:()=>m,gC:()=>h,i4:()=>w,lD:()=>F,rO:()=>B,uC:()=>A,w7:()=>v});var a=l(69e3),n=l(81570),o=l(68566),i=l(68043),r=l(75621),s=l(31099),d=l(27474),u=l(23988);function c(e){let t=(0,u.t6)(e),l=t.node(-1),a=t.start(-1),n=d.J.get(l);return{...e instanceof i.HT?n.rectBetween(e.$anchorCell.pos-a,e.$headCell.pos-a):n.findCell(t.pos-a),map:n,table:l,tableStart:a}}function m(e,t){let{tableStart:l,col:a,table:n,colMinPercent:o,newColSize:i=20}=t,c=d.J.get(n),m=a>0?-1:0;(0,u.Ui)(c,n,a+m)&&(m=0==a||a==c.width?null:0);for(let t=0;t0&&a0&&a.map[r-1]==s||l0?-1:0;(function(e,t,l){let a=(0,s.e)(t.type.schema).header_cell;for(let n=0;n0&&l0&&r==a.map[i-a.width]){let l=n.nodeAt(r).attrs;e.setNodeMarkup(e.mapping.slice(s).map(r+o),void 0,(0,u.ob)(l,"rowspan",l.rowspan-1)),t+=l.colspan-1}else if(l0&&n[i]==n[i-1]||t.right0&&n[o]==n[o-l]||t.bottom{let{node:t}=e;return a[t.type.spec.tableRole]},(e,t)=>{let a,n;let o=e.selection;if(o instanceof i.HT){if(o.$anchorCell.pos!=o.$headCell.pos)return!1;a=o.$anchorCell.nodeAfter,n=o.$anchorCell.pos}else{if(!(a=(0,u.HF)(o.$from)))return!1;n=(0,u.KW)(o.$from).pos}if(1==a.attrs.colspan&&1==a.attrs.rowspan)return!1;if(t){let r,s=a.attrs,d=[],m=s.colwidth;s.rowspan>1&&(s=(0,u.ob)(s,"rowspan",1)),s.colspan>1&&(s=(0,u.ob)(s,"colspan",1));let f=c(e.selection),p=e.tr;for(let e=0;e{l.attrs[e]!==t&&n.setNodeMarkup(a,void 0,(0,u.ob)(l.attrs,e,t))}):n.setNodeMarkup(o.pos,void 0,(0,u.ob)(o.nodeAfter.attrs,e,t)),a(n)}return!0}}function x(e,t,l){let a=t.map.cellsInRect({left:0,top:0,right:"row"==e?t.map.width:1,bottom:"column"==e?t.map.height:1});for(let e=0;en.table.nodeAt(e));for(let e=0;e{let t=e+n.tableStart,l=o.doc.nodeAt(t);l&&o.setNodeMarkup(t,f,l.attrs)}),l(o)}return!0}}let A=S("row",{useDeprecatedLogic:!0}),C=S("column",{useDeprecatedLogic:!0}),z=S("cell",{useDeprecatedLogic:!0});function I(e){return function(t,l){if(!(0,u.aH)(t.selection))return!1;let a=function(e,t){if(t<0){let t=e.nodeBefore;if(t)return e.pos-t.nodeSize;for(let t=e.index(-1)-1,l=e.before();t>=0;t--){let a=e.node(-1).child(t);if(a.childCount)return l-1-a.lastChild.nodeSize;l-=a.nodeSize}}else{if(e.index()0;e--)if("table"==a.node(e).type.spec.tableRole){t.delete(a.before(e),a.after(e)).scrollIntoView();let n=(0,o.i)(t);return n&&t.setSelection(n),l&&l(t),!0}return!1}let F=(e,t,l)=>e instanceof i.HT&&!!(e.isSelectingAllCells()&&e.everyCell(y))&&j(e,t,l),B=(e,t,l)=>!!(e instanceof i.HT&&e.isRowSelection())&&!!e.everyCell(y)&&b(e,t,l),R=(e,t,l)=>!!(e instanceof i.HT&&e.isColSelection())&&!!e.everyCell(y)&&f(e,t,l)},77583:(e,t,l)=>{"use strict";l.d(t,{rn:()=>n.HT,J3:()=>i.J,cq:()=>V.cq,gC:()=>V.gC,JD:()=>V.JD,AL:()=>N,Tn:()=>V.Tn,Kl:()=>V.Kl,QN:()=>V.QN,rO:()=>V.rO,CG:()=>V.CG,lD:()=>V.lD,rP:()=>d,D8:()=>V.D8,aH:()=>r.aH,w7:()=>V.w7,_t:()=>V._t,i4:()=>V.i4,L0:()=>V.L0,LF:()=>q,_G:()=>V._G,Qg:()=>V.Qg,uC:()=>V.uC});var a=l(81570),n=l(68043),o=l(31099),i=l(27474),r=l(23988);let s=new a.hs("fix-tables");function d(e,t){let l,a=(t,a)=>{"table"==t.type.spec.tableRole&&(l=function(e,t,l,a){let n,d;let u=i.J.get(t);if(!u.problems)return a;a||(a=e.tr);let c=[];for(let e=0;e0){let t="cell";l.firstChild&&(t=l.firstChild.type.spec.tableRole);let c=[];for(let l=0;lt.width)for(let o=0,i=0;ot.height){let o=[];for(let e=0,a=(t.height-1)*t.width;e=t.width)&&l.nodeAt(t.map[a+e]).type==m.header_cell;o.push(n?d||(d=m.header_cell.createAndFill()):s||(s=m.cell.createAndFill()))}let r=m.row.create(null,c.FK.from(o)),u=[];for(let e=t.height;e{let s=l.selection;if(s instanceof n.HT)return y(l,o,a.LN.near(s.$headCell,t));if("horiz"!=e&&!s.empty)return!1;let d=A(i,e,t);if(null==d)return!1;if("horiz"==e)return y(l,o,a.LN.near(l.doc.resolve(s.head+t),t));{let n=l.doc.resolve(d),i=(0,r.oD)(n,e,t),s;return s=i?a.LN.near(i,1):t<0?a.LN.near(l.doc.resolve(n.before(-1)),-1):a.LN.near(l.doc.resolve(n.after(-1)),1),y(l,o,s)}}}function k(e,t){return(l,a,o)=>{let i=l.selection;if(!(i instanceof n.HT)){let a=A(o,e,t);if(null==a)return!1;i=new n.HT(l.doc.resolve(a))}let s=(0,r.oD)(i.$headCell,e,t);return!!s&&y(l,a,new n.HT(i.$anchorCell,s))}}function w(e,t){let l=e.selection;if(!(l instanceof n.HT))return!1;if(t){let a=e.tr,n=(0,o.e)(e.schema).cell.createAndFill().content;l.forEachCell((e,t)=>{e.content.eq(n)||a.replace(a.mapping.map(t+1),a.mapping.map(t+e.nodeSize-1),new c.Ji(n,0,0))}),a.docChanged&&t(a)}return!0}function x(e,t,l){if(!(0,r.aH)(e.state.selection))return!1;let a=function(e){if(!e.size)return null;let{content:t,openStart:l,openEnd:a}=e;for(;1==t.childCount&&(l>0&&a>0||"table"==t.firstChild.type.spec.tableRole);)l--,a--,t=t.firstChild.content;let n=t.firstChild,i=n.type.spec.tableRole,r=n.type.schema,s=[];if("row"==i)for(let e=0;e=0;t--){let{rowspan:n,colspan:o}=a.child(t).attrs;for(let t=e;t=t.length&&t.push(c.FK.empty),l[n]t&&(s=s.type.create((0,r.Pn)(s.attrs,s.attrs.colspan,l+s.attrs.colspan-t),s.content)),i.push(s),l+=s.attrs.colspan;for(let t=1;tl&&(a=a.type.create((0,r.ob)(a.attrs,"rowspan",Math.max(1,l-a.attrs.rowspan)),a.content)),i.push(a)}e.push(c.FK.from(i))}o=e,n=l}return{width:a,height:n,rows:o}}(a,d.right-d.left,d.bottom-d.top),h(e.state,e.dispatch,n,d,a),!0}if(!a)return!1;{let t=(0,r.t6)(e.state.selection),l=t.start(-1);return h(e.state,e.dispatch,l,i.J.get(t.node(-1)).findCell(t.pos-l),a),!0}}function S(e,t){var l;let a;if(t.ctrlKey||t.metaKey)return!1;let o=C(e,t.target);if(t.shiftKey&&e.state.selection instanceof n.HT)i(e.state.selection.$anchorCell,t),t.preventDefault();else if(t.shiftKey&&o&&null!=(a=(0,r.KW)(e.state.selection.$anchor))&&(null===(l=z(e,t))||void 0===l?void 0:l.pos)!=a.pos)i(a,t),t.preventDefault();else if(!o)return!1;function i(t,l){let a=z(e,l),o=null==r.dX.getState(e.state);if(!a||!(0,r.kV)(t,a)){if(!o)return!1;a=t}let i=new n.HT(t,a);if(o||!e.state.selection.eq(i)){let l=e.state.tr.setSelection(i);o&&l.setMeta(r.dX,t.pos),e.dispatch(l)}}function s(){e.root.removeEventListener("mouseup",s),e.root.removeEventListener("dragstart",s),e.root.removeEventListener("mousemove",d),null!=r.dX.getState(e.state)&&e.dispatch(e.state.tr.setMeta(r.dX,-1))}function d(l){let a=r.dX.getState(e.state),n;if(null!=a)n=e.state.doc.resolve(a);else if(C(e,l.target)!=o&&!(n=z(e,t)))return s();n&&i(n,l)}return e.root.addEventListener("mouseup",s),e.root.addEventListener("dragstart",s),e.root.addEventListener("mousemove",d),!1}function A(e,t,l){if(!(e.state.selection instanceof a.U3))return null;let{$head:n}=e.state.selection;for(let a=n.depth-1;a>=0;a--){let o=n.node(a);if((l<0?n.index(a):n.indexAfter(a))!=(l<0?0:o.childCount))break;if("cell"==o.type.spec.tableRole||"header_cell"==o.type.spec.tableRole){let o=n.before(a),i="vert"==t?l>0?"down":"up":l>0?"right":"left";return e.endOfTextblock(i)?o:null}}return null}function C(e,t){for(;t&&t!=e.dom;t=t.parentNode)if("TD"==t.nodeName||"TH"==t.nodeName)return t}function z(e,t){let l=e.posAtCoords({left:t.clientX,top:t.clientY});return l&&l?(0,r.KW)(e.state.doc.resolve(l.pos)):null}var I=l(119),j=l.n(I),F=l(73686),B=l(64130),R=l(26374),_=l(3583),M=l(6998),E=l(96712);let T=new a.hs("tableColumnResizing");class O{getActiveHandleAbs(e){return null===this.activeHandle?null:(0,E.d_)(e,this.activeHandle)}reset(){return this.activeHandle=null,this.dragging=null,this}setHandle(e,t){if(null===t.setHandle)return this.activeHandle=null,this;let l=_.pJ.getState(e);if(!l)return this;let{type:a,binding:n}=l;return this.activeHandle=(0,M.Bw)(t.setHandle,a,n.mapping),this}setDragging(e){return this.dragging=e.setDragging,this}apply(e,t){let l=e.getMeta(T);return l&&"setHandle"in l?this.setHandle(t,l):l&&"setDragging"in l?this.setDragging(l):l&&"reset"in l?this.reset():this}constructor(e=null,t=null){this.activeHandle=e,this.dragging=t}}var P=l(75621);function N(){let{handleWidth:e=5,colMinPercent:t=10,lastColumnResizable:l=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new a.k_({key:T,state:{init:()=>new O,apply:(e,t,l,a)=>t.apply(e,a)},props:{attributes:e=>null!==T.getState(e).getActiveHandleAbs(e)?{class:"resize-cursor"}:{class:""},handleDOMEvents:{mousemove:(t,a)=>((function(e,t,l,a){if(!e.editable)return;let n=T.getState(e.state);if(n.dragging)return;let o=function(e){for(;e&&"TD"!=e.nodeName&&"TH"!=e.nodeName;)e=e.classList.contains("ProseMirror")?null:e.parentNode;return e}(t.target),i=null;if(o){let a=(0,B.ix)(),{left:n,right:r}=o.getBoundingClientRect();a?r-t.clientX<=l?i=D(e,t,"left"):t.clientX-n<=l&&(i=D(e,t,"right")):t.clientX-n<=l?i=D(e,t,"left"):r-t.clientX<=l&&(i=D(e,t,"right"))}i===n.getActiveHandleAbs(e.state)||!a&&null!==i&&U(e.state.doc.resolve(i))||L(e,i)})(t,a,e,l),!1),mouseleave:e=>((function(e){let t=T.getState(e.state);null===t.getActiveHandleAbs(e.state)||t.dragging||L(e,null)})(e),!1),mousedown:(e,l)=>((function(e,t,l){if(!e.editable)return;let n=T.getState(e.state),o=n.getActiveHandleAbs(e.state);if(null===o||n.dragging)return 0;let i=e.state.doc.resolve(o),r=i.node(-1),s=i.start(-1),d=[...r.attrs.colWidths],u=W(i),c=function(e,t){let l=e.domAtPos(t),a=e.domAtPos(t).node;for(;"TABLE"!=a.nodeName;)a=a.parentNode;return l.node.childNodes[l.offset].scrollWidth}(e,o),m=G(e,i),f=H(e,i),p=e.state.doc.resolve(o+2);e.state.selection.from>s&&e.state.selection.from col.col-width-control");l.forEach((e,t)=>{n.item(t).style.width="".concat(e,"%")})})(e,n,h=(0,P.H0)(i,o,r,l)),(0,R.i$)(m)}window.addEventListener("mouseup",b),window.addEventListener("mousemove",y),t.preventDefault()})(e,l,t),!1)},decorations(e){let t=T.getState(e).getActiveHandleAbs(e);if(null!==t)return function(e,t){let l=[];try{let a=e.doc.resolve(t),n=a.node(-1),o=i.J.get(n),r=a.start(-1),s=o.colCount(a.pos-r)+a.nodeAfter.attrs.colspan;for(let e=0;e{let t=e.node(-1),l=i.J.get(t),a=e.start(-1);return l.colCount(e.pos-a)},U=e=>{let t=e.node(-1),l=i.J.get(t);return W(e)===l.width-1},G=(e,t)=>{let l=e.domAtPos(t.start(-1)).node;for(;"TABLE"!=l.nodeName;)l=l.parentNode;return l},H=(e,t)=>G(e,t).scrollWidth;var V=l(37838);function q(){let{allowTableNodeSelection:e=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new a.k_({key:r.dX,state:{init:()=>null,apply(e,t){let l=e.getMeta(r.dX);if(null!=l)return -1==l?null:l;if(null==t||!e.docChanged)return t;let{deleted:a,pos:n}=e.mapping.mapResult(t);return a?null:n}},props:{decorations:n.lz,handleDOMEvents:{mousedown:S},createSelectionBetween:e=>null!=r.dX.getState(e.state)?e.state.selection:null,handleKeyDown:b,handlePaste:x},appendTransaction:(t,l,a)=>(0,n.Wz)(a,d(a,l),e)})}},31099:(e,t,l)=>{"use strict";function a(e){let t=e.cached.tableNodeTypes;if(!t)for(let l in t=e.cached.tableNodeTypes={},e.nodes){let a=e.nodes[l],n=a.spec.tableRole;n&&(t[n]=a)}return t}l.d(t,{e:()=>a})},27474:(e,t,l)=>{"use strict";let a,n;if(l.d(t,{J:()=>i,r:()=>o}),"undefined"!=typeof WeakMap){let e=new WeakMap;a=t=>e.get(t),n=(t,l)=>(e.set(t,l),l)}else{let e=[],t=0;a=t=>{for(let l=0;l(10==t&&(t=0),e[t++]=l,e[t++]=a)}class o{constructor(e,t,l,a){this.left=e,this.top=t,this.right=l,this.bottom=a}}class i{findCell(e){for(let t=0;tt%this.width==0)}colCount(e){for(let t=0;ta&&(o+=n.attrs.colspan)}}for(let e=0;e1&&(l=!0)}-1==t?t=o:t!=o&&(t=Math.max(t,o))}return t}(e),l=e.childCount,a=[],n=0,o=null,r=[];for(let e=0,n=t*l;e=l){(o||(o=[])).push({type:"overlong_rowspan",pos:s,n:m-e});break}let d=n+e*t;for(let e=0;e{"use strict";l.d(t,{HF:()=>d,KW:()=>s,NH:()=>m,Pn:()=>b,Ui:()=>v,aH:()=>u,dX:()=>r,fx:()=>f,kV:()=>p,oD:()=>g,ob:()=>h,t6:()=>c,uH:()=>y});var a=l(81570),n=l(68043),o=l(31099),i=l(27474);let r=new a.hs("selectingCells");function s(e){for(let t=e.depth-1;t>0;t--)if("row"==e.node(t).type.spec.tableRole)return e.node(0).resolve(e.before(t+1));return null}function d(e){for(let t=e.depth;t>0;t--){let l=e.node(t).type.spec.tableRole;if("cell"===l||"header_cell"===l)return e.node(t)}return null}function u(e){let t=e.$head;for(let e=t.depth;e>0;e--)if("row"==t.node(e).type.spec.tableRole)return!0;return!1}function c(e){return e instanceof n.HT?e.$anchorCell.pos>e.$headCell.pos?e.$anchorCell:e.$headCell:e instanceof a.nh&&"cell"==e.node.type.spec.tableRole?e.$anchor:s(e.$head)||function(e){for(let t=e.nodeAfter,l=e.pos;t;t=t.firstChild,l++){let a=t.type.spec.tableRole;if("cell"==a||"header_cell"==a)return e.doc.resolve(l)}for(let t=e.nodeBefore,l=e.pos;t;t=t.lastChild,l--){let a=t.type.spec.tableRole;if("cell"==a||"header_cell"==a)return e.doc.resolve(l-t.nodeSize)}}(e.$head)}function m(e){return"row"==e.parent.type.spec.tableRole&&e.nodeAfter}function f(e){return e.node(0).resolve(e.pos+e.nodeAfter.nodeSize)}function p(e,t){return e.depth==t.depth&&e.pos>=t.start(-1)&&e.pos<=t.end(-1)}function g(e,t,l){let a=e.start(-1),n=i.J.get(e.node(-1)).nextCell(e.pos-a,t,l);return null==n?null:e.node(0).resolve(a+n)}function h(e,t,l){let a={};for(let t in e)a[t]=e[t];return a[t]=l,a}function b(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=h(e,"colspan",e.colspan-l);return a.colwidth&&(a.colwidth=a.colwidth.slice(),a.colwidth.splice(t,l),a.colwidth.some(e=>e>0)||(a.colwidth=null)),a}function y(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=h(e,"colspan",e.colspan+l);if(a.colwidth){a.colwidth=a.colwidth.slice();for(let e=0;e{"use strict";l.d(t,{hj:()=>a});let a=e=>"table"===e.type.name},29362:(e,t,l)=>{"use strict";l.d(t,{R$:()=>r,w_:()=>o,z0:()=>i});var a=l(65998);l(69646);let n=(e,t)=>{let l=e.filter(e=>Object.keys(e.spec).length>0),a=t.filter(e=>Object.keys(e.spec).length>0),n=l.map(e=>JSON.stringify(e.spec)),o=a.map(e=>JSON.stringify(e.spec));return{removed:n.filter(e=>!o.includes(e)),added:o.filter(e=>!n.includes(e))}},o=(e,t)=>{let l=e.filter(e=>Object.keys(e.spec).length>0),a=t.filter(e=>Object.keys(e.spec).length>0);return l.length!==a.length||JSON.stringify(l.map(e=>e.spec))!==JSON.stringify(a.map(e=>e.spec))},i=e=>{let{newNode:t,oldNode:l,updateProps:i,oldDecorations:r,newDecorations:s}=e;if(JSON.stringify(t.attrs)!==JSON.stringify(l.attrs))return i(),!0;if(o(r,s)){if(a.of.get("debugLogging")){let e=n(r,s);console.debug("============== decos ================"),console.debug("decos changed",t.type.name),e.removed.length>0&&console.debug("%c decos removed: ".concat(e.removed.join(" ")," "),"color: red"),e.added.length>0&&console.debug("%c decos added: ".concat(e.added.join(" ")," "),"color: green")}i()}return!0},r=e=>{let{newNode:t,oldNode:l,updateProps:a}=e;return t.content.childCount!==l.content.childCount?(a(),!0):i(e)}},2696:(e,t,l)=>{"use strict";l.d(t,{UT:()=>b,wO:()=>p,CJ:()=>h,lC:()=>g,FX:()=>f}),l(46108);var a=l(14041);l(38452);var n=l(29719);let o={desktop:"xl",tablet:"md",mobile:"sm"};var i=l(17303),r=l(88957),s=l(60490),d=l(78354),u=l(44507);l(98371),l(82354),l(77646),l(65208),l(36830);var c=l(61690),m=l(95580);function f(){let{inPreviewContext:e}=(0,n.$E)(),t=(0,r.GV)(i.uw);return e?t:(0,u.Xb)()}function p(e){let{inPreviewContext:t}=(0,n.$E)(),l=(0,r.GV)(i.og);return(0,d.h5)(e,t&&l?o[l]:void 0)}let g=e=>{let[t,l]=(0,a.useState)(0);return(0,a.useEffect)(()=>{let t=()=>{l(t=>!e.state.selection.empty||e.isActive("link")||e.isActive("button")?t+1:0)};return e.on("update",t),e.on("selectionUpdate",t),()=>{e.off("update",t),e.off("selectionUpdate",t)}},[e]),t},h=e=>{let[t,l]=(0,a.useState)(!!e&&(0,m.We)(e));return(0,a.useEffect)(()=>{if(!e)return;let t=()=>{requestAnimationFrame(()=>{l((0,m.We)(e))})};return e.on("blur",t).on("focus",t),()=>{e.off("blur",t).off("focus",t)}},[e]),t},b=e=>{let t=(0,s.IM)();return(0,r.GV)(l=>{let a=(0,c.Jo)(l);return!!a&&t.can(e,a)})}},63822:(e,t,l)=>{"use strict";l.d(t,{$:()=>s});var a=l(81570),n=l(14041),o=l(71096),i=l(88957),r=l(61690);let s=e=>{let{editor:t,getPos:l}=e,s=(0,i.GV)(r.nD),d=(0,i.jL)(),{onContextMenu:u,menuProps:c}=(0,o.E)(),{onClose:m,...f}=c;return{onCloseContextMenu:()=>{d((0,r.$n)({open:!1})),m()},onOpenContextMenu:(0,n.useCallback)(e=>{s&&(t.view.dispatch(t.view.state.tr.setSelection(a.nh.create(t.view.state.doc,l()))),u(e),d((0,r.$n)({open:!0})))},[u,d,l,t,s]),menuProps:f}}},36830:(e,t,l)=>{"use strict";l.d(t,{N:()=>o});var a=l(14041),n=l(38452);let o=e=>(0,a.useCallback)(t=>!!e&&!!(0,n.Tx)(t)&&(((0,n.Eb)(t),t.shiftKey)?e.commands.redo():e.commands.undo()),[e])},16372:(e,t,l)=>{"use strict";l.d(t,{b:()=>s});var a=l(69011),n=l.n(a),o=l(14041);class i{subscribe(e,t){return this.listeners[e]=this.listeners[e]||[],this.listeners[e].push(t),()=>{try{if(!this.listeners[e])return;let l=this.listeners[e].indexOf(t);l>-1&&this.listeners[e].splice(l,1)}catch(e){}}}isRendered(e){return this.renderedMap[e]}onRendered(e){var t;this.renderedMap[e]=!0,null===(t=this.listeners[e])||void 0===t||t.forEach(e=>e())}onEditorUnload(e){this.renderedMap[e]=!1,this.listeners[e]=[]}constructor(){this.renderedMap={main:!1},this.listeners={}}}let r=n()(()=>new i),s=e=>{var t;let[l,a]=(0,o.useState)(void 0===e||null===(t=r().isRendered(e))||void 0===t||t);return(0,o.useEffect)(()=>{if(e)return r().subscribe(e,()=>{a(!0)})},[e]),l}},86671:(e,t,l)=>{"use strict";l.d(t,{S:()=>p,_:()=>c});var a=l(25369),n=l(13236),o=l(69e3),i=l(81570),r=l(43873),s=l(11329),d=l(48470),u=l(80245);let c=new i.hs("UniqueAttribute"),m=new Map,f=e=>{let{editor:t,tr:l,node:n,initialValue:o,pos:i,attributeName:r,syncWithFilmstrip:s,pluginKey:d}=e;(s="function"==typeof s?s():!!s)&&!d&&console.error("Cannot sync with filmstrip without plugin key");let u=(()=>{if(t.isThumbnail&&s&&d){var e,l;let t=null===(e=m.get(d))||void 0===e?void 0:e.shift();if(t&&(null===(l=t.type)||void 0===l?void 0:l.name)===n.type.name&&t.pos===i)return console.debug("%c [UniqueAttribute] Reused ".concat(r,' "').concat(t.val,'" for ').concat(n.type.name),"background-color: deeppink",{pos:i}),t.val;a.Cp({message:"Mismatch trying to reuse attribute",attributeName:r,nodeType:n.type,pos:i,existing:t})}return o()})();return!t.isThumbnail&&s&&d&&(m.has(d)||m.set(d,[]),m.get(d).push({type:n.type,val:u,pos:i}),console.debug("%c [UniqueAttribute] Should reuse ".concat(r,' "').concat(u,'" for ').concat(n.type.name),"background-color: deeppink",{pos:i})),l.setNodeMarkup(i,void 0,{...n.attrs,[r]:u}),{node:n,val:u,pos:i}},p=n.YY.create({name:"UniqueAttribute",priority:r.y.UniqueAttribute,addOptions(){return{attributeName:"",pluginKey:new i.hs(this.name),types:[],initialValue:()=>void 0,filterTransaction:null,syncWithFilmstrip:!1}},addGlobalAttributes(){return[{types:this.options.types,attributes:{[this.options.attributeName]:{default:null,parseHTML:e=>this.options.parseHTML?this.options.parseHTML(e):e.getAttribute("data-".concat(this.options.attributeName)),renderHTML:e=>this.options.renderHTML?this.options.renderHTML(e):e[this.options.attributeName]?{["data-".concat(this.options.attributeName)]:e[this.options.attributeName]}:{}}}}]},onCreate(){let{view:e,state:t}=this.editor,{tr:l,doc:a}=t,{types:o,attributeName:i,pluginKey:r,initialValue:s,callback:d}=this.options,u=(0,n.xe)(a,e=>o.includes(e.type.name)&&null===e.attrs[i]).map(e=>{let{node:t,pos:a}=e;return f({editor:this.editor,pos:a,node:t,tr:l,syncWithFilmstrip:!1,initialValue:s,attributeName:i,pluginKey:r})});0!==u.length&&(e.dispatch(l),d&&d(this.editor,u,l.doc))},addProseMirrorPlugins(){let e=!1;return[new i.k_({key:this.options.pluginKey,appendTransaction:(e,t,l)=>{let a=e.some(e=>e.docChanged)&&!t.doc.eq(l.doc),o=this.options.filterTransaction&&e.some(e=>{var t,l;return!(null===(t=(l=this.options).filterTransaction)||void 0===t?void 0:t.call(l,e))});if(!a||o)return;let{tr:i}=l,{types:r,attributeName:m,syncWithFilmstrip:p,initialValue:g,callback:h,pluginKey:b}=this.options,y=function(e,t){let l=new s.dL(e);return t.forEach(e=>{e.steps.forEach(e=>{l.step(e)})}),l}(t.doc,e),{mapping:v}=y,k=(0,u.A)(y),w=[],x=e.some(e=>!0===e.getMeta(c));if(k.forEach(e=>{let t={from:e.newStart,to:e.newEnd},a=(0,n.Nx)(l.doc,t,e=>r.includes(e.type.name)),o=function(e){let t=e.filter((t,l)=>e.indexOf(t)!==l);return(0,d.A)(t)}(a.map(e=>{let{node:t}=e;return t.attrs[m]}).filter(e=>null!==e));a.forEach(e=>{var t;let{node:l,pos:a}=e,n=null===(t=i.doc.nodeAt(a))||void 0===t?void 0:t.attrs[m];if(!n){w.push(f({editor:this.editor,pos:a,node:l,tr:i,syncWithFilmstrip:p,initialValue:g,attributeName:m,pluginKey:b}));return}let{deleted:r}=v.invert().mapResult(a),s=r&&o.includes(n),d=r&&x;if(s||d){let e=f({editor:this.editor,pos:a,node:l,tr:i,syncWithFilmstrip:p,initialValue:g,attributeName:m,pluginKey:b});w.push(e),console.debug("%c [UniqueAttribute][".concat(this.options.types,"] Replaced ").concat(l.attrs[m]," with new val: ").concat(e.val),"background-color: deeppink",{override:d,newNode:s})}})}),h&&h(this.editor,w,i.doc),i.steps.length)return i},props:{handleDOMEvents:{drop:(t,l)=>{var a,n;return((null===(a=t.dragging)||void 0===a?void 0:a.move)!==!0||(null===(n=l.dataTransfer)||void 0===n?void 0:n.effectAllowed)==="copy")&&(e=!0),!1},paste:()=>(e=!0,!1)},transformPasted:t=>{var l;if(!e)return t;let{types:a,attributeName:n}=this.options,i=e=>{let t=[];return e.forEach(e=>{if(e.isText){t.push(e);return}if(!a.includes(e.type.name)){t.push(e.copy(i(e.content)));return}let l=e.type.create({...e.attrs,[n]:null},i(e.content),e.marks);t.push(l)}),o.FK.from(t)},r=this.options.transformPasted?this.options.transformPasted(t,this.options,null===this||void 0===this?void 0:null===(l=this.editor)||void 0===l?void 0:l.gammaDocId):new o.Ji(i(t.content),t.openStart,t.openEnd);return e=!1,r}}})]}})},39933:(e,t,l)=>{"use strict";l.d(t,{e:()=>a});let a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"id";return{default:null,parseHTML:l=>{let a=l.getAttribute("data-".concat(t));if(a)return a;let n=e();return console.debug("[configureIdAttribute] generating id in parseHTML",n),n}}}},80245:(e,t,l)=>{"use strict";l.d(t,{A:()=>n});var a=l(48470);function n(e){let{mapping:t,steps:l}=e,n=[];return t.maps.forEach((e,a)=>{if(e.ranges.length)e.forEach((e,l)=>{let o=t.slice(a).map(e,-1),i=t.slice(a).map(l),r=t.invert().map(o,-1),s=t.invert().map(i);n.push({oldStart:r,oldEnd:s,newStart:o,newEnd:i})});else{let e=l[a];"pos"in e&&n.push({oldStart:e.pos,oldEnd:e.pos,newStart:e.pos,newEnd:e.pos}),"from"in e&&n.push({oldStart:e.from,oldEnd:e.to,newStart:e.from,newEnd:e.to})}}),function(e){let t=(0,a.A)(e);return 1===t.length?t:t.filter((e,l)=>!t.filter((e,t)=>t!==l).some(t=>e.oldStart>=t.oldStart&&e.oldEnd<=t.oldEnd&&e.newStart>=t.newStart&&e.newEnd<=t.newEnd))}(n)}},48470:(e,t,l)=>{"use strict";function a(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:JSON.stringify,l={};return e.filter(e=>{let a=t(e);return!Object.prototype.hasOwnProperty.call(l,a)&&(l[a]=!0)})}l.d(t,{A:()=>a})},438:(e,t,l)=>{"use strict";l.d(t,{Ey:()=>i,Zo:()=>o,tt:()=>r});var a=l(13236),n=l(81570);let o=(e,t)=>(0,a.xe)(e,e=>!!t.isInSet(e.marks)),i=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return l=>{let a=n.LN.findFrom(l.doc.resolve(e),t,!0);return a?l.setSelection(a):l}},r=e=>t=>(0,a.KP)(t=>s(e,t))(t),s=(e,t)=>Array.isArray(e)&&e.indexOf(t.type)>-1||t.type===e},20392:(e,t,l)=>{"use strict";l.d(t,{K:()=>n});var a=l(13236);l(14041);class n extends a.KE{constructor(...e){super(...e),this.contentComponent=null}}},5893:(e,t,l)=>{"use strict";l.d(t,{$:()=>s});var a=l(31085),n=l(14041),o=l(43144);let i=e=>{let{renderers:t}=e;return(0,a.jsx)(a.Fragment,{children:Object.entries(t).map(e=>{let[t,l]=e;return o.createPortal(l.reactElement,l.element,t)})})};class r extends n.Component{componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let{editor:e}=this.props;if(e&&e.options.element){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.options.element.childNodes),e.setOptions({element:t}),e.contentComponent=this,e.createNodeViews(),this.initialized=!0}}maybeFlushSync(e){this.initialized?(0,o.flushSync)(e):e()}setRenderer(e,t){this.maybeFlushSync(()=>{this.setState(l=>{let{renderers:a}=l;return{renderers:{...a,[e]:t}}})})}removeRenderer(e){this.maybeFlushSync(()=>{this.setState(t=>{let{renderers:l}=t,a={...l};return delete a[e],{renderers:a}})})}componentWillUnmount(){let{editor:e}=this.props;if(!e||(this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),e.contentComponent=null,!e.options.element.firstChild))return;let t=document.createElement("div");t.append(...e.options.element.childNodes),e.setOptions({element:t})}render(){let{editor:e,portalComponent:t,...l}=this.props;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{ref:this.editorContentRef,...l}),(0,a.jsx)(this.portalComponent,{renderers:this.state.renderers})]})}constructor(e){super(e),this.editorContentRef=n.createRef(),this.initialized=!1,this.portalComponent=e.portalComponent||i,this.state={renderers:{}}}}let s=n.memo(r)},87487:(e,t,l)=>{"use strict";l.d(t,{V:()=>i});var a=l(31085),n=l(14041),o=l(95186);let i=n.forwardRef((e,t)=>{let{onDragStart:l}=(0,o.c)(),n=e.as||"div";return(0,a.jsx)(n,{...e,ref:t,"data-node-view-wrapper":"",onDragStart:l,style:{whiteSpace:"normal",...e.style}})})},90768:(e,t,l)=>{"use strict";l.d(t,{L:()=>u,g:()=>c});var a=l(31085),n=l(13236),o=l(69e3);l(14041);var i=l(44507),r=l(18924),s=l(80915),d=l(95186);class u extends n.Yv{stopEvent(e){return"contextmenu"!==e.type&&n.Yv.prototype.stopEvent.call(this,e)}updateAttributes(e){this.editor.commands.command(t=>{let{tr:l}=t,a=this.getPos();if(void 0===a)return;let n={type:"move",insertPos:a,insertPosRaw:a,pos:a,end:a+this.node.content.size+1};try{l.setNodeMarkup(a,void 0,{...this.node.attrs,...e}).setMeta("annotationEvent",n)}catch(e){console.error("(caught) [ReactNodeView updateAttributes]: setNodeMarkup",e)}return!0})}mount(){var e=this;let t={editor:this.editor,node:this.node,decorations:this.decorations,selected:!1,extension:this.extension,getPos:()=>this.getPos(),updateAttributes:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.updateAttributes(t)},deleteNode:()=>this.deleteNode()};if(!this.component.displayName){let e;this.component.displayName=(e=this.extension.name).charAt(0).toUpperCase()+e.substring(1)}let l=e=>{let t=this.component,l=this.onDragStart.bind(this);return(0,a.jsx)(d.e.Provider,{value:{onDragStart:l,nodeViewContentRef:e=>{e&&this.contentDOMElement&&e.firstChild!==this.contentDOMElement&&e.appendChild(this.contentDOMElement)},node:this.node,editor:this.editor,getPos:this.getPos},children:(0,a.jsx)(t,{...e})})};l.displayName="ReactNodeView",this.contentDOMElement=this.node.isLeaf?null:document.createElement(this.node.isInline||this.node instanceof o.CU?"span":"div"),this.contentDOMElement&&(this.contentDOMElement.style.whiteSpace="inherit",this.contentDOMElement.setAttribute("data-node-view-content-inner",this.node.type.name));let n=this.node.isInline?"span":"div";this.options.as&&(n=this.options.as);let{className:i=""}=this.options;this.renderer=new s.N(l,{editor:this.editor,props:t,as:n,className:"node-".concat(this.node.type.name," ").concat(i).trim(),updateWrapperEl:this.options.updateWrapperEl})}get dom(){var e;if(this.renderer.element.firstElementChild&&!(null===(e=this.renderer.element.firstElementChild)||void 0===e?void 0:e.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}update(e,t){let l=e=>{this.renderer.updateProps(e)};if(e.type!==this.node.type)return!1;if("function"==typeof this.options.update){let a=this.node,n=this.decorations;return this.node=e,this.decorations=t,this.options.update({oldNode:a,oldDecorations:n,newNode:e,newDecorations:t,updateProps:()=>l({node:e,decorations:t})})}return e===this.node&&this.decorations===t||(this.node=e,this.decorations=t,l({node:e,decorations:t}),!0)}selectNode(){this.renderer.updateProps({selected:!0})}deselectNode(){this.renderer.updateProps({selected:!1})}destroy(){this.renderer.destroy(),this.contentDOMElement=null}ignoreMutation(e){return!this.dom||!this.contentDOM||"function"==typeof this.options.ignoreMutation&&this.options.ignoreMutation({mutation:e})||this.defaultIgnoreMutation(e)}defaultIgnoreMutation(e){return!!(this.node.isLeaf||this.node.isAtom||"selection"===e.type&&e.target.closest("[data-comments-wrapper]"))||!("selection"===e.type||this.dom.contains(e.target)&&"childList"===e.type&&(0,i.OF)()&&this.editor.isFocused&&[...Array.from(e.addedNodes),...Array.from(e.removedNodes)].every(e=>e.isContentEditable))&&(this.contentDOM===e.target&&"attributes"===e.type||!this.contentDOM.contains(e.target))}onDragStart(e){let t=e.target,l=t.querySelector("[data-drag-handle]");if(l||(l=t.closest("[data-drag-handle]")),!this.dom||!l)return e.preventDefault(),!1;try{let t=this.editor.view.posAtDOM(l,0);if(!t||-1==t||!this.editor.state.doc.nodeAt(t))return;(0,r.b)(this.editor,e,t,l)}catch(e){console.warn("(caught) [ReactNodeViewRenderer] onDragStart error moving annotations",e)}}}function c(e,t){return l=>l.editor.contentComponent?new u(e,l,t):{}}},80915:(e,t,l)=>{"use strict";l.d(t,{N:()=>n});var a=l(31085);l(14041);class n{render(){var e,t,l;let n=this.component,o=this.props;("function"==typeof n&&n.prototype&&n.prototype.isReactComponent||"object"==typeof n&&(null===(l=n.$$typeof)||void 0===l?void 0:l.toString())==="Symbol(react.forward_ref)")&&(o.ref=e=>{this.ref=e}),this.reactElement=(0,a.jsx)(n,{...o}),this.updateWrapperEl&&this.updateWrapperEl(this.element,o),null===(t=this.editor)||void 0===t||null===(e=t.contentComponent)||void 0===e||e.setRenderer(this.id,this)}updateProps(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.props={...this.props,...e},this.render()}destroy(){var e,t;null===(t=this.editor)||void 0===t||null===(e=t.contentComponent)||void 0===e||e.removeRenderer(this.id)}constructor(e,{editor:t,props:l={},as:a="div",className:n="",updateWrapperEl:o}){this.ref=null,this.id=Math.floor(0xffffffff*Math.random()).toString(),this.component=e,this.editor=t,this.props=l,this.updateWrapperEl=o,this.element=document.createElement(a),this.element.classList.add("react-renderer"),n&&this.element.classList.add(...n.split(" ")),this.render()}}},25845:(e,t,l)=>{"use strict";l.d(t,{f:()=>o});var a=l(81570),n=l(90768);let o=(e,t)=>new a.k_({key:new a.hs("".concat(e.name,"_markview")),props:{nodeViews:{[e.name]:(l,a,o,i)=>(0,n.g)(t,{as:"span"})({editor:e.editor,node:l,getPos:o,decorations:i,extension:{name:e.name,type:e.type.name,options:e.options,storage:e.storage},HTMLAttributes:{}})}}})},58599:(e,t,l)=>{"use strict";l.d(t,{$Z:()=>a.$,$p:()=>d,VR:()=>c.V,Lz:()=>n.L,gu:()=>n.g,hG:()=>m.h}),l(20392);var a=l(5893),n=l(90768),o=l(31085);l(14041);var i=l(82257),r=l(74346),s=l(95186);let d=e=>(0,i.oR)()?(0,o.jsx)(r.$,{...e}):(0,o.jsx)(u,{...e}),u=e=>{let t=e.as||"div",{nodeViewContentRef:l}=(0,s.c)();return(0,o.jsx)(t,{...e,ref:l,"data-node-view-content":"",style:{whiteSpace:"pre-wrap",...e.style}})};u.displayName="NodeViewContentCore";var c=l(87487),m=l(24935)},24935:(e,t,l)=>{"use strict";l.d(t,{h:()=>i});var a=l(14041),n=l(20392);let o=()=>{},i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,a.useMemo)(()=>(o(),new n.K(e)),[]),l=function(){let[,e]=(0,a.useState)(0);return()=>e(e=>e+1)}();return(0,a.useEffect)(()=>{let e=!0;return t.on("transaction",()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{e&&l()})})}),()=>{t.destroy(),e=!1}},[t]),t}},95186:(e,t,l)=>{"use strict";l.d(t,{c:()=>o,e:()=>n});var a=l(14041);let n=(0,a.createContext)({onDragStart:void 0}),o=()=>(0,a.useContext)(n)},61690:(e,t,l)=>{"use strict";l.d(t,{tB:()=>H,zq:()=>$,Ff:()=>e0,cL:()=>v,b6:()=>el,rv:()=>eo,WS:()=>eS,Ev:()=>eB,bO:()=>eF,mi:()=>ea,Cl:()=>eh,Du:()=>eZ,Jo:()=>e_,zu:()=>ei,JV:()=>eP,zB:()=>eO,sX:()=>eG,IO:()=>eM,aQ:()=>eH,Uu:()=>er,RW:()=>eE,sK:()=>eT,We:()=>ep,yh:()=>eg,iZ:()=>eX,nD:()=>es,r9:()=>ej,Xu:()=>eI,dK:()=>eA,DH:()=>ez,e4:()=>eq,Ik:()=>eb,cS:()=>eN,ng:()=>eD,tC:()=>eU,mA:()=>ew,QF:()=>ey,rp:()=>ev,w7:()=>em,OG:()=>eu,tT:()=>eL,VJ:()=>ed,YL:()=>ec,jO:()=>ex,FI:()=>e$,wC:()=>ek,$i:()=>eY,xO:()=>eR,SJ:()=>en,q:()=>eC,Ml:()=>eW,eo:()=>ef,t0:()=>A,ln:()=>z,fw:()=>B,$n:()=>et,BN:()=>C,H3:()=>I,Jr:()=>D,v5:()=>N,U:()=>P,mF:()=>F,kd:()=>j,Zf:()=>E,a:()=>W,Yl:()=>q,z1:()=>U,rR:()=>J});var a=l(8796),n=l(41054),o=l(30503),i=l(11576),r=l(82354),s=l(58335),d=l(6157),u=l(24051);l(14561),l(59945),l(58525),l(7470),l(93230);let c=u.z;var m=l(14e3);let f=!(0,o.NF)(),p={collaborators:[],newFollowers:[],docAttrs:s.C,cardIds:[],cardIdMap:{tree:{},parents:{},treeArray:[]},isAllowedToEdit:f,isEditingInSlideView:!1,isPresenterViewEditor:!1,presentModeContextMenu:{pos:null,cardId:null},isEditingMedia:!1,isEditingDisabled:!1,openBlockCommentId:null,viewingCommentId:null,draftReplies:{},isStatic:!1,animationsEnabled:!0,forceDisableAnimations:!1,commentsEnabled:!1,expandedNoteId:null,expandedDrawingId:null,expandedChartId:null,theme:null,userZoomLevel:r.vN,autoZoomEnabled:null,docZoomLevel:1,docZoomToFit:null,hocuspocusProvider:null,memoState:{mode:m.w.DOC_VIEW,following:null,attached:!1,scroll:{pos:null,pct:null},expandedCards:{},expandedToggles:{},expandedMediaId:null},contextMenuOpen:!1},g=(e,t)=>{let l=e.collaborators.filter(t=>{var l;return(null===(l=t.memoState)||void 0===l?void 0:l.following)===e.localCollaboratorId});return t.filter(t=>{var a;return e.localCollaboratorId&&(null===(a=t.memoState)||void 0===a?void 0:a.following)===e.localCollaboratorId&&!l.find(e=>e.id===t.id)})},h=(e,t)=>{let l=+new Date;return e.collaborators.filter(e=>!t.find(t=>t.sessionId===e.sessionId)&&!!e.sessionId&&!(e.idleSince&&l-e.idleSince>5e3))},b=e=>{let t=eK({TipTap:e}),l=eQ({TipTap:e});t&&(null==l?void 0:l.memoState)&&(e.memoState.expandedCards=l.memoState.expandedCards,e.memoState.expandedMediaId=l.memoState.expandedMediaId,e.memoState.expandedToggles=l.memoState.expandedToggles,e.memoState.mode=l.memoState.mode,e.memoState.scroll=l.memoState.scroll)},y=(0,a.Z0)({name:"TipTap",initialState:p,reducers:{reset:()=>p,setCollaborators(e,t){let{collaborators:l}=t.payload,a=h(e,l).map(e=>(e.idleSince||(e.idleSince=+new Date),e));e.newFollowers=g(e,l),e.collaborators=l.concat(a),b(e)},setDocAttrs(e,t){let{docAttrs:l}=t.payload;Object.assign(e.docAttrs,l)},setCardIds(e,t){let{cardIds:l,cardIdMap:a}=t.payload;e.cardIds=l,e.cardIdMap=a},setLocalCollaboratorId(e,t){let{sessionId:l}=t.payload;e.localCollaboratorId=l},setIsAllowedToEdit(e,t){let{isAllowedToEdit:l}=t.payload;e.isAllowedToEdit=l},setIsEditingInSlideView(e,t){let{isEditingInSlideView:l}=t.payload;e.isEditingInSlideView=l},setIsPresenterViewEditor(e,t){let{isPresenterViewEditor:l}=t.payload;e.isPresenterViewEditor=l},setPresentModeContextMenu(e,t){e.presentModeContextMenu=t.payload},closePresentModeContextMenu(e){e.presentModeContextMenu={pos:null,cardId:null}},setIsEditingMedia(e,t){let{isEditingMedia:l}=t.payload;e.isEditingMedia=l},setIsStatic(e,t){let{isStatic:l}=t.payload;e.isStatic=l},setAnimationsEnabled(e,t){let{animationsEnabled:l}=t.payload;e.animationsEnabled=l},setForceDisableAnimations(e,t){let{disable:l}=t.payload;e.forceDisableAnimations=l},setCommentsEnabled(e,t){let{commentsEnabled:l}=t.payload;e.commentsEnabled=l},setMode(e,t){let{mode:l}=t.payload;e.memoState.mode=l},setCardsCollapsed(e,t){let{cardIds:l,isCollapsed:a}=t.payload;l.forEach(t=>{e.memoState.expandedCards[t]=!a}),e.memoState.attached=!1},setExpandedCardsMap(e,t){let{expandedCardsMap:l}=t.payload;e.memoState.expandedCards=l},setMediaNodeExpanded(e,t){let{nodeId:l}=t.payload;e.memoState.expandedMediaId=l||null,e.memoState.attached=!1},setTogglesExpanded(e,t){let{toggleIds:l,isExpanded:a}=t.payload;l.forEach(t=>{e.memoState.expandedToggles[t]=a})},setExpandedNoteId(e,t){let{noteId:l}=t.payload;e.expandedNoteId=l},setExpandedChartId(e,t){let{chartId:l}=t.payload;e.expandedChartId=l},setExpandedDrawingId(e,t){let{drawingId:l}=t.payload;e.expandedDrawingId=l},setFollowingAttached(e,t){let{attached:l,following:a}=t.payload;void 0!==l&&(e.memoState.attached=l),void 0!==a&&(e.memoState.following=a),b(e)},setDoc(e,t){let{doc:l}=t.payload;e.doc=l},setTheme(e,t){let{theme:l}=t.payload;e.theme=JSON.parse(JSON.stringify(l))},setScroll(e,t){e.memoState.scroll=t.payload},setCommentReactionOpen(e,t){let{isOpen:l,blockCommentId:a,viewingCommentId:n}=t.payload;e.openBlockCommentId=l?a:null,e.viewingCommentId=n},setIsEditingDisabled(e,t){let{isEditingDisabled:l}=t.payload;e.isEditingDisabled=l},updateDraftReply(e,t){let{id:l,reply:a}=t.payload;e.draftReplies[l]=a},deleteDraftReply(e,t){delete e.draftReplies[t.payload.id]},setZoomLevel(e,t){e.userZoomLevel=t.payload.zoomLevel},setDocZoomLevel(e,t){e.docZoomLevel=t.payload.zoomLevel},setDocZoomToFit(e,t){e.docZoomToFit=t.payload.enabled},setAutoZoomEnabled(e,t){e.autoZoomEnabled=t.payload.enabled},setHocuspocusProvider(e,t){e.hocuspocusProvider=t.payload.hocuspocusProvider},setContextMenuOpen(e,t){e.contextMenuOpen=t.payload.open}}}),{reset:v,setAnimationsEnabled:k,setForceDisableAnimations:w,setCollaborators:x,setCommentsEnabled:S,setCardIds:A,setDoc:C,setCardsCollapsed:z,setDocAttrs:I,setIsAllowedToEdit:j,setFollowingAttached:F,setCommentReactionOpen:B,setIsEditingDisabled:R,setIsEditingInSlideView:_,setIsPresenterViewEditor:M,setIsEditingMedia:E,setIsStatic:T,setExpandedCardsMap:O,setExpandedNoteId:P,setExpandedDrawingId:N,setExpandedChartId:D,setLocalCollaboratorId:L,setMediaNodeExpanded:W,setTogglesExpanded:U,setPresentModeContextMenu:G,closePresentModeContextMenu:H,setMode:V,setTheme:q,setScroll:K,updateDraftReply:J,deleteDraftReply:$,setZoomLevel:Q,setAutoZoomEnabled:Y,setDocZoomLevel:X,setDocZoomToFit:Z,setHocuspocusProvider:ee,setContextMenuOpen:et}=y.actions,el=e=>{var t,l;let a=e.TipTap.animationsEnabled&&!e.TipTap.forceDisableAnimations,n=(null===(l=e.TipTap.docAttrs)||void 0===l?void 0:null===(t=l.settings)||void 0===t?void 0:t.animationsEnabled)!==!1;return a&&n},ea=e=>e.TipTap.commentsEnabled,en=e=>{var t,l,a;return(null===(t=e.Site.site)||void 0===t?void 0:t.theme)?e.Site.site.theme:e.TipTap.theme?e.TipTap.theme:(null===(l=e.TipTap.doc)||void 0===l?void 0:l.theme)?null===(a=e.TipTap.doc)||void 0===a?void 0:a.theme:c},eo=e=>{var t;return null===(t=e.TipTap.docAttrs)||void 0===t?void 0:t.background},ei=e=>e.TipTap.docAttrs,er=(0,n.Mz)(e=>e.TipTap.docAttrs,e=>{let t=null==e?void 0:e.settings,l=(0,d.zK)(e)||"deck";return(0,d.Sm)(t,l)});(0,n.Mz)(er,e=>{let t=e.cardDimensions;return i.xs[t].orientation});let es=(e,t)=>{let{isAllowedToEdit:l,isEditingInSlideView:a,isEditingDisabled:n,memoState:{mode:o}}=e.TipTap,i=t||o,r=i!==m.w.DOC_PREVIEW&&(i!==m.w.SLIDE_VIEW||a);return l&&r&&!n},ed=e=>!es(e)&&ek(e)===m.w.SLIDE_VIEW,eu=e=>{let t=ek(e),l=eY(e)||"";return!0==(t===m.w.SLIDE_VIEW)&&eF(e).includes(l)},ec=e=>{let{pos:t,cardId:l}=e.TipTap.presentModeContextMenu;return null!==t||null!==l},em=e=>{let t=ek(e),l=eY(e)||"";return!0==(t===m.w.DOC_VIEW)&&!eF(e).includes(l)},ef=e=>e.TipTap.userZoomLevel,ep=e=>e.TipTap.docZoomLevel,eg=e=>e.TipTap.docZoomToFit,eh=e=>es(e)&&!eN(e),eb=e=>e.TipTap.isAllowedToEdit,ey=e=>e.TipTap.isEditingInSlideView,ev=e=>e.TipTap.isEditingMedia,ek=e=>e.TipTap.memoState.mode,ew=e=>e.TipTap.memoState.mode===m.w.DOC_PREVIEW,ex=e=>e.TipTap.isStatic,eS=e=>t=>!t.TipTap.isStatic&&!eB(t).tree[e]&&!t.TipTap.memoState.expandedCards[e],eA=e=>e.TipTap.memoState.expandedMediaId,eC=e=>t=>t.TipTap.memoState.expandedToggles[e],ez=e=>e.TipTap.expandedNoteId,eI=e=>e.TipTap.expandedDrawingId,ej=e=>e.TipTap.expandedChartId,eF=e=>e.TipTap.cardIds,eB=e=>e.TipTap.cardIdMap,eR=e=>{let{cardId:t,showAll:l=!1}=e;return(0,n.Mz)(e=>e.TipTap.cardIdMap,e=>{let a=e.treeArray;if(l)return a;if(!t)return[];let n=a.findIndex(e=>e.id===t);return -1===n?[]:a.slice(n+1)})};(0,n.Mz)(e=>e.TipTap.cardIdMap,e=>{let{tree:t}=e;return Object.keys(t)});let e_=e=>e.TipTap.doc,eM=e=>{var t;return null===(t=e.TipTap.doc)||void 0===t?void 0:t.links},eE=e=>{var t,l;return(null===(l=e.TipTap.doc)||void 0===l?void 0:null===(t=l.site)||void 0===t?void 0:t.hasCustomDomain)===!0},eT=e=>{var t;return null===(t=e.TipTap.doc)||void 0===t?void 0:t.organization},eO=e=>{var t;return null===(t=e.TipTap.doc)||void 0===t?void 0:t.editors},eP=e=>{let t=e.TipTap.doc;if(!t)return null;let{createdBy:l}=t;return l},eN=e=>null!==e.TipTap.openBlockCommentId,eD=e=>t=>t.TipTap.openBlockCommentId===e,eL=e=>t=>null!==t.TipTap.openBlockCommentId&&t.TipTap.openBlockCommentId!==e,eW=e=>e.TipTap.viewingCommentId,eU=e=>(0,n.Mz)(eW,e=>e.TipTap.doc,(t,l)=>{var a;if(!t||!l)return!1;let n=null===(a=l.comments)||void 0===a?void 0:a.find(e=>e.id===t);return(null==n?void 0:n.cardId)===e}),eG=e=>{var t;return null===(t=e.TipTap.doc)||void 0===t?void 0:t.id},eH=e=>{var t,l;return null===(l=e.TipTap.doc)||void 0===l?void 0:null===(t=l.organization)||void 0===t?void 0:t.id},eV=(0,n.Mz)(e=>e.TipTap.localCollaboratorId,e=>e.TipTap.collaborators,(e,t)=>{if(e)return t.find(t=>t.sessionId===e)}),eq=e=>eK(e)&&eJ(e),eK=e=>e.TipTap.memoState.attached,eJ=e=>!!e.TipTap.memoState.following;(0,n.Mz)(e=>e.TipTap.collaborators,e=>e.TipTap.localCollaboratorId,(e,t)=>e.some(e=>{var l;return e.sessionId!==t&&(null===(l=e.memoState)||void 0===l?void 0:l.following)===t}));let e$=e=>{let t=eV(e);return null==t?void 0:t.spotlight},eQ=e=>e.TipTap.collaborators.find(t=>t.sessionId===e.TipTap.memoState.following),eY=e=>{var t;let l=eV(e);return null==l?void 0:null===(t=l.spotlight)||void 0===t?void 0:t.cardId},eX=e=>t=>t.TipTap.draftReplies[e],eZ=e=>e.TipTap.contextMenuOpen,e0=y.reducer},38684:(e,t,l)=>{"use strict";l.d(t,{FD:()=>d,fS:()=>r,gK:()=>u,w3:()=>s});var a=l(11081),n=l(26813);l(42391);var o=l(22544),i=l(17539);l(5366);let r=(e,t)=>t&&t.type!==n.h.NONE?t:e.config.background&&e.config.background.type!==n.h.NONE?e.config.background:a.Hp,s=e=>{if(!e)return"center";let{backgroundPos:t}=e;return t?"".concat(t.x,"% ").concat(t.y,"%"):"center"},d=function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{width:2400},a=arguments.length>3?arguments[3]:void 0;if(e.type===n.h.GRADIENT){var r,d;let l=(null===(r=e.gradient)||void 0===r?void 0:r.css)||e.css;return o.hQ?{backgroundColor:null===(d=e.gradient)||void 0===d?void 0:d.primaryColor}:{backgroundColor:t?"black":"white",...l,backgroundPosition:"center",backgroundSize:"cover"}}if(e.type===n.h.IMAGE&&e.image){let{tempUrl:t,meta:n}=e.image,o=e.image.src?(0,i.pO)(e.image.src,a):void 0,r=o?(0,i.Ub)(o,l,n):void 0;return{backgroundImage:(0,i.QV)(r,r?void 0:t),backgroundPosition:s(e.image),backgroundSize:"cover",backgroundRepeat:"no-repeat"}}return e.type===n.h.COLOR&&e.color?{backgroundColor:"string"==typeof e.color?e.color:e.color.hex}:{}},u=e=>e&&e.type===n.h.COLOR&&e.color?e.color.hex:void 0},11081:(e,t,l)=>{"use strict";l.d(t,{$N:()=>r,Hp:()=>c,SS:()=>u,UX:()=>n,X8:()=>o,bd:()=>i,hQ:()=>s,xC:()=>d});var a=l(26813);let n=".block-bullet, .block-numbered, .block-todo",o="0.35em",i=e=>e?"0.75em":"1.125em",r={blockquote:"1.15em",codeBlock:["0.85em","1em"]},s=e=>({default:{mt:e?"1em":"1.5em",mb:e?"1em":"1.5em"},compact:{mt:e?"0.8em":"1em",mb:e?"0.8em":"1em"},relaxed:{mt:e?"1.6em":"2em",mb:e?"1.6em":"2em"},tight:{mt:"0.6em",mb:"0.6em"}}),d=e=>({compact:{my:e?"0.8em":"0.9em",[":is(".concat(n,")")]:{my:o}},tight:{my:"0.6em",[":is(".concat(n,")")]:{my:"0.3em"}}}),u={type:a.h.NONE,source:void 0},c={type:a.h.COLOR,color:{hex:"#FAFAFA"}};a.h.IMAGE},43909:(e,t,l)=>{"use strict";l.d(t,{NC:()=>f,mm:()=>m,wL:()=>c});var a=l(82451),n=l.n(a),o=l(1771),i=l(26813),r=l(42391),s=l(38684);let d={isDark:void 0,effect:i.t.FROSTED},u="var(--chakra-shadows-md)",c=(e,t,l)=>{if(!e)return{};let a=l?"var(--chakra-radii-md)":"var(--chakra-radii-xl)",n=f(t,e),{isDark:o}=m(t,e);switch(e.effect){case i.t.COLLAPSED:return{backgroundColor:(0,r.$3)(o?(0,r.Zt)(n,30):n,.6),"@media print":{boxShadow:"none"}};case i.t.SOLID:return{boxShadow:u,"--neutral-border-color":o?"var(--chakra-colors-gray-700)":"var(--chakra-colors-gray-200)","--box-border-radius":a,backgroundColor:n,"@media print":{boxShadow:"none"}};case i.t.FADED:return{boxShadow:u,"--neutral-border-color":o?"var(--chakra-colors-gray-whiteAlpha-300)":"var(--chakra-colors-whiteAlpha-500)","--box-border-radius":a,backgroundColor:(0,r.$3)(n,.75),"@media print":{boxShadow:"none"}};case i.t.FROSTED:return{backdropFilter:"blur(20px) saturate(170%)",boxShadow:u,"--neutral-border-color":o?"var(--chakra-colors-gray-whiteAlpha-300)":"var(--chakra-colors-whiteAlpha-500)","--box-border-radius":a,backgroundColor:(0,r.$3)(n,.75),"@media print":{boxShadow:"none",backgroundColor:(0,r.$3)(n,.95)}};case i.t.CLEAR:return{boxShadow:void 0}}return{}},m=(e,t)=>n()({},d,e.config.container,t),f=(e,t)=>{let l=m(e,t),a=(0,o.Oq)(e),n=(0,s.gK)(l.background);return null!=n?n:a}},38888:(e,t,l)=>{"use strict";l.d(t,{WI:()=>s,X0:()=>d});var a=l(33795),n=l(11081);let o=[...Array(a.uw+1).keys()],i="1.6em",r=["disc","circle","square"],s=e=>({listStyle:r[e%r.length],paddingStart:"0.4em",_after:{ps:"0.4em"},marginStart:"calc(".concat(e+1," * ").concat(i," - 0.4em)")}),d={[n.UX]:{margin:"0",marginBottom:n.X8,textAlign:"start","&.first-block":{marginTop:n.X8}},"ol.block-numbered":{listStyle:"none"},".block-todo":{listStyle:"none","label.chakra-checkbox":{pointerEvents:"none",".chakra-checkbox__control":{pointerEvents:"auto",width:"1em",height:"1em",top:"0.3em",position:"relative",borderRadius:"var(--box-border-radius)",borderColor:"var(--link-color)",borderWidth:"0.125em","&[data-checked]":{backgroundColor:"var(--link-color)",color:"var(--body-color-inverted)"},svg:{fontSize:"0.5em"}}}},".block-bullet, .block-todo":{li:{position:"relative"}}};o.forEach(e=>{d['ol.block-numbered[indent="'.concat(e,'"]')]={"li[data-node-view-content]":{ms:"calc(".concat(e+1," * ").concat(i,")"),position:"relative",_before:{position:"absolute",insetStart:"-".concat(i),content:'attr(data-list-counter) "."'}}}}),o.forEach(e=>{d['ul.block-bullet[indent="'.concat(e,'"]')]={"li[data-node-view-content]":s(e)},d['ul.block-todo[indent="'.concat(e,'"]')]={"li.todo":{ms:"calc(".concat(e+1," * ").concat(i,")"),listStyle:"none"},".chakra-checkbox__control":{insetStart:"-".concat(i)}}})},24051:(e,t,l)=>{"use strict";l.d(t,{z:()=>n});var a=l(26813);let n={accentColor:"#4950bc",archived:!1,config:{accentBackgrounds:[{accentId:"b11faf30",image:{meta:{height:4096,width:4096},name:"defaultlight-1_b11faf30.jpg",source:"image.custom",src:"https://cdn.gamma.app/theme_images/default-light/defaultlight-1_b11faf30.jpg"},originalSource:"image.custom",source:"accent.theme",type:a.h.IMAGE},{accentId:"bd6251c2",image:{meta:{height:4096,width:4096},name:"defaultlight-2_bd6251c2.jpg",source:"image.custom",src:"https://cdn.gamma.app/theme_images/default-light/defaultlight-2_bd6251c2.jpg"},originalSource:"image.custom",source:"accent.theme",type:a.h.IMAGE},{accentId:"fc5293f8",image:{meta:{height:4096,width:4096},name:"defaultlight-3_fc5293f8.jpg",source:"image.custom",src:"https://cdn.gamma.app/theme_images/default-light/defaultlight-3_fc5293f8.jpg"},originalSource:"image.custom",source:"accent.theme",type:a.h.IMAGE},{accentId:"a9cd724c",image:{meta:{height:4096,width:4096},name:"defaultlight-4_a9cd724c.jpg",source:"image.custom",src:"https://cdn.gamma.app/theme_images/default-light/defaultlight-4_a9cd724c.jpg"},originalSource:"image.custom",source:"accent.theme",type:a.h.IMAGE},{accentId:"a0c27514",image:{meta:{height:4096,width:4096},name:"defaultlight-6_a0c27514.jpg",source:"image.custom",src:"https://cdn.gamma.app/theme_images/default-light/defaultlight-6_a0c27514.jpg"},originalSource:"image.custom",source:"accent.theme",type:a.h.IMAGE},{accentId:"b5d93885",image:{meta:{height:4096,width:4096},name:"defaultlight-8_b5d93885.jpg",source:"image.custom",src:"https://cdn.gamma.app/theme_images/default-light/defaultlight-8_b5d93885.jpg"},originalSource:"image.custom",source:"accent.theme",type:a.h.IMAGE},{accentId:"2b633020",image:{meta:{height:4096,width:4096},name:"defaultlight-10_2b633020.jpg",source:"image.custom",src:"https://cdn.gamma.app/theme_images/default-light/defaultlight-10_2b633020.jpg"},originalSource:"image.custom",source:"accent.theme",type:a.h.IMAGE},{accentId:"622798c1",image:{meta:{height:4096,width:4096},name:"defaultlight-11_622798c1.jpg",source:"image.custom",src:"https://cdn.gamma.app/theme_images/default-light/defaultlight-11_622798c1.jpg"},originalSource:"image.custom",source:"accent.theme",type:a.h.IMAGE},{accentId:"99644b26",image:{meta:{height:4096,width:4096},name:"defaultlight-12_99644b26.jpg",source:"image.custom",src:"https://cdn.gamma.app/theme_images/default-light/defaultlight-12_99644b26.jpg"},originalSource:"image.custom",source:"accent.theme",type:a.h.IMAGE},{accentId:"ff65bca8",image:{meta:{height:4096,width:4096},name:"defaultlight-13_ff65bca8.jpg",source:"image.custom",src:"https://cdn.gamma.app/theme_images/default-light/defaultlight-13_ff65bca8.jpg"},originalSource:"image.custom",source:"accent.theme",type:a.h.IMAGE},{accentId:"9cbf8fa2",image:{meta:{height:4096,width:4096},name:"defaultlight-16_9cbf8fa2.jpg",source:"image.custom",src:"https://cdn.gamma.app/theme_images/default-light/defaultlight-16_9cbf8fa2.jpg"},originalSource:"image.custom",source:"accent.theme",type:a.h.IMAGE},{accentId:"50147d7c",image:{meta:{height:4096,width:4096},name:"defaultlight-17_50147d7c.jpg",source:"image.custom",src:"https://cdn.gamma.app/theme_images/default-light/defaultlight-17_50147d7c.jpg"},originalSource:"image.custom",source:"accent.theme",type:a.h.IMAGE},{accentId:"3f7406eb",image:{meta:{height:4096,width:4096},name:"defaultlight-18_3f7406eb.jpg",source:"image.custom",src:"https://cdn.gamma.app/theme_images/default-light/defaultlight-18_3f7406eb.jpg"},originalSource:"image.custom",source:"accent.theme",type:a.h.IMAGE}],background:{color:{hex:"#f6f4f4"},type:a.h.COLOR},container:{effect:a.t.SOLID,isDark:!1},contentStyles:{".block-heading [level], .block-title .title":{letterSpacing:"-.03em"},letterSpacing:"-.02em",lineHeight:1.8}},createdTime:"2022-01-01T23:49:27.389Z",id:"default-light",name:"Default (light)",priority:1e3,updatedTime:"2022-06-09T10:38:15.943Z"}},26813:(e,t,l)=>{"use strict";l.d(t,{h:()=>n,t:()=>a});var a=function(e){return e.SOLID="solid",e.FROSTED="frosted",e.FADED="faded",e.CLEAR="clear",e.COLLAPSED="collapsed",e}({}),n=function(e){return e.ANIMATION="animation",e.IMAGE="image",e.COLOR="color",e.GRADIENT="gradient",e.NONE="none",e}({})},14e3:(e,t,l)=>{"use strict";l.d(t,{w:()=>a});var a=function(e){return e.DOC_VIEW="DOC_VIEW",e.SLIDE_VIEW="SLIDE_VIEW",e.DOC_PREVIEW="DOC_PREVIEW",e}({})},95580:(e,t,l)=>{"use strict";l.d(t,{Au:()=>O,Be:()=>V,Bi:()=>R,Cf:()=>j,Cm:()=>C,F2:()=>N,Ft:()=>S,GY:()=>W,IV:()=>A,MY:()=>w,NR:()=>y,Ng:()=>T,Op:()=>p,R3:()=>H,Sn:()=>U,TK:()=>x,We:()=>B,Ww:()=>I,XL:()=>k,aq:()=>_,g4:()=>q,iA:()=>P,jB:()=>h,ls:()=>v,mf:()=>g,nC:()=>L,pO:()=>E,q0:()=>D,r$:()=>F,tb:()=>z,vC:()=>G,zi:()=>M});var a=l(13236),n=l(73758),o=l.n(n),i=l(11329),r=l(65084),s=l(98371),d=l(77214),u=l(92405),c=l(30138),m=l(18733),f=l(80245);let p=e=>{let t=e.type.isBlock&&0===e.childCount&&!e.isAtom,l=e.isTextblock&&0===e.content.size;return t||l},g=e=>p(e)||1==e.childCount&&g(e.child(0)),h=(e,t)=>{if(e.isDestroyed)return;let l=e.view.state.doc.nodeAt(t),a=e.view.nodeDOM(t),n=e.view.domAtPos(t);if(!a&&!n)return;let o=(null==l?void 0:l.type.name)==="card"&&a,i=l&&l.nodeSize>1&&n?n.node:a,r=o||i||(null==n?void 0:n.node)||a;return r instanceof Element?r:r.parentElement},b=(e,t)=>{if(!t)return null;let l=e.view.nodeDOM(t.inside);if(l)return{node:l,pos:t.inside};let a=e.view.domAtPos(t.pos).node;return a?{node:a,pos:t.pos}:null},y=(e,t)=>{let l=e.view.nodeDOM(t);return((null==l?void 0:l.nodeType)===window.Node.TEXT_NODE?l.parentElement:l)||void 0},v=function(e,t){let l,a,n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=document.querySelector(t);if(!r)return{};let s=r.getBoundingClientRect();for(let t of[2,2.5,3,3.5,4,5,6,7,8]){let r=i+(s.width-i)/t,d=s.top+o;if(!(l=e.view.posAtCoords({left:r,top:d})))continue;let u=b(e,l);if(a=null==u?void 0:u.node,n=null==u?void 0:u.pos,a)break}return{node:a,pos:l,posForNode:n}},k=e=>{let t,l,{editor:a,side:n="top",margin:o=100}=e,i=(0,r.H1)("editor");for(let e=1;et)&&(l=u.node,t=o))}return{pos:t,node:l}},w=function(e){let t,l,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=(0,r.H1)("editor");for(let i=a;i>a/2;i-=10){let a=v(e,o.scrollSelector,i,n);a.posForNode&&(!t||a.posForNode>t)&&(t=a.posForNode,l=a.node)}if(!t){console.warn("[getTopCenterPosPct] No result for getTopCenterIshNode");return}let i=(0,s.Oc)(l);if(!i||!t)return;(0,s.BX)({element:i,color:"#32ff61",requiredCookie:"spotlightScrollDebug=true"});let d=i.getBoundingClientRect(),u=parseFloat(((a-d.y)/d.height).toFixed(2));return console.debug("[getTopCenterPosPct].",JSON.stringify({pct:u,pos:t}),l),{pos:t,pct:u}},x=(e,t)=>{let l=[];for(let a=e.depth;a>0;a--){let n=e.node(a),o=e.posAtIndex(0,a-1);t(n,e.doc.resolve(o).parent)&&l.push({pos:a>0?e.before(a):0,start:e.start(a),depth:a,node:n})}return l},S=(e,t)=>{for(let l=e.depth;l>0;l--){let a=e.node(l);if(t(a,l))return{pos:l>0?e.before(l):0,start:e.start(l),depth:l,node:a}}},A=(e,t)=>{let l=e.nodeAfter,a=e.parent;return(l&&t(l,a)?[{node:l,pos:e.pos}]:[]).concat(x(e,t))},C=(e,t,l,a)=>{let n=!1;return l>=t&&e.nodesBetween(t,l,e=>(a.isInSet(e.marks)&&(n=!0),!n)),n},z=e=>({parseHTML:t=>{let l=t.getAttribute("data-".concat(e));if(l)return JSON.parse(l)},renderHTML:t=>{let l=t[e];return l?{["data-".concat(e)]:JSON.stringify(l)}:{}}}),I=e=>{if(!e.length||!(0,d.Se)(e))return null;try{var t;let l=new URL(e).hash;return(null==l?void 0:null===(t=l.split(u.Px))||void 0===t?void 0:t[1])||null}catch(e){return null}},j=(e,t)=>{let l=I(e);return!!l&&t.includes(l)},F=(e,t,l,a,n,o)=>{let i="",r=!0;return e.nodesBetween(t,l,(e,s)=>{if(!a(e))return!1;e.isText&&e.text?(i+=e.text.slice(Math.max(t,s)-s,l-s),r=!n):e.isLeaf&&o?(i+=o,r=!n):!r&&e.isBlock&&(i+=n,r=!0)},0),i},B=e=>{var t;return e.view.hasFocus()||!!(null===(t=document.activeElement)||void 0===t?void 0:t.closest("[data-in-editor-focus]"))},R=(e,t)=>{let{selection:l,schema:a}=e.state,{$from:n}=l,o=n.blockRange(l.$to),i=a.nodes[t];if(!o)return!1;let r=n.parent.canReplaceWith(n.index(),n.index(),i);return o.parent.canReplaceWith(o.endIndex,o.endIndex,i)||r},_=(e,t)=>{let{selection:l,schema:a}=e.state,{$from:n}=l,o=n.blockRange(l.$to),i=a.nodes[t];return!!o&&o.parent.canReplaceWith(o.startIndex,o.endIndex,i)},M=(e,t)=>{let{$from:l}=e.state.selection,a=(0,m.FF)(t);return _(e,"body"===a?"paragraph":a)||(0,c.Ud)(l.parent).includes(t)},E=(e,t)=>{let{selection:l,schema:a}=e.state,{$from:n}=l,o=n.blockRange(l.$to),r=a.nodes[t];return!!o&&!!(0,i.oM)(o,r)},T=(e,t)=>{let{selection:l,doc:n}=e.state,{from:o,to:i}=l;return(0,a.Nx)(n,{from:o,to:i},t).length>0},O=(e,t)=>T(e,l=>l.type.allowsMarkType(e.schema.marks[t])),P=(e,t)=>T(e,e=>{var l;return!!(null===(l=e.type.spec.attrs)||void 0===l?void 0:l[t])}),N=e=>o()(e.childCount).map(t=>e.child(t)),D=(e,t)=>{let l=t.nodeDOM(e);return null==l?void 0:l.getBoundingClientRect()},L=e=>!!e&&(0,a.xe)(e,e=>"image"===e.type.name&&!e.attrs.src).length>0,W=(e,t)=>{let l=[];return e.forEach((e,a)=>{t(e)&&l.push({node:e,pos:a})}),l},U=(e,t)=>{e.forEach(e=>{t(e)}),e.forEach(e=>{e.content&&U(e.content,t)})},G=(e,t)=>e.extensionManager.extensions.find(e=>e.name===t.name);function H(e){var t,l;let a=null!==(l=null===(t=e.before.content)||void 0===t?void 0:t.size)&&void 0!==l?l:0,n=e.mapping;for(let t=0;t{let a={...t};for(let t=l;t{a[e]=l.mapping.map(a[e])})}return a},n=e.flatMap((e,t)=>(0,f.A)(e).map(e=>a(e,t+1)));if(!n.length)return null;let{doc:o,tr:i,schema:r}=t,s=new Set;return(n.forEach(e=>{let t=o.slice(e.newStart,e.newEnd);t.content.descendants((a,n,o)=>{let d=n+e.newStart-t.openStart;s.has(d)||(l({node:a,pos:d,tr:i,schema:r,parent:o}),s.add(d))})}),i.setMeta("processTransactions",!0),i.docChanged)?i:null}},40201:(e,t,l)=>{"use strict";l.d(t,{Lo:()=>i,V6:()=>r});var a=l(13236),n=l(37068);let o=new Set(["bullet","numbered","todo","title","heading","paragraph","image","blockquote","embed","video"]),i=(e,t)=>{if(o.has(e.type.name)){let l={type:"card",content:[e.toJSON()]},o=(0,n.C)().map(e=>(null==t?void 0:t.includes(e.name))?e instanceof a.CU?e.extend({renderHTML:()=>["span",0]}):e.extend({renderHTML:()=>""}):e);return(0,a.Zx)(l||{},o)}return""},r=(e,t)=>{if(o.has(e.type.name)){let l={type:"card",content:[e.toJSON()]},o=(0,n.C)().map(e=>(null==t?void 0:t.includes(e.name))?(a.CU,e.extend({renderText:()=>""})):e);return(0,a.Df)(l||{},o)}return""}},18924:(e,t,l)=>{"use strict";l.d(t,{b:()=>r});var a=l(81570),n=l(64130),o=l(44507),i=l(17119);let r=(e,t,l,o)=>{let{view:r,state:d}=e;if(!t.dataTransfer||!o&&!(o=e.view.domAtPos(l).node))return;let{previewElement:u,xOffset:c,yOffset:m}=s(o,l,e);t.dataTransfer.clearData(),t.dataTransfer.effectAllowed="move",t.dataTransfer.setData("text/html",o.innerHTML),t.dataTransfer.setData("text/plain",o.textContent||"");let{width:f}=u.getBoundingClientRect(),p=(0,n.ix)()?f-c:c;t.dataTransfer.setDragImage(u,p,m);let g=a.nh.create(d.doc,l),h=g.content();r.dispatch(r.state.tr.setSelection(g)),r.dragging={slice:h,move:!0};let b=(0,i.Vo)({pos:l,editor:e,from:g.from,to:g.to});b&&requestAnimationFrame(()=>{var e;null!==(e=r.dragging)&&void 0!==e&&e.annotations||null===r.dragging||"object"!=typeof r.dragging||(r.dragging.annotations=b)})},s=(e,t,l)=>{let a=(()=>{let a=e.querySelector("[data-drag-preview]");return a&&l.view.posAtDOM(a,0)===t?a:e})(),{contentReference:n,scalePreview:i}=a.dataset,r=0,s=0;if((0,o.H8)()&&n){let[e,t]=n.split(",").map(parseFloat);isNaN(e)||isNaN(t)||(r=e,s=t)}if(d(),i){var u;let e=null!==(u=a.parentElement)&&void 0!==u?u:document.body;(a=a.cloneNode(!0)).dataset.isPreviewElement="1",a.style.position="absolute",a.style.bottom="-100vh",a.style.left="-100vw",e.appendChild(a);let{width:t,height:l}=a.getBoundingClientRect();(t>l?t:l)>250&&(a.style.maxWidth="".concat(250,"px"),a.style.maxHeight="".concat(250,"px"),a.style.aspectRatio="".concat(t,"/").concat(l)),document.addEventListener("drop",d,{once:!0}),document.addEventListener("dragend",d,{once:!0}),document.addEventListener("mouseup",d,{once:!0})}return{previewElement:a,xOffset:r,yOffset:s}},d=()=>{for(let t of document.querySelectorAll("[data-is-preview-element]")){var e;null===(e=t.parentNode)||void 0===e||e.removeChild(t)}}},22574:(e,t,l)=>{"use strict";l.d(t,{I:()=>a});let a=e=>{var t;let{mutation:l}=e;return!!("attributes"===l.type&&(null===(t=l.attributeName)||void 0===t?void 0:t.startsWith("data-")))}},98380:(e,t,l)=>{"use strict";l.d(t,{JJ:()=>s,fI:()=>u,tC:()=>r,wN:()=>d});var a=l(13236),n=l(81570),o=l(10458),i=l(438);let r=(e,t)=>{let l=s(e);return new a.fV({find:e.find,handler:a=>{let{state:r,range:s}=a,d=new n.U3(r.doc.resolve(s.from),r.doc.resolve(s.to));if((0,i.tt)(t)(d))return null;let u=l.handler(a);return null!==u&&o.zS.track(o.VV.NODE_INSERTED,{method:o.oU.INPUT_RULE,node_name:e.type.name}),u}})};function s(e){return new a.fV({find:e.find,handler:t=>{let{state:l,range:n,match:o}=t,i=l.doc.resolve(n.from),r=(0,a.gk)(e.getAttributes,void 0,o)||{},s={...i.parent.attrs,...r};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return;let{tr:d}=l;d.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,s)}})}function d(e){return new a.fV({find:e.find,handler:t=>{let{state:l,range:n,match:o}=t,i=(0,a.gk)(e.getAttributes,void 0,o)||{},{tr:r}=l,s=n.from,d=n.to,u=l.doc.resolve(s).before();r.replaceWith(u,d,e.type.create(i))}})}function u(e){return new a.fV({find:e.find,handler:t=>{let{state:l,range:n}=t,o=l.doc.resolve(n.from),i=(0,a.gk)(e.getAttributes,void 0,o.parent);if(!i)return;let r=l.tr.delete(n.from,n.to);Object.entries(i).forEach(e=>{let[t,l]=e;r.setNodeAttribute(n.from-1,t,l)})}})}},19534:(e,t,l)=>{"use strict";l.d(t,{CD:()=>n,j5:()=>o,jg:()=>a.jg});var a=l(77646);let n=e=>{var t;let l=(null===(t=e.type.spec.group)||void 0===t?void 0:t.split(" "))||[];return l.includes("block")||l.includes("cardBlock")},o=(e,t)=>{let l=[];try{var a;l=(null===(a=e.view.docView.descAt(t))||void 0===a?void 0:a.outerDeco)||[]}catch(e){console.error("[getDecorationsForNode] unable to find decorations at pos ".concat(t),e.message)}return l}},96712:(e,t,l)=>{"use strict";l.d(t,{JO:()=>o,d_:()=>i});var a=l(3583),n=l(6998);let o=(e,t)=>{let l=a.pJ.getState(e);if(!l)return null;let{type:o,binding:i}=l;return l.binding?(0,n.Bw)(t,o,i.mapping):null},i=(e,t)=>{let l=a.pJ.getState(e);if(!l)return null;let{doc:o,type:i,binding:r}=l;return l.binding?(0,n.bL)(o,i,t,r.mapping):null}},45864:(e,t,l)=>{"use strict";l.d(t,{J:()=>r});var a=l(69e3),n=l(81570),o=l(20277),i=l(68566);class r extends n.LN{map(e,t){let{deleted:l,pos:a}=t.mapResult(this.anchor),o=e.resolve(a);return l?(0,i.n)(o)||n.LN.near(o):new r(o,this.side)}content(){return new a.Ji(a.FK.from(this.node),0,0)}eq(e){return e instanceof r&&e.anchor===this.anchor&&e.side===this.side}toJSON(){return{type:"presentation",anchor:this.anchor,side:this.side}}createSelectionNear(){let e=this.side<1?1:-1;return(0,o.s)(this.$from,e)||n.LN.near(this.$from)}static fromJSON(e,t){if("number"!=typeof t.anchor)throw RangeError("Invalid input for PresentationSelection.fromJSON");return new r(e.resolve(t.anchor))}static create(e,t,l){return new r(e.resolve(t),l)}static isSelectable(e){return!e.isText&&!1!==e.type.spec.selectable}constructor(e,t=0){let l=e.nodeAfter;super(e,e.node(0).resolve(e.pos+l.nodeSize)),this.node=l,this.side=t}}if(r.prototype.visible=!1,!r.prototype.jsonID)try{n.LN.jsonID("presentation",r)}catch(e){}},20277:(e,t,l)=>{"use strict";l.d(t,{s:()=>function e(t){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,{doc:o}=t,i=l<0;if(!t.nodeAfter)return null;if(t.nodeAfter.inlineContent)return n.LN.near(o.resolve(t.pos+(i?t.nodeAfter.content.size+1:0)),l);let r=(0,a.xe)(t.nodeAfter,e=>e.inlineContent||n.nh.isSelectable(e));if(!r||0===r.length)return n.nh.create(o,t.pos);let s=t.start(t.depth+1)+(i?r[r.length-1].pos:r[0].pos);return e(o.resolve(s),l)},t:()=>i});var a=l(13236),n=l(81570),o=l(11329);let i=(e,t)=>{var l;let a;let n=e.doc,i=e.steps.length-1,r=e.steps[i];if(!r||!(r instanceof o.Ln||r instanceof o.Wg)||0===r.slice.content.size)return null;let s=t||(null===(l=r.slice.content.child(r.slice.openStart))||void 0===l?void 0:l.type.name);if(e.mapping.maps[i].forEach((e,t,l)=>{null==a&&(a=l)}),null==a)return null;let d=n.nodeAt(a);if(d&&d.type.name===s)return n.resolve(a);if(!s)return console.warn("[getInsertedNodePos] Error selecting node, type not found in slice.lastChild",a),null;for(let t=r.from;t{"use strict";l.d(t,{i:()=>c,n:()=>u});var a=l(14139),n=l(81570),o=l(11329);let i=(e,t,l)=>t&&n.nh.isSelectable(t)?n.nh.create(e,l):null,r=(e,t,l)=>t&&t.inlineContent?n.U3.create(e,l):null;function s(e,t,l){return e&&l?l:e&&t?t:!e&&t?t:!e&&l?l:null}function d(e,t){let{doc:l,pos:o,parent:d,nodeAfter:u,nodeBefore:c}=e;if(d.inlineContent)return n.U3.create(l,o);let m=t>0,f=s(m,r(l,c,o-1),r(l,u,o+1));if(f)return f;if(a.n.valid(e))return new a.n(e);if(d.type.spec.isolating){let t=s(m,i(l,c,o-((null==c?void 0:c.nodeSize)||0)),i(l,u,o));if(t)return t;if(0===d.childCount&&n.nh.isSelectable(d))return n.nh.create(l,e.before())}return null}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,l=d(e,t);if(l)return l;for(let l=e.depth-1;l>=0&&!e.node(l+1).type.spec.isolating;l--){let a=t<0?e.before(l+1):e.after(l+1),n=d(e.doc.resolve(a),t);if(n)return n}return null}let c=(e,t)=>{let l;let a=e.steps.length-1,n=e.steps[a];return n instanceof o.Ln||n instanceof o.Wg?(e.mapping.maps[a].forEach((e,t,a,n)=>{null==l&&(l=n)}),null==l)?null:u(e.doc.resolve(l),t):null}},387:(e,t,l)=>{"use strict";l.d(t,{he:()=>o,kz:()=>i});var a=l(3583);let n=e=>{let t=e.getMeta(a.pJ);return(null==t?void 0:t.isChangeOrigin)===!0},o=e=>n(e)&&!r(e),i=e=>!o(e),r=e=>{var t;return null===(t=e.getMeta(a.pJ))||void 0===t?void 0:t.isUndoRedoOperation}},38678:(e,t,l)=>{"use strict";l.d(t,{o:()=>o});var a=l(83479),n=l(92405);let o=e=>{let{cardId:t,method:l="replace",data:o={},emitChange:i=!0}=e,r="#".concat(n.Px).concat(t);if(void 0!==t){if(null===t){(0,a.g5)({hash:"",data:o,emitChange:i});return}"push"===l?(0,a.c8)({hash:r,data:o,emitChange:i}):(0,a.g5)({hash:r,data:o,emitChange:i})}}},56632:(e,t,l)=>{"use strict";l.d(t,{UG:()=>em,lN:()=>eh});var a=l(45363),n=l(31085),o=l(25420),i=l(7499),r=l(15428),s=l(14041),d=l(60490),u=l(62313),c=l(19098),m=l(64444),f=l(93185),p=l(74727),g=l(12917),h=l(12327);let b=s.createContext({});function y(){return s.useContext(b)}var v=l(80532),k=l(9021),w=l(2600),x=l(22218),S=l(15672),A=l(80853),C=l(52177);let z={src:"https://assets.gammahosted.com/ilbt6qz6f/_next/static/media/transparent-background.ccc186e7.png"},I={[a.JM.White]:"#f0f1f3",[a.JM.Gray]:"#788492",[a.JM.Green]:"#36b24d",[a.JM.Blue]:"#1c7ed6",[a.JM.Violet]:"#7746f1",[a.JM.Red]:"#ff2133",[a.JM.Orange]:"#ff9433",[a.JM.Yellow]:"#ffc936"},j=e=>e.appState.currentStyle,F=e=>e.document.pageStates[e.appState.currentPageId].selectedIds,B=e=>e.settings.isDarkMode?"dark":"light",R=e=>{let{style:t,colorMode:l}=e;return(0,n.jsx)(v.az,{backgroundColor:t.isFilled?a.gA.fills[l][t.color]:void 0,backgroundImage:t.isFilled?void 0:z.src,backgroundSize:"4em",borderColor:a.gA.strokes[l][t.color],borderWidth:"2px",h:"1em",w:"1em",borderRadius:"md"})},_=Object.keys(a.gA.defaultTextStyle),M=(e,t)=>{let{page:l}=e,a={};if(t.length<=0)return{};{let e=new Set([]);t.map(e=>l.shapes[e]).forEach(t=>{_.forEach(l=>{if(!e.has(l)){if(void 0===a[l])a[l]=t.style[l];else{if(a[l]===t.style[l])return;e.add(l)}}})}),e.forEach(e=>{delete a[e]})}return a},E=()=>{let e=y(),t=e.useStore(B),l=e.useStore(j),o=e.useStore(F),i=M(e,o),r={...l,...i};return(0,n.jsxs)(c.A,{trigger:"hover",children:[(0,n.jsx)(m.W,{children:(0,n.jsx)(k.K,{icon:(0,n.jsx)(R,{style:r,colorMode:t}),variant:"ghost",size:"sm","aria-label":""})}),(0,n.jsx)(f.h,{w:"fit-content",bg:"#F9FAFBFA",p:4,children:(0,n.jsxs)(w.T,{spacing:2,align:"flex-start",children:[(0,n.jsx)(x.l,{children:(0,n.jsx)(C.x6,{id:"TuM2Yu"})}),(0,n.jsx)(S.r,{columns:2,spacing:2,children:[!0,!1].map(l=>(0,n.jsx)(A.$,{leftIcon:(0,n.jsx)(R,{style:{...r,isFilled:l},colorMode:t}),variant:"ghost",size:"sm",isActive:r.isFilled===l,onClick:()=>e.style({isFilled:l}),children:l?(0,n.jsx)(C.x6,{id:"5bi1la"}):(0,n.jsx)(C.x6,{id:"dD7NPy"})},l?"fill":"outline"))}),(0,n.jsx)(x.l,{children:(0,n.jsx)(C.x6,{id:"1HfW/F"})}),(0,n.jsx)(S.r,{columns:4,spacing:2,w:"100%",children:Object.entries(a.JM).map(l=>{let[a,o]=l;return I[o]?(0,n.jsx)(k.K,{icon:(0,n.jsx)(R,{style:{...r,color:o},colorMode:t}),variant:"ghost",size:"md","aria-label":a,isActive:r.color===o,onClick:()=>e.style({color:o})},o):null})})]})})]})};var T=l(63552),O=l(24221),P=l(95986);let N=(0,T.R)((e,t)=>{let{label:l,icon:a,tooltipPlacement:o="top",...i}=e;return(0,n.jsx)(P.Tz,{placement:o,label:l,isDisabled:!l,children:(0,n.jsx)(k.K,{"aria-label":l||"",ref:t,size:"sm",variant:"",icon:(0,n.jsx)(O.g,{icon:a}),color:"trueblue.600",textShadow:"0px 1px 0px rgba(0,0,0,0)",fontWeight:"500",borderRadius:"md",borderWidth:"1px",backdropFilter:"blur(20px)",borderColor:"transparent",_hover:{bg:"gray.100",borderColor:"gray.200"},_focus:{bg:"gray.100",borderColor:"gray.200"},_active:{bg:"trueblue.100",borderColor:"trueblue.200"},...i})})}),D=e=>{let{children:t,...l}=e;return(0,n.jsx)(o.s,{bg:"#F9FAFBDD",p:1,borderWidth:"1px",borderColor:"whiteAlpha.600",borderRadius:"xl",shadow:"xl",...l,children:t})},L={[a.Hu.Start]:g.ecg,[a.Hu.Middle]:g._ur,[a.Hu.End]:g.jbh},W=()=>{let e=y(),t=e.useStore(j),l=e.useStore(F),o=M(e,l),i={...t,...o};return(0,n.jsxs)(c.A,{trigger:"hover",children:[(0,n.jsx)(m.W,{children:(0,n.jsx)(N,{icon:L[i.textAlign||a.Hu.Start]})}),(0,n.jsx)(f.h,{background:"none",shadow:"none",w:"fit-content",children:(0,n.jsx)(D,{direction:"column",children:(0,n.jsxs)(p.e,{children:[(0,n.jsx)(N,{icon:g.ecg,label:h.Ru._({id:"IR6Txi"}),onClick:()=>e.style({textAlign:a.Hu.Start}),isActive:i.textAlign===a.Hu.Start},"align-left"),(0,n.jsx)(N,{icon:g._ur,label:h.Ru._({id:"8nOdkO"}),onClick:()=>e.style({textAlign:a.Hu.Middle}),isActive:i.textAlign===a.Hu.Middle},"align-center"),(0,n.jsx)(N,{icon:g.jbh,label:h.Ru._({id:"pd0UH2"}),onClick:()=>e.style({textAlign:a.Hu.End}),isActive:i.textAlign===a.Hu.End},"align-right"),(0,n.jsx)(N,{icon:g.Tip,label:h.Ru._({id:"18P2qJ"}),onClick:()=>e.style({textAlign:a.Hu.Justify}),isActive:i.textAlign===a.Hu.Justify},"justify")]})})})]})},U=e=>e.document.pageStates[e.appState.currentPageId].selectedIds.some(t=>void 0!==e.document.pages[e.appState.currentPageId].shapes[t].children),G=e=>"idle"===e.appState.status&&e.document.pageStates[e.appState.currentPageId].selectedIds.length>0,H=e=>e.document.pageStates[e.appState.currentPageId].selectedIds.length,V=e=>{let t=e.appState.currentPageId,l=e.document.pages[t];for(let a of e.document.pageStates[t].selectedIds)if("text"in l.shapes[a])return!0;return!1},q=s.memo(function(){let e=y(),{isGammaOrgUser:t}=(0,d.ur)(),l=e.useStore(G),i=e.useStore(U),r=e.useStore(H),s=e.useStore(V);return(0,n.jsx)(o.s,{w:"100%",direction:"row",position:"absolute",bottom:2,align:"flex-end",justify:"center",zIndex:1,children:(0,n.jsx)(D,{children:(0,n.jsxs)(u.z,{spacing:2,children:[t&&(0,n.jsx)(N,{icon:g.XYS,label:h.Ru._({id:"SpTWH3"}),onClick:()=>e.exportImage(a.Xi.SVG,{scale:1,quality:1})},"download"),l&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(N,{icon:g.yLS,label:h.Ru._({id:"/Wgayn"}),onClick:()=>e.delete(),"data-testid":"drawing-edit-toolbar-delete"},"delete"),(0,n.jsx)(K,{}),r>=2&&(0,n.jsx)(J,{}),r>=2||i?(0,n.jsx)(N,{icon:g.cWs,label:i?"Ungroup selection":"Group selection",onClick:()=>i?e.ungroup():e.group(),isActive:i},"group"):null]}),(0,n.jsx)(E,{}),s&&(0,n.jsx)(W,{})]})})})}),K=()=>{let e=y();return(0,n.jsxs)(c.A,{trigger:"hover",children:[(0,n.jsx)(m.W,{children:(0,n.jsx)(N,{icon:g.B4x})}),(0,n.jsx)(f.h,{background:"none",shadow:"none",w:"fit-content",children:(0,n.jsxs)(D,{direction:"row",children:[(0,n.jsx)(N,{icon:g.bKR,label:h.Ru._({id:"J6qWQV"}),onClick:()=>e.moveToFront()},"front"),(0,n.jsx)(N,{icon:g.B4x,label:h.Ru._({id:"9xFjqz"}),onClick:()=>e.moveForward()},"forward"),(0,n.jsx)(N,{icon:g.PW6,label:h.Ru._({id:"OfSb1W"}),onClick:()=>e.moveBackward()},"backward"),(0,n.jsx)(N,{icon:g.jb9,label:h.Ru._({id:"/zBSYY"}),onClick:()=>e.moveToBack()},"back")]})})]})},J=()=>{let e=y();return(0,n.jsxs)(c.A,{trigger:"hover",children:[(0,n.jsx)(m.W,{children:(0,n.jsx)(N,{icon:g.gD3})}),(0,n.jsx)(f.h,{background:"none",shadow:"none",w:"fit-content",children:(0,n.jsxs)(D,{direction:"column",children:[(0,n.jsxs)(p.e,{children:[(0,n.jsx)(N,{icon:g.gD3,label:h.Ru._({id:"IR6Txi"}),onClick:()=>e.align(a.qx.Left)},"align-left"),(0,n.jsx)(N,{icon:g.im,label:h.Ru._({id:"8nOdkO"}),onClick:()=>e.align(a.qx.CenterHorizontal)},"align-center"),(0,n.jsx)(N,{icon:g.j7A,label:h.Ru._({id:"pd0UH2"}),onClick:()=>e.align(a.qx.Right)},"align-right"),(0,n.jsx)(N,{icon:g.yC$,label:h.Ru._({id:"8lqfXb"}),onClick:()=>e.distribute(a.Od.Horizontal)},"distribute-h")]}),(0,n.jsxs)(p.e,{children:[(0,n.jsx)(N,{icon:g.MVg,label:h.Ru._({id:"/Q0jUh"}),onClick:()=>e.align(a.qx.Top)},"align-top"),(0,n.jsx)(N,{icon:g.cse,label:h.Ru._({id:"QhuQN2"}),onClick:()=>e.align(a.qx.CenterVertical)},"align-middle"),(0,n.jsx)(N,{icon:g.QaE,label:h.Ru._({id:"EPnxoe"}),onClick:()=>e.align(a.qx.Bottom)},"align-bottom"),(0,n.jsx)(N,{icon:g.iHb,label:h.Ru._({id:"a1NrWf"}),onClick:()=>e.distribute(a.Od.Vertical)},"distribute-v")]})]})})]})};var $=l(70323),Q=l(3040);let Y=()=>[{icon:Q.eX_,label:h.Ru._({id:"rG3WVm"}),tool:"select"},{icon:g.IP$,label:h.Ru._({id:"Ajc4TJ"}),tool:"erase"},{icon:Q.adM,label:h.Ru._({id:"rjuFFw"}),tool:a.gs.Line},{icon:Q.U6Q,label:h.Ru._({id:"zFkhx3"}),tool:a.gs.Arrow},{icon:Q.vti,label:h.Ru._({id:"30KLDI"}),tool:a.gs.Rectangle},{icon:Q.GEE,label:h.Ru._({id:"7xMmki"}),tool:a.gs.Ellipse},{icon:Q.CKr,label:h.Ru._({id:"ucHvJP"}),tool:a.gs.Triangle},{icon:Q.jwR,label:h.Ru._({id:"xeiujy"}),tool:a.gs.Text}],X=e=>e.appState.activeTool,Z=s.memo(function(){let e=y(),t=e.useStore(X);return(0,n.jsx)(o.s,{h:"100%",direction:"column",position:"absolute",right:2,align:"flex-end",justify:"center",zIndex:1,children:(0,n.jsx)(D,{children:(0,n.jsx)(w.T,{spacing:2,children:Y().map(l=>{let{label:a,icon:o,tool:i}=l;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(N,{icon:o,label:a,onClick:()=>e.selectTool(i),isActive:t===i,tooltipPlacement:"left","data-testid":"drawing-insert-toolbar-".concat(i)},a),"select"==i&&(0,n.jsx)($.c,{},"selectDivider")]})})})})})});var ee=l(63341),et=l(18528),el=l(72821),ea=l(33683);let en=e=>e.document.pageStates[e.appState.currentPageId].camera.zoom,eo=e=>e.settings.showGrid,ei=s.memo(function(){let e=y(),t=e.useStore(eo);return(0,n.jsx)(o.s,{position:"absolute",top:2,left:2,zIndex:1,children:(0,n.jsx)(D,{children:(0,n.jsxs)(u.z,{spacing:2,children:[(0,n.jsx)(er,{}),(0,n.jsx)(N,{icon:Q.XgR,label:t?h.Ru._({id:"IsBZFj"}):h.Ru._({id:"mWgfWA"}),isActive:t,onClick:()=>e.setSetting("showGrid",!t)},"grid")]})})})}),er=s.memo(function(){let e=y(),t=e.useStore(en);return(0,n.jsxs)(ee.W,{children:[(0,n.jsxs)(et.I,{as:A.$,"data-test-id":"zoom-menu-button",size:"sm",colorScheme:"trueblue",variant:"ghost",leftIcon:(0,n.jsx)(O.g,{icon:g.$UM}),children:[Math.round(100*t),"%"]}),(0,n.jsxs)(el.c,{children:[(0,n.jsx)(ea.D,{command:"#+",onClick:e.zoomIn,children:(0,n.jsx)(C.x6,{id:"AWOSPo"})}),(0,n.jsx)(ea.D,{command:"#-",onClick:e.zoomOut,children:(0,n.jsx)(C.x6,{id:"FjkaiT"})}),(0,n.jsx)(ea.D,{command:"⇧0",onClick:e.resetZoom,children:(0,n.jsx)(C.x6,{id:"41NrIs"})}),(0,n.jsx)(ea.D,{command:"⇧1",onClick:e.zoomToFit,"data-test-id":"zoom-to-fit-button",children:(0,n.jsx)(C.x6,{id:"pLI1Is"})})]})]})});var es=l(74327);let ed=e=>({onAssetCreate:(0,s.useCallback)(async(t,l,n)=>{if(!e)return console.warn("[useAssetUpload] OrgId is required to upload assets"),!1;let o=URL.createObjectURL(l);console.debug("[useAssetUpload] Handling upload for file",{file:l,id:n,tempUrl:o});let i=e=>{let l=t.assets.find(e=>e.id===n);if(l){console.debug("[useAssetUpload] Upload complete. Replacing temp asset",{id:n,src:e.src});let a={document:{assets:{[n]:{...l,src:e.src}}}};t.patchState(a,"upload"),t.persist(a,"upload")}};return(0,es.QM)(l,e,{onOriginalFileUpload:i,onUploadComplete:i}),t.patchState({document:{assets:{[n]:{id:n,type:a.zO.Image,fileName:l.name,src:o}}}}),o},[e]),onAssetDelete:(0,s.useCallback)(async(e,t)=>!0,[])});var eu=l(45905);let ec={dash:a.c.Solid,isFilled:!0,color:a.JM.White},em=e=>{let{isDark:t,font:l,...u}=e,{currentWorkspace:c}=(0,d.ur)(),[m,f]=(0,s.useState)(),[p,g]=(0,s.useState)(!1),h=(0,s.useCallback)(e=>{f(e),e.style(ec,[]),g(!0)},[]),{onAssetCreate:y,onAssetDelete:v}=ed(null==c?void 0:c.id);(0,s.useEffect)(()=>{m&&void 0!==t&&m.setSetting("isDarkMode",t)},[m,t]);let k=(0,s.useMemo)(()=>(0,eu.k)(t),[t]),w=(0,s.useMemo)(()=>(0,eu.I)(l),[l]);return(0,n.jsxs)(o.s,{sx:{".tl-canvas":{"div, text, textarea":{...w},...k,'g[cursor="grab"][aria-label="link handle"]':{display:"none"}}},onDrop:()=>{},onPaste:()=>{},position:"relative",h:"100%",w:"100%",className:"highlight-mask",children:[(0,n.jsx)(r.mL,{styles:{"#__textLabelMeasure, #__textMeasure":{...w}}}),(0,n.jsxs)(b.Provider,{value:m||{},children:[(0,n.jsx)(a.Z1,{onAssetCreate:y,onAssetDelete:v,...u,onMount:(0,i.Hj)(u.onMount,h)}),p&&!u.readOnly&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(q,{}),(0,n.jsx)(Z,{})]}),p&&(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(ei,{})})]})]})};var ef=l(9370),ep=l(99474);let eg=e=>ef.Aq.getCommonBounds(e.map(a.ju.getRotatedBounds)),eh=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:128,{shapes:l,pageState:{camera:n},rendererBounds:o}=e;if(0===l.length)return;let i=eg(l);if(!i)return;let r=a.ju.getCameraZoom(Math.min((o.width-t)/i.width,(o.height-t)/i.height)),s=(o.width-i.width*r)/2/r,d=(o.height-i.height*r)/2/r;e.setCamera(ep.l.toFixed(ep.l.sub([s,d],[i.minX,i.minY])),r,"zoomed_to_fit")}},45905:(e,t,l)=>{"use strict";l.d(t,{I:()=>o,k:()=>i});var a=l(45363);let n=e=>"".concat(e," !important"),o=e=>({fontFamily:n(e)}),i=e=>{let t={"[data-shape=image]":{".tl-inner-div":{}},img:{'&[src^="blob:"]':{animation:"loading-pulse-animation 1.5s infinite"}}},l=Object.values(a.JM),o=e?"dark":"light";return l.forEach(e=>{t['[data-color="'.concat(e,'"]')]={color:n(a.gA.strokes[o][e]),":not(mask) > [fill], &[fill]":{"&:not([fill=none])":{fill:n(a.gA.fills[o][e]),"text, tspan":{fill:n(a.gA.strokes[o][e])}}},"[stroke]":{"&:not([stroke=none])":{stroke:n(a.gA.strokes[o][e])}}}}),t}},47813:(e,t,l)=>{"use strict";l.d(t,{k:()=>m,x:()=>f});var a=l(63413),n=l(41900),o=l(93765),i=l(63955),r=l(75185),s=l(22544);let d=e=>{var t;return{"div.textbox":{display:"flex",flexDirection:"column",alignItems:"var(--horizontal-align)",justifyContent:"var(--vertical-align)",textAlign:"var(--text-align)","--flex-align":"var(--horizontal-align)",height:"100%",...(0,n.dd)(e),fontSize:"".concat((null!==(t=e.config.fontSize)&&void 0!==t?t:1)*20,"px"),color:"var(--body-color)",".ProseMirror":{padding:"".concat(8,"px"),...u(e)}},foreignObject:{visibility:s.hQ?"hidden":void 0,overflow:"visible","*":{wordWrap:"normal",whiteSpace:"pre-wrap"},"[data-autosize].textbox":{"> .text":{width:"max-content"}},"p.paragraph:empty::after":{content:'" "',whiteSpace:"pre",visibility:"hidden"},".textbox > .text":{padding:"".concat(8,"px"),width:"100%",alignItems:"var(--flex-align)",display:"block",...e.config.contentStyles,...c(e),".themed-heading":{position:"static"}}}}},u=e=>({lineHeight:1.4,letterSpacing:"var(--letter-spacing-body)",".block":{my:"1rem"},"> .first-block":{mt:"0rem"},"> .last-block":{mb:"0rem"},'.heading[level="1"], h1':(0,o.bh)("h1",e),'.heading[level="2"], h2':(0,o.bh)("h2",e),'.heading[level="3"], h3':(0,o.bh)("h3",e),'.heading[level="4"], h4':(0,o.bh)("h4",e),".block-heading":{mt:"1rem",mb:"1rem","&.first-block":{mt:"0rem"},"&.last-block":{mb:"0rem"}},...i.hY.default,...r.Hm.default,...(0,o.tX)(e),"a.link":{color:"var(--text-color, var(--link-color))",cursor:"pointer",fontWeight:"bold",textDecoration:"underline","&:hover":{color:"var(--text-color, var(--link-color))"},"&:active":{color:"var(--text-color, var(--link-color))"}},code:{backgroundColor:"var(--accent-color-background-muted)",color:"var(--body-color)",...i.wd}}),c=e=>({lineHeight:1.4,"> *":{my:"1rem","&:first-child":{mt:"0rem"},"&:last-child":{mb:"0rem"}},h1:(0,o.bh)("h1",e),h2:(0,o.bh)("h2",e),h3:(0,o.bh)("h3",e),h4:(0,o.bh)("h4",e),"h1, h2, h3, h4":{mt:"1rem",mb:"1rem",width:"100% !important"}}),m=e=>({"[data-shape=image]":{".tl-inner-div":{}},img:{'&[src^="blob:"]':{animation:"loading-pulse-animation 1.5s infinite"}},...{text:{fill:"var(--body-color)"},"[data-shape-type=geo]":{path:{...a.Re,fill:"var(--shape-bg-color-override, var(--shape-bg-image-svg) var(--shape-bg-color))",vectorEffect:"none",strokeWidth:"var(--stroke-width)"},"&.tl-shape-background":{strokeWidth:0},".textbox":{padding:"12px"}},"[data-shape-type=arrow]":{"g, path":{stroke:"var(--shape-border-color-override, var(--shape-border-color))",strokeWidth:"var(--stroke-width)"},".tl-arrow-label":{color:"var(--shape-border-color-override, var(--body-color)) !important"},text:{fill:"var(--shape-border-color-override, var(--body-color))"}},"[data-shape-type=line]":{path:{stroke:"var(--shape-border-color-override, var(--shape-border-color))",strokeWidth:"var(--stroke-width)"}},"[data-shape-type=image]":{"[data-image-upload-status]":{".tl-image-container":{backgroundImage:"var(--temp-url)",objectFit:"cover",backgroundSize:"cover"}}},...d(e)}}),f=(e,t)=>(t&&"none"===e&&(e="sm"),({none:0,sm:2,md:4,lg:6})[e])},35015:(e,t,l)=>{"use strict";l.d(t,{gk:()=>r,dC:()=>o,EC:()=>s});var a=l(14041);let n=a.useLayoutEffect,o=()=>{let e=(0,a.useRef)(null);return n(()=>{let t=document.createElement("div");return t.className="gamma-tooltip-portal",document.body.appendChild(t),e.current=t,()=>{document.body.contains(t)&&document.body.removeChild(t),e.current=null}},[]),e},i=(0,a.createContext)(null),r=i.Provider,s=()=>(0,a.useContext)(i)},72785:(e,t,l)=>{"use strict";new(l(36832)).b},49277:(e,t,l)=>{"use strict";l.d(t,{CX:()=>c,IM:()=>d,Iy:()=>u,lO:()=>r});var a=l(30796),n=l(98092),o=l(14041),i=l(60204);let r=new n.AbilityFactory,s=(0,o.createContext)(r.createForUser());function d(){return(0,a.IM)(s)}function u(e,t){let l=(0,a.IM)(s);return!!t&&l.can(e,t)}function c(){let{currentWorkspace:e}=(0,i.u)();return u("admin",e)}(0,a.K0)(s.Consumer)},60204:(e,t,l)=>{"use strict";l.d(t,{R:()=>n,u:()=>o});var a=l(14041);let n=a.createContext({});function o(){return(0,a.useContext)(n)}},30358:(e,t,l)=>{"use strict";l.d(t,{CX:()=>o.CX,HW:()=>s,IM:()=>o.IM,Iy:()=>o.Iy,bs:()=>u,gx:()=>r,lO:()=>o.lO,ur:()=>i.u,vp:()=>d});var a=l(88957),n=l(27042),o=l(49277),i=l(60204);let r=()=>{let e=(0,a.KA)().getState();return(0,n.C9)(e)},s=()=>{let e=(0,a.KA)().getState();return(0,n.mB)(e)},d=()=>{let e=(0,a.KA)().getState();return(0,n.XK)(e)},u=e=>{let t=(0,a.KA)().getState();return(0,n.$E)(e)(t)}},47014:(e,t,l)=>{"use strict";l(14041),l(72785)},60490:(e,t,l)=>{"use strict";l.d(t,{lO:()=>a.lO,vp:()=>a.vp,gx:()=>a.gx,bs:()=>a.bs,IM:()=>a.IM,Iy:()=>a.Iy,CX:()=>a.CX,ur:()=>a.ur});var a=l(30358);l(31085),l(72194),l(14041),l(73893),l(3478),l(31242),l(3204),l(8178),l(78821),l(54268),l(88957),l(57999),l(31757),l(71197),l(79430),l(65998),l(39698),l(27042),l(28710),l(77914),l(47014),l(67238),l(72785),l(55640),l(72239),l(14691),l(27132),l(5720),l(95564);let n=e=>{let{organizations:t,workspaceMemberships:l,...a}=e,n=null==t?void 0:t.map(e=>({...e,id:e.id,__typename:"Organization"})),o=null==l?void 0:l.map(e=>({...e,workspace:{...e.workspace,__typename:"Organization"},__typename:"WorkspaceMembership"}));return{...a,organizations:n,workspaceMemberships:o,__typename:"User"}},o=async(e,t)=>{let l=e*Math.pow(2,t);return new Promise(e=>setTimeout(e,l))},i=async()=>{try{let e=await fetch("".concat(config.API_HOST,"/user"),{credentials:"include"});if(e.ok){let t=await e.json();return{status:"loggedIn",user:n(t)}}if(null.includes(e.status))return{status:"loggedOut",user:null};return{status:"error",user:null}}catch(e){return{status:"error",user:null}}},r=async function(){let{returnOfflineUser:e=!1,maxRetries:t=3,retryCount:l=0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},a=getStore(),n=isOfflineModeEnabled();if(e&&n&&!getIsOnline()){let e=getOrExpireOfflineUser();return e?{user:e,status:"loggedIn"}:{user:null,status:"loggedOut"}}let s=await i();if("error"===s.status){if(n&&!getIsOnline()){let e=getOrExpireOfflineUser();if(e)return{user:e,status:"loggedIn"}}return l{"use strict";l.d(t,{$E:()=>A,A1:()=>S,C9:()=>w,Kz:()=>C,XK:()=>x,mB:()=>v,uy:()=>k});var a=l(98092),n=l(8796),o=l(41054),i=l(46343),r=l.n(i),s=l(73893),d=l(86724),u=l(14691),c=l(6874);let m=(0,c.cX)(),f=(0,c.Fx)(m),p=(0,c.Xn)(m),g=new a.AbilityFactory,h=(0,n.Z0)({name:"User",initialState:(()=>{let e=(0,c._T)();return{userStatus:s.$.IS_CLIENT_SIDE&&!(0,c.Wd)(window.location.pathname)?e?"loading":"loggedOut":"loading",user:void 0,currentWorkspaceId:(0,d.o)(u.E.currentWorkspaceId,void 0),userAbility:g.createForUser(),isGammaAdminUser:!1,isGammaOrgUser:!1,anonymousUser:f,color:p}})(),reducers:{userFetched(e,t){let{status:l,user:a}=t.payload.response;e.userStatus=l,e.user=null!=a?a:void 0,e.userAbility=g.createForUser(null!=a?a:void 0,s.$.SHARE_TOKEN),e.isGammaAdminUser=["gamma-admin@gamma.app","gamma-admin-readonly@gamma.app"].includes((null==a?void 0:a.email)||""),e.isGammaOrgUser=(null==a?void 0:a.email.endsWith("@gamma.app"))||!1},setCurrentWorkspaceId(e,t){let{currentWorkspaceId:l}=t.payload;e.currentWorkspaceId=l}}}),{userFetched:b,setCurrentWorkspaceId:y}=h.actions,v=e=>e.User.user,k=e=>{var t;let l=v(e);return null==l?void 0:null===(t=l.settings)||void 0===t?void 0:t.locale},w=e=>e.User.currentWorkspaceId,x=(0,o.Mz)(v,w,(e,t)=>{var l,a;return null==e?void 0:null===(a=e.workspaceMemberships)||void 0===a?void 0:null===(l=a.find(e=>{var l;return(null===(l=e.workspace)||void 0===l?void 0:l.id)===t}))||void 0===l?void 0:l.workspace}),S=e=>(0,o.Mz)(v,t=>null!=t&&!!t.workspaceMemberships&&!!t.workspaceMemberships.find(t=>{var l;return(null===(l=t.workspace)||void 0===l?void 0:l.id)===e})),A=e=>(0,o.Mz)(v,x,(t,l)=>{var a,n,o;if(!t||!t.workspaceMemberships)return;let i=t.workspaceMemberships.find(t=>{var l;return(null===(l=t.workspace)||void 0===l?void 0:l.id)===e});if(i)return null==i?void 0:i.workspace;let s=[...t.workspaceMemberships].sort((e,t)=>{var l,a;let n=new Set(null===(l=e.workspace)||void 0===l?void 0:l.products),o=new Set(null===(a=t.workspace)||void 0===a?void 0:a.products);return r()(n,o)?0:n.size?-1:1}),d=null==s?void 0:null===(a=s[0])||void 0===a?void 0:a.workspace;return(null==d?void 0:null===(n=d.products)||void 0===n?void 0:n.includes("pro"))||(null==d?void 0:null===(o=d.products)||void 0===o?void 0:o.includes("plus"))?d:l}),C=h.reducer},6874:(e,t,l)=>{"use strict";l.d(t,{cX:()=>c,qU:()=>h,Fx:()=>m,Xn:()=>g,_T:()=>f,Wd:()=>p});var a=l(3478),n=l(1602),o=l.n(n),i=l(73893),r=l(90226),s=l(99742);let d="gamma_visitor_id",u=(0,s.d_)("0123456789abcdefghijklmnopqrstuvwxyz",15),c=()=>{let e=a.A.get(d)||void 0;if(e)return e;let t=u();return a.A.set(d,t,{domain:i.$.VISITOR_ID_COOKIE_DOMAIN,expires:3650,sameSite:"none",secure:!0}),t},m=e=>({id:e,displayName:e?(0,r.q)(e):""}),f=()=>!!a.A.get("gamma_logged_in"),p=e=>["/admin/render-generation"].includes(e),g=e=>{let t=e?(0,r.Z)(e):"#cccccc";return{value:t,isDark:o()(t).isDark()}},h=e=>[...Object.keys(e.set||{}).map(t=>{var l;return{op:"replace",path:"/"+t,value:null===(l=e.set)||void 0===l?void 0:l[t]}}),...(e.remove||[]).map(e=>({op:"remove",path:"/"+e}))]},28710:(e,t,l)=>{"use strict";l.d(t,{J:()=>s});var a=l(79430),n=l(65998);l(78821);var o=l(88957),i=l(33639);let r=async()=>{let e=(0,o.KA)(),t=(0,i.OS)(e.getState());if(t)return t;let l=await (0,a.AH)("zendesk");return l&&e.dispatch((0,i.Cv)(l)),l},s=async()=>{let[e]=await Promise.all([r(),n.of.initializePromise]),t=window.zE;t&&e&&n.of.get("zendesk")&&t("messenger","loginUser",t=>{console.log("Zendesk loginUser request:",e),console.log("Zendesk loginUser response:",t(e))})}},33639:(e,t,l)=>{"use strict";l.d(t,{Cv:()=>i,Ff:()=>d,OS:()=>s,nF:()=>r});var a=l(8796);let n={isOpen:!1,jwt:null},o=(0,a.Z0)({name:"Zendesk",initialState:n,reducers:{reset:()=>n,setZendeskJWT(e,t){e.jwt=t.payload},setIsZendeskOpen(e,t){let{isOpen:l}=t.payload;e.isOpen=l}}}),{setZendeskJWT:i,setIsZendeskOpen:r}=o.actions,s=e=>e.Zendesk.jwt,d=o.reducer},36661:(e,t,l)=>{"use strict";l.d(t,{m:()=>o,p:()=>n});var a=l(14041);let n=a.createContext({});function o(){return(0,a.useContext)(n)}},19463:(e,t,l)=>{"use strict";l.d(t,{Mi:()=>X});var a=l(83292),n=l(5276);function o(){let e=(0,a._)(["\n fragment DefaultThemeFontFields on ThemeFont {\n id\n name\n url\n }\n"]);return o=function(){return e},e}function i(){let e=(0,a._)(["\n ","\n fragment DefaultThemeFields on Theme {\n id\n workspaceId\n name\n headingFont\n headingFontWeight\n bodyFont\n bodyFontWeight\n accentColor\n logoUrl\n config\n priority\n previewUrl\n archived\n createdTime\n updatedTime\n fonts {\n ... on ThemeFont {\n ...DefaultThemeFontFields\n }\n }\n }\n"]);return i=function(){return e},e}function r(){let e=(0,a._)(["\n ","\n mutation CreateTheme($input: CreateThemeInput!) {\n createTheme(input: $input) {\n ...DefaultThemeFields\n docCount\n }\n }\n\n mutation UpdateTheme($input: UpdateThemeInput!) {\n updateTheme(input: $input) {\n ...DefaultThemeFields\n docCount\n }\n }\n\n mutation MakeThemeStandard($id: ID!, $newId: ID) {\n makeThemeStandard(id: $id, newId: $newId) {\n ...DefaultThemeFields\n docCount\n }\n }\n\n mutation DuplicateTheme($id: ID!) {\n duplicateTheme(id: $id) {\n ...DefaultThemeFields\n }\n }\n\n query GetTheme($id: ID) {\n theme(id: $id) {\n ...DefaultThemeFields\n createdBy {\n id\n displayName\n email\n profileImageUrl\n }\n }\n }\n\n query GetThemeWithCount($id: ID) {\n theme(id: $id) {\n ...DefaultThemeFields\n docCount\n siteCount\n createdBy {\n id\n displayName\n email\n profileImageUrl\n }\n }\n }\n\n query GetThemes($workspaceId: ID, $archived: Boolean) {\n themes(workspaceId: $workspaceId, archived: $archived) {\n ...DefaultThemeFields\n createdBy {\n id\n displayName\n email\n profileImageUrl\n }\n }\n }\n\n mutation ArchiveTheme($id: ID!) {\n archiveTheme(id: $id) {\n ...DefaultThemeFields\n docCount\n siteCount\n }\n }\n\n mutation UnarchiveTheme($id: ID!) {\n unarchiveTheme(id: $id) {\n ...DefaultThemeFields\n }\n }\n"]);return r=function(){return e},e}let s=(0,n.J1)(o()),d=(0,n.J1)(i(),s);function u(){let e=(0,a._)(["\n query SearchMention(\n $workspaceId: ID!\n $query: String!\n $types: [SearchType!] = [user, doc]\n ) {\n search(orgId: $workspaceId, query: $query, types: $types) {\n __typename\n ... on DocResult {\n id\n title\n text\n archived\n previewUrl\n createdBy {\n id\n displayName\n profileImageUrl\n }\n organization {\n id\n }\n editors {\n user {\n id\n displayName\n profileImageUrl\n }\n lastViewed\n lastEdited\n }\n docUser {\n lastViewed\n lastEdited\n favorited\n }\n orgAccess\n updatedTime\n createdTime\n editedTime\n }\n ... on User {\n id\n displayName\n email\n profileImageUrl\n }\n }\n }\n"]);return u=function(){return e},e}function c(){let e=(0,a._)(["\n fragment ReactionFields on Reaction {\n emoji\n count\n targetId\n targetType\n docId\n users {\n id\n displayName\n profileImageUrl\n }\n }\n"]);return c=function(){return e},e}function m(){let e=(0,a._)(["\n fragment CommentAuthorFields on User {\n id\n displayName\n profileImageUrl\n email\n }\n"]);return m=function(){return e},e}function f(){let e=(0,a._)(["\n ","\n ","\n fragment ReplyFields on Comment {\n id\n commentId\n content\n createdTime\n updatedTime\n archived\n user {\n ...CommentAuthorFields\n }\n reactions {\n ...ReactionFields\n }\n }\n"]);return f=function(){return e},e}function p(){let e=(0,a._)(["\n ","\n ","\n ","\n fragment CommentFields on Comment {\n id\n docId\n cardId\n content\n targetText\n targetHtml\n createdTime\n updatedTime\n archived\n targetId\n status\n user {\n ...CommentAuthorFields\n }\n replies {\n ...ReplyFields\n }\n reactions {\n ...ReactionFields\n }\n }\n"]);return p=function(){return e},e}function g(){let e=(0,a._)(["\n fragment DocCollaboratorFields on DocCollaborator {\n docId\n user {\n id\n displayName\n email\n profileImageUrl\n }\n permission\n guest\n accessLinkId\n }\n\n fragment DocInvitationsFields on DocInvitation {\n id\n docId\n email\n permission\n }\n"]);return g=function(){return e},e}function h(){let e=(0,a._)(["\n fragment DocChannelFields on DocChannel {\n id\n name\n slug\n permission\n }\n"]);return h=function(){return e},e}function b(){let e=(0,a._)(["\n fragment DocEditorsFields on DocEditor {\n user {\n id\n displayName\n email\n profileImageUrl\n }\n lastEdited\n }\n"]);return b=function(){return e},e}function y(){let e=(0,a._)(["\n ","\n fragment DocSiteFields on Site {\n id\n archived\n workspaceId\n name\n domains {\n id\n siteId\n name\n status\n builtin\n }\n hasCustomDomain\n routes {\n id\n siteId\n docId\n path\n offline\n doc {\n id\n title\n }\n }\n currentDeployment {\n id\n siteId\n buildHost\n deploymentTime\n }\n createdTime\n updatedTime\n previewUrl\n pageCount\n archived\n enabled\n faviconUrl\n themeId\n navEnabled\n navContent\n gtmContainerId\n metaPixelId\n }\n"]);return y=function(){return e},e}function v(){let e=(0,a._)(["\n ","\n mutation AddCollaborators(\n $docId: ID!\n $collaborators: [DocCollaboratorInput!]!\n ) {\n addCollaborators(docId: $docId, collaborators: $collaborators) {\n id\n collaborators {\n ...DocCollaboratorFields\n }\n invitations {\n ...DocInvitationsFields\n }\n }\n }\n"]);return v=function(){return e},e}function k(){let e=(0,a._)(["\n ","\n mutation RemoveCollaborators(\n $docId: ID!\n $collaborators: [DocCollaboratorRemovalInput!]!\n ) {\n removeCollaborators(docId: $docId, collaborators: $collaborators) {\n id\n collaborators {\n ...DocCollaboratorFields\n }\n invitations {\n ...DocInvitationsFields\n }\n }\n }\n"]);return k=function(){return e},e}function w(){let e=(0,a._)(["\n ","\n mutation AddCollaboratorByAccessLink($docId: ID!) {\n addCollaboratorByAccessLink(docId: $docId) {\n id\n collaborators {\n ...DocCollaboratorFields\n }\n }\n }\n"]);return w=function(){return e},e}function x(){let e=(0,a._)(["\n ","\n ","\n ","\n ","\n ","\n ","\n ","\n query GetDoc($id: ID!, $password: String) {\n doc(id: $id, password: $password) {\n id\n title\n titleEdited\n titleCard {\n previewUrl\n }\n archived\n disabled\n createdTime\n updatedTime\n editedTime\n savedTime\n currentSnapshotId\n publishedSnapshotId\n publishedSnapshot {\n content\n }\n publishedTime\n comments {\n ...CommentFields\n }\n reactions {\n ...ReactionFields\n }\n accessLinks {\n id\n docId\n type\n permission\n token\n url\n }\n links {\n url\n status\n }\n orgAccess\n organization {\n id\n name\n products\n }\n theme {\n ...DefaultThemeFields\n fonts {\n id\n name\n url\n }\n }\n collaborators {\n ...DocCollaboratorFields\n }\n invitations {\n ...DocInvitationsFields\n }\n editors {\n ...DocEditorsFields\n }\n createdBy {\n displayName\n id\n email\n }\n channels {\n ...DocChannelFields\n }\n site {\n ...DocSiteFields\n }\n docGenerateInput {\n id\n settings\n docGeneration {\n id\n generationType\n }\n }\n }\n }\n"]);return x=function(){return e},e}function S(){let e=(0,a._)(["\n query GetDocRobots($id: ID!) {\n doc(id: $id) {\n id\n title\n createdTime\n updatedTime\n currentSnapshot {\n id\n docId\n content\n }\n titleCard {\n previewUrl\n text\n }\n organization {\n id\n name\n products\n }\n createdBy {\n displayName\n id\n email\n }\n }\n }\n"]);return S=function(){return e},e}function A(){let e=(0,a._)(["\n ","\n ","\n ","\n ","\n ","\n ","\n subscription SubscribeToDoc($id: ID!) {\n doc(id: $id) {\n ... on DocSubscription {\n id\n title\n titleEdited\n titleCard {\n previewUrl\n }\n archived\n updatedTime\n editedTime\n savedTime\n publishedTime\n accessLinks {\n id\n docId\n type\n permission\n token\n url\n }\n channels {\n ...DocChannelFields\n }\n collaborators {\n ...DocCollaboratorFields\n }\n editors {\n ...DocEditorsFields\n }\n invitations {\n ...DocInvitationsFields\n }\n theme {\n ...DefaultThemeFields\n }\n reactions {\n ...ReactionFields\n }\n orgAccess\n }\n\n ... on DocCommentsSubscription {\n id\n comments {\n ...CommentFields\n }\n }\n ... on DocReactionsSubscription {\n id\n reactions {\n ...ReactionFields\n }\n }\n ... on DocLinksSubscription {\n id\n links {\n url\n status\n }\n }\n }\n }\n"]);return A=function(){return e},e}function C(){let e=(0,a._)(["\n mutation UpdateDocTitle($id: ID!, $title: String, $titleEdited: Boolean) {\n updateDoc(input: { id: $id, title: $title, titleEdited: $titleEdited }) {\n id\n title\n titleEdited\n }\n }\n"]);return C=function(){return e},e}function z(){let e=(0,a._)(["\n mutation UpdateDocOrgAccess($id: ID!, $orgAccess: Permission) {\n updateDoc(input: { id: $id, orgAccess: $orgAccess }) {\n id\n orgAccess\n }\n }\n"]);return z=function(){return e},e}function I(){let e=(0,a._)(["\n mutation UpdateDocAccessLinks($id: ID!, $accessLinks: [AccessLinkInput!]) {\n updateDoc(input: { id: $id, accessLinks: $accessLinks }) {\n id\n accessLinks {\n permission\n id\n }\n }\n }\n"]);return I=function(){return e},e}function j(){let e=(0,a._)(["\n ","\n mutation UpdateDocTheme($id: ID!, $themeId: String) {\n updateDoc(input: { id: $id, themeId: $themeId }) {\n id\n theme {\n ...DefaultThemeFields\n }\n }\n }\n"]);return j=function(){return e},e}function F(){let e=(0,a._)(["\n mutation InviteMembers($workspaceId: ID!, $invitees: [InvitationInput!]!) {\n inviteMembers(orgId: $workspaceId, invitees: $invitees) {\n id\n name\n invitations {\n email\n }\n }\n }\n"]);return F=function(){return e},e}function B(){let e=(0,a._)(["\n ","\n ","\n ","\n mutation CreateComment($input: CreateCommentInput) {\n createComment(input: $input) {\n id\n docId\n cardId\n content\n targetText\n targetHtml\n createdTime\n updatedTime\n commentId\n archived\n targetId\n status\n user {\n ...CommentAuthorFields\n }\n replies {\n ...ReplyFields\n }\n reactions {\n ...ReactionFields\n }\n }\n }\n"]);return B=function(){return e},e}function R(){let e=(0,a._)(["\n mutation UpdateComment($input: UpdateCommentInput!) {\n updateComment(input: $input) {\n id\n docId\n content\n updatedTime\n }\n }\n"]);return R=function(){return e},e}function _(){let e=(0,a._)(["\n mutation UpdateCommentStatus($input: UpdateCommentStatusInput!) {\n updateCommentStatus(input: $input) {\n id\n status\n updatedTime\n }\n }\n"]);return _=function(){return e},e}function M(){let e=(0,a._)(["\n mutation RemoveComment($id: ID!) {\n archiveComment(id: $id) {\n id\n archived\n }\n }\n"]);return M=function(){return e},e}function E(){let e=(0,a._)(["\n ","\n fragment DocReactionsCreate on Doc {\n reactions {\n ...ReactionFields\n }\n }\n"]);return E=function(){return e},e}function T(){let e=(0,a._)(["\n ","\n ","\n fragment DocCommentsCreate on Doc {\n comments {\n id\n docId\n cardId\n content\n targetText\n targetHtml\n createdTime\n updatedTime\n archived\n targetId\n status\n user {\n ...CommentAuthorFields\n }\n }\n }\n fragment DocRepliesCreate on Doc {\n comments {\n id\n replies {\n ...ReplyFields\n }\n }\n }\n fragment DocCommentsUpdate on Doc {\n comments {\n id\n docId\n content\n updatedTime\n reactions {\n ...ReactionFields\n }\n }\n }\n fragment DocRepliesUpdate on Doc {\n comments {\n id\n replies {\n id\n docId\n content\n updatedTime\n reactions {\n ...ReactionFields\n }\n }\n }\n }\n fragment DocCommentsRemove on Doc {\n comments {\n id\n archived\n }\n }\n fragment DocRepliesRemove on Doc {\n comments {\n id\n replies {\n id\n archived\n }\n }\n }\n"]);return T=function(){return e},e}function O(){let e=(0,a._)(["\n ","\n mutation AddReaction($reactionInput: AddReactionInput!) {\n addReaction(input: $reactionInput) {\n ...ReactionFields\n }\n }\n"]);return O=function(){return e},e}function P(){let e=(0,a._)(["\n ","\n mutation RemoveReaction($reactionInput: RemoveReactionInput!) {\n removeReaction(input: $reactionInput) {\n ...ReactionFields\n }\n }\n"]);return P=function(){return e},e}function N(){let e=(0,a._)(["\n query GetMemoAnalytics($memoId: ID!) {\n memoStats(id: $memoId) {\n memoId\n uniqueViewers\n uniqueEditors\n cardCount\n lastOpened\n viewers {\n user {\n id\n displayName\n email\n profileImageUrl\n }\n visitorId\n lastOpened\n cardsViewed\n }\n dailyViews {\n dayCount\n timezone\n everyone {\n date\n uniqueVisitors\n }\n viewers {\n date\n uniqueVisitors\n }\n }\n }\n }\n\n query GetDocCardsAnalytics($docId: ID!, $userId: ID) {\n docCardsStats(docId: $docId, userId: $userId) {\n docId\n uniqueVisitors\n uniqueEditors\n cardCount\n everyone {\n cardId\n viewTimePercent\n viewersPercent\n }\n viewers {\n cardId\n viewTimePercent\n viewersPercent\n }\n }\n }\n"]);return N=function(){return e},e}function D(){let e=(0,a._)(["\n mutation SetDocPassword($docId: ID!, $password: String!) {\n setDocPassword(id: $docId, password: $password) {\n id\n accessLinks {\n id\n permission\n type\n }\n }\n }\n"]);return D=function(){return e},e}function L(){let e=(0,a._)(["\n mutation RemoveDocPassword($docId: ID!) {\n removeDocPassword(id: $docId) {\n id\n accessLinks {\n id\n permission\n type\n }\n }\n }\n"]);return L=function(){return e},e}function W(){let e=(0,a._)(["\n query GetDocPassword($docId: ID!) {\n getDocPassword(id: $docId)\n }\n"]);return W=function(){return e},e}function U(){let e=(0,a._)(["\n query GetPublicDoc($docId: ID!) {\n publicDoc(id: $docId) {\n id\n logoUrl\n }\n }\n"]);return U=function(){return e},e}function G(){let e=(0,a._)(["\n query GetDocCurrentSnapshotId($id: ID!) {\n doc(id: $id) {\n id\n currentSnapshotId\n }\n }\n"]);return G=function(){return e},e}(0,n.J1)(r(),d),(0,n.J1)(u());let H=(0,n.J1)(c()),V=(0,n.J1)(m()),q=(0,n.J1)(f(),H,V),K=(0,n.J1)(p(),q,H,V),J=(0,n.J1)(g()),$=(0,n.J1)(h()),Q=(0,n.J1)(b()),Y=(0,n.J1)(y(),d);(0,n.J1)(v(),J),(0,n.J1)(k(),J),(0,n.J1)(w(),J),(0,n.J1)(x(),K,J,Q,$,Y,d,H),(0,n.J1)(S()),(0,n.J1)(A(),K,J,Q,$,d,H),(0,n.J1)(C()),(0,n.J1)(z()),(0,n.J1)(I()),(0,n.J1)(j(),d),(0,n.J1)(F()),(0,n.J1)(B(),q,H,V),(0,n.J1)(R()),(0,n.J1)(_()),(0,n.J1)(M()),(0,n.J1)(E(),H);let X=(0,n.J1)(T(),q,V);(0,n.J1)(O(),H),(0,n.J1)(P(),H),(0,n.J1)(N()),(0,n.J1)(D()),(0,n.J1)(L()),(0,n.J1)(W()),(0,n.J1)(U()),(0,n.J1)(G())},76636:(e,t,l)=>{"use strict";let a,n;l.d(t,{a:()=>lL});var o=l(31085),i=l(25420),r=l(43342),s=l(31242),d=l(14041),u=l(31303),c=l(65998),m=l(88957),f=l(13154);let p=()=>((0,d.useEffect)(()=>{(0,f.M)()},[]),(0,o.jsx)("div",{dangerouslySetInnerHTML:{__html:"